@earbug/db-models 0.0.62 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +10 -0
- package/.github/workflows/publish.yaml +303 -0
- package/.nvmrc +1 -0
- package/Dockerfile.generate +19 -0
- package/model_options.json +3 -0
- package/models/AccessControlPreference.ts +53 -0
- package/models/AffinityRelationshipType.ts +96 -0
- package/models/AffinityTier.ts +131 -0
- package/models/AppUser.ts +577 -0
- package/models/AppUserDevice.ts +101 -0
- package/models/AppUserDeviceClassicBackup20260906.ts +66 -0
- package/models/AppUserFollowRelation.ts +128 -0
- package/models/AppUserPlatformRelation.ts +150 -0
- package/models/CanonAlbum.ts +229 -0
- package/models/CanonAlbumExternalReferenceRelation.ts +92 -0
- package/models/CanonAlbumGenreRelation.ts +86 -0
- package/models/CanonAlbumLabelRelation.ts +86 -0
- package/models/CanonAlbumTrackRelation.ts +92 -0
- package/models/CanonArtist.ts +356 -0
- package/models/CanonArtistAlbumRelation.ts +92 -0
- package/models/CanonArtistExternalReferenceRelation.ts +92 -0
- package/models/CanonArtistGenreRelation.ts +86 -0
- package/models/CanonArtistMemberRelation.ts +86 -0
- package/models/CanonArtistTrackRelation.ts +92 -0
- package/models/CanonGenre.ts +273 -0
- package/models/CanonGenreExternalReferenceRelation.ts +92 -0
- package/models/CanonLabel.ts +129 -0
- package/models/CanonLabelExternalReferenceRelation.ts +92 -0
- package/models/CanonMember.ts +130 -0
- package/models/CanonMemberExternalReferenceRelation.ts +99 -0
- package/models/CanonToPlatformAlbumRelation.ts +92 -0
- package/models/CanonToPlatformArtistRelation.ts +92 -0
- package/models/CanonToPlatformGenreRelation.ts +86 -0
- package/models/CanonToPlatformTrackRelation.ts +92 -0
- package/models/CanonTrack.ts +232 -0
- package/models/ConfigParam.ts +62 -0
- package/models/ExternalReference.ts +201 -0
- package/models/FeedConfig.ts +65 -0
- package/models/FeedContentType.ts +124 -0
- package/models/GuestUser.ts +137 -0
- package/models/JukeboxAccessType.ts +60 -0
- package/models/JukeboxCanonGenreRelation.ts +108 -0
- package/models/JukeboxInvite.ts +125 -0
- package/models/JukeboxQueueEntry.ts +247 -0
- package/models/JukeboxQueueMode.ts +60 -0
- package/models/JukeboxSession.ts +334 -0
- package/models/JukeboxSessionArtistAffinity.ts +136 -0
- package/models/JukeboxSessionGenreAffinity.ts +136 -0
- package/models/JukeboxStatus.ts +58 -0
- package/models/JukeboxTerminationCondition.ts +60 -0
- package/models/JukeboxType.ts +60 -0
- package/models/JukeboxUser.ts +182 -0
- package/models/JukeboxUserType.ts +58 -0
- package/models/KnexMigrations.ts +60 -0
- package/models/KnexMigrationsLock.ts +48 -0
- package/models/MerchItem.ts +198 -0
- package/models/MerchOrchestration.ts +130 -0
- package/models/MerchPlatform.ts +95 -0
- package/models/MerchType.ts +89 -0
- package/models/MetricsDaily.ts +79 -0
- package/models/MetricsEvent.ts +124 -0
- package/models/NewsArticle.ts +177 -0
- package/models/NewsPlatform.ts +76 -0
- package/models/NewsSite.ts +75 -0
- package/models/Notification.ts +214 -0
- package/models/NotificationType.ts +66 -0
- package/models/PauseStatusType.ts +58 -0
- package/models/Platform.ts +189 -0
- package/models/PlatformAlbum.ts +398 -0
- package/models/PlatformAlbumGenreRelation.ts +86 -0
- package/models/PlatformAlbumTrackRelation.ts +92 -0
- package/models/PlatformArtist.ts +358 -0
- package/models/PlatformArtistAlbumRelation.ts +92 -0
- package/models/PlatformArtistGenreRelation.ts +86 -0
- package/models/PlatformArtistTrackRelation.ts +92 -0
- package/models/PlatformGenre.ts +194 -0
- package/models/PlatformTrack.ts +339 -0
- package/models/PlatformTrackGenreRelation.ts +86 -0
- package/models/PlatformUserAlbum.ts +152 -0
- package/models/PlatformUserAlbumTrack.ts +138 -0
- package/models/PlatformUserPlaylist.ts +260 -0
- package/models/PlatformUserPlaylistArtistAffinity.ts +136 -0
- package/models/PlatformUserPlaylistGenreAffinity.ts +136 -0
- package/models/PlatformUserPlaylistTrack.ts +162 -0
- package/models/PlaybackStatus.ts +47 -0
- package/models/PlaybackStatusType.ts +58 -0
- package/models/RadioShow.ts +209 -0
- package/models/RadioShowGenres.ts +107 -0
- package/models/RadioShowMedia.ts +181 -0
- package/models/RadioShowPlacement.ts +115 -0
- package/models/RadioShowPublishRequests.ts +86 -0
- package/models/State.ts +86 -0
- package/models/TrackDeletionReason.ts +58 -0
- package/models/UnmatchedAlbum.ts +66 -0
- package/models/UnmatchedArtist.ts +81 -0
- package/models/UserAbuseReports.ts +232 -0
- package/models/UserAffinity.ts +117 -0
- package/models/UserArtistAffinity.ts +136 -0
- package/models/UserBookmarks.ts +235 -0
- package/models/UserComments.ts +271 -0
- package/models/UserContacts.ts +155 -0
- package/models/UserEngagementFactor.ts +109 -0
- package/models/UserGenreAffinity.ts +136 -0
- package/models/UserLikes.ts +235 -0
- package/models/UserMessages.ts +189 -0
- package/models/Versus.ts +438 -0
- package/models/VersusAccessType.ts +66 -0
- package/models/VersusCoCreator.ts +111 -0
- package/models/VersusCreatorScope.ts +66 -0
- package/models/VersusEndMode.ts +66 -0
- package/models/VersusEndTimerDuration.ts +81 -0
- package/models/VersusEndVoteThreshold.ts +67 -0
- package/models/VersusEntityKind.ts +79 -0
- package/models/VersusOption.ts +258 -0
- package/models/VersusPublishIssue.ts +146 -0
- package/models/VersusQuestion.ts +123 -0
- package/models/VersusQuestionVariableType.ts +66 -0
- package/models/VersusVote.ts +99 -0
- package/models/VersusVotingListType.ts +66 -0
- package/models/VersusVotingMode.ts +66 -0
- package/models/index.ts +3 -0
- package/models/init-models.ts +1259 -0
- package/models/initDb.ts +72 -0
- package/models/rdsCaBundle.ts +5 -0
- package/package.json +2 -5
- package/scripts/generate-and-upload.mjs +123 -0
- package/scripts/update-rds-ca-bundle.mjs +44 -0
- package/tsconfig.json +52 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { FeedContentType, FeedContentTypeId } from './FeedContentType';
|
|
5
|
+
|
|
6
|
+
export interface UserEngagementFactorAttributes {
|
|
7
|
+
id: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
contentTypeId: string;
|
|
10
|
+
engagementFactor: number;
|
|
11
|
+
createDate?: Date;
|
|
12
|
+
updateDate?: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type UserEngagementFactorPk = "id";
|
|
16
|
+
export type UserEngagementFactorId = UserEngagementFactor[UserEngagementFactorPk];
|
|
17
|
+
export type UserEngagementFactorOptionalAttributes = "id" | "engagementFactor" | "createDate" | "updateDate";
|
|
18
|
+
export type UserEngagementFactorCreationAttributes = Optional<UserEngagementFactorAttributes, UserEngagementFactorOptionalAttributes>;
|
|
19
|
+
|
|
20
|
+
export class UserEngagementFactor extends Model<UserEngagementFactorAttributes, UserEngagementFactorCreationAttributes> implements UserEngagementFactorAttributes {
|
|
21
|
+
id!: string;
|
|
22
|
+
userId!: string;
|
|
23
|
+
contentTypeId!: string;
|
|
24
|
+
engagementFactor!: number;
|
|
25
|
+
createDate?: Date;
|
|
26
|
+
updateDate?: Date;
|
|
27
|
+
|
|
28
|
+
// UserEngagementFactor belongsTo AppUser via userId
|
|
29
|
+
user!: AppUser;
|
|
30
|
+
getUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
31
|
+
setUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
32
|
+
createUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
33
|
+
// UserEngagementFactor belongsTo FeedContentType via contentTypeId
|
|
34
|
+
contentType!: FeedContentType;
|
|
35
|
+
getContentType!: Sequelize.BelongsToGetAssociationMixin<FeedContentType>;
|
|
36
|
+
setContentType!: Sequelize.BelongsToSetAssociationMixin<FeedContentType, FeedContentTypeId>;
|
|
37
|
+
createContentType!: Sequelize.BelongsToCreateAssociationMixin<FeedContentType>;
|
|
38
|
+
|
|
39
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserEngagementFactor {
|
|
40
|
+
return UserEngagementFactor.init({
|
|
41
|
+
id: {
|
|
42
|
+
type: DataTypes.UUID,
|
|
43
|
+
allowNull: false,
|
|
44
|
+
defaultValue: DataTypes.UUIDV4,
|
|
45
|
+
primaryKey: true
|
|
46
|
+
},
|
|
47
|
+
userId: {
|
|
48
|
+
type: DataTypes.UUID,
|
|
49
|
+
allowNull: false,
|
|
50
|
+
references: {
|
|
51
|
+
model: 'app_user',
|
|
52
|
+
key: 'id'
|
|
53
|
+
},
|
|
54
|
+
unique: "user_engagement_factor_user_id_content_type_id_unique",
|
|
55
|
+
field: 'user_id'
|
|
56
|
+
},
|
|
57
|
+
contentTypeId: {
|
|
58
|
+
type: DataTypes.UUID,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
references: {
|
|
61
|
+
model: 'feed_content_type',
|
|
62
|
+
key: 'id'
|
|
63
|
+
},
|
|
64
|
+
unique: "user_engagement_factor_user_id_content_type_id_unique",
|
|
65
|
+
field: 'content_type_id'
|
|
66
|
+
},
|
|
67
|
+
engagementFactor: {
|
|
68
|
+
type: DataTypes.DECIMAL,
|
|
69
|
+
allowNull: false,
|
|
70
|
+
defaultValue: 1,
|
|
71
|
+
field: 'engagement_factor'
|
|
72
|
+
},
|
|
73
|
+
createDate: {
|
|
74
|
+
type: DataTypes.DATE,
|
|
75
|
+
allowNull: true,
|
|
76
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
77
|
+
field: 'create_date'
|
|
78
|
+
},
|
|
79
|
+
updateDate: {
|
|
80
|
+
type: DataTypes.DATE,
|
|
81
|
+
allowNull: true,
|
|
82
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
83
|
+
field: 'update_date'
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
sequelize,
|
|
87
|
+
tableName: 'user_engagement_factor',
|
|
88
|
+
schema: 'eb',
|
|
89
|
+
timestamps: false,
|
|
90
|
+
indexes: [
|
|
91
|
+
{
|
|
92
|
+
name: "user_engagement_factor_pkey",
|
|
93
|
+
unique: true,
|
|
94
|
+
fields: [
|
|
95
|
+
{ name: "id" },
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "user_engagement_factor_user_id_content_type_id_unique",
|
|
100
|
+
unique: true,
|
|
101
|
+
fields: [
|
|
102
|
+
{ name: "user_id" },
|
|
103
|
+
{ name: "content_type_id" },
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AffinityTier, AffinityTierId } from './AffinityTier';
|
|
4
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
5
|
+
import type { CanonGenre, CanonGenreId } from './CanonGenre';
|
|
6
|
+
|
|
7
|
+
export interface UserGenreAffinityAttributes {
|
|
8
|
+
id: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
canonGenreId: string;
|
|
11
|
+
affinityTierId: number;
|
|
12
|
+
rank: number;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type UserGenreAffinityPk = "id";
|
|
18
|
+
export type UserGenreAffinityId = UserGenreAffinity[UserGenreAffinityPk];
|
|
19
|
+
export type UserGenreAffinityOptionalAttributes = "id" | "createdAt" | "updatedAt";
|
|
20
|
+
export type UserGenreAffinityCreationAttributes = Optional<UserGenreAffinityAttributes, UserGenreAffinityOptionalAttributes>;
|
|
21
|
+
|
|
22
|
+
export class UserGenreAffinity extends Model<UserGenreAffinityAttributes, UserGenreAffinityCreationAttributes> implements UserGenreAffinityAttributes {
|
|
23
|
+
id!: string;
|
|
24
|
+
userId!: string;
|
|
25
|
+
canonGenreId!: string;
|
|
26
|
+
affinityTierId!: number;
|
|
27
|
+
rank!: number;
|
|
28
|
+
createdAt!: Date;
|
|
29
|
+
updatedAt!: Date;
|
|
30
|
+
|
|
31
|
+
// UserGenreAffinity belongsTo AffinityTier via affinityTierId
|
|
32
|
+
affinityTier!: AffinityTier;
|
|
33
|
+
getAffinityTier!: Sequelize.BelongsToGetAssociationMixin<AffinityTier>;
|
|
34
|
+
setAffinityTier!: Sequelize.BelongsToSetAssociationMixin<AffinityTier, AffinityTierId>;
|
|
35
|
+
createAffinityTier!: Sequelize.BelongsToCreateAssociationMixin<AffinityTier>;
|
|
36
|
+
// UserGenreAffinity belongsTo AppUser via userId
|
|
37
|
+
user!: AppUser;
|
|
38
|
+
getUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
39
|
+
setUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
40
|
+
createUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
41
|
+
// UserGenreAffinity belongsTo CanonGenre via canonGenreId
|
|
42
|
+
canonGenre!: CanonGenre;
|
|
43
|
+
getCanonGenre!: Sequelize.BelongsToGetAssociationMixin<CanonGenre>;
|
|
44
|
+
setCanonGenre!: Sequelize.BelongsToSetAssociationMixin<CanonGenre, CanonGenreId>;
|
|
45
|
+
createCanonGenre!: Sequelize.BelongsToCreateAssociationMixin<CanonGenre>;
|
|
46
|
+
|
|
47
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserGenreAffinity {
|
|
48
|
+
return UserGenreAffinity.init({
|
|
49
|
+
id: {
|
|
50
|
+
type: DataTypes.UUID,
|
|
51
|
+
allowNull: false,
|
|
52
|
+
defaultValue: DataTypes.UUIDV4,
|
|
53
|
+
primaryKey: true
|
|
54
|
+
},
|
|
55
|
+
userId: {
|
|
56
|
+
type: DataTypes.UUID,
|
|
57
|
+
allowNull: false,
|
|
58
|
+
references: {
|
|
59
|
+
model: 'app_user',
|
|
60
|
+
key: 'id'
|
|
61
|
+
},
|
|
62
|
+
unique: "user_genre_affinity_user_id_canon_genre_id_unique",
|
|
63
|
+
field: 'user_id'
|
|
64
|
+
},
|
|
65
|
+
canonGenreId: {
|
|
66
|
+
type: DataTypes.UUID,
|
|
67
|
+
allowNull: false,
|
|
68
|
+
references: {
|
|
69
|
+
model: 'canon_genre',
|
|
70
|
+
key: 'id'
|
|
71
|
+
},
|
|
72
|
+
unique: "user_genre_affinity_user_id_canon_genre_id_unique",
|
|
73
|
+
field: 'canon_genre_id'
|
|
74
|
+
},
|
|
75
|
+
affinityTierId: {
|
|
76
|
+
type: DataTypes.SMALLINT,
|
|
77
|
+
allowNull: false,
|
|
78
|
+
references: {
|
|
79
|
+
model: 'affinity_tier',
|
|
80
|
+
key: 'id'
|
|
81
|
+
},
|
|
82
|
+
field: 'affinity_tier_id'
|
|
83
|
+
},
|
|
84
|
+
rank: {
|
|
85
|
+
type: DataTypes.INTEGER,
|
|
86
|
+
allowNull: false
|
|
87
|
+
},
|
|
88
|
+
createdAt: {
|
|
89
|
+
type: DataTypes.DATE,
|
|
90
|
+
allowNull: false,
|
|
91
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
92
|
+
field: 'created_at'
|
|
93
|
+
},
|
|
94
|
+
updatedAt: {
|
|
95
|
+
type: DataTypes.DATE,
|
|
96
|
+
allowNull: false,
|
|
97
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
98
|
+
field: 'updated_at'
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
sequelize,
|
|
102
|
+
tableName: 'user_genre_affinity',
|
|
103
|
+
schema: 'eb',
|
|
104
|
+
timestamps: false,
|
|
105
|
+
indexes: [
|
|
106
|
+
{
|
|
107
|
+
name: "idx_user_genre_affinity_genre",
|
|
108
|
+
fields: [
|
|
109
|
+
{ name: "canon_genre_id" },
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "idx_user_genre_affinity_session",
|
|
114
|
+
fields: [
|
|
115
|
+
{ name: "user_id" },
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "user_genre_affinity_pkey",
|
|
120
|
+
unique: true,
|
|
121
|
+
fields: [
|
|
122
|
+
{ name: "id" },
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "user_genre_affinity_user_id_canon_genre_id_unique",
|
|
127
|
+
unique: true,
|
|
128
|
+
fields: [
|
|
129
|
+
{ name: "user_id" },
|
|
130
|
+
{ name: "canon_genre_id" },
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
|
|
5
|
+
import type { MerchItem, MerchItemId } from './MerchItem';
|
|
6
|
+
import type { NewsArticle, NewsArticleId } from './NewsArticle';
|
|
7
|
+
import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
|
|
8
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
9
|
+
|
|
10
|
+
export interface UserLikesAttributes {
|
|
11
|
+
id: string;
|
|
12
|
+
appUserId: string;
|
|
13
|
+
jukeboxId?: string;
|
|
14
|
+
playlistId?: string;
|
|
15
|
+
radioShowId?: string;
|
|
16
|
+
createDate: Date;
|
|
17
|
+
updateDate: Date;
|
|
18
|
+
merchItemId?: string;
|
|
19
|
+
newsArticleId?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type UserLikesPk = "id";
|
|
23
|
+
export type UserLikesId = UserLikes[UserLikesPk];
|
|
24
|
+
export type UserLikesOptionalAttributes = "id" | "jukeboxId" | "playlistId" | "radioShowId" | "createDate" | "updateDate" | "merchItemId" | "newsArticleId";
|
|
25
|
+
export type UserLikesCreationAttributes = Optional<UserLikesAttributes, UserLikesOptionalAttributes>;
|
|
26
|
+
|
|
27
|
+
export class UserLikes extends Model<UserLikesAttributes, UserLikesCreationAttributes> implements UserLikesAttributes {
|
|
28
|
+
id!: string;
|
|
29
|
+
appUserId!: string;
|
|
30
|
+
jukeboxId?: string;
|
|
31
|
+
playlistId?: string;
|
|
32
|
+
radioShowId?: string;
|
|
33
|
+
createDate!: Date;
|
|
34
|
+
updateDate!: Date;
|
|
35
|
+
merchItemId?: string;
|
|
36
|
+
newsArticleId?: string;
|
|
37
|
+
|
|
38
|
+
// UserLikes belongsTo AppUser via appUserId
|
|
39
|
+
appUser!: AppUser;
|
|
40
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
41
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
42
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
43
|
+
// UserLikes belongsTo JukeboxSession via jukeboxId
|
|
44
|
+
jukebox!: JukeboxSession;
|
|
45
|
+
getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
|
|
46
|
+
setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
|
|
47
|
+
createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
|
|
48
|
+
// UserLikes belongsTo MerchItem via merchItemId
|
|
49
|
+
merchItem!: MerchItem;
|
|
50
|
+
getMerchItem!: Sequelize.BelongsToGetAssociationMixin<MerchItem>;
|
|
51
|
+
setMerchItem!: Sequelize.BelongsToSetAssociationMixin<MerchItem, MerchItemId>;
|
|
52
|
+
createMerchItem!: Sequelize.BelongsToCreateAssociationMixin<MerchItem>;
|
|
53
|
+
// UserLikes belongsTo NewsArticle via newsArticleId
|
|
54
|
+
newsArticle!: NewsArticle;
|
|
55
|
+
getNewsArticle!: Sequelize.BelongsToGetAssociationMixin<NewsArticle>;
|
|
56
|
+
setNewsArticle!: Sequelize.BelongsToSetAssociationMixin<NewsArticle, NewsArticleId>;
|
|
57
|
+
createNewsArticle!: Sequelize.BelongsToCreateAssociationMixin<NewsArticle>;
|
|
58
|
+
// UserLikes belongsTo PlatformUserPlaylist via playlistId
|
|
59
|
+
playlist!: PlatformUserPlaylist;
|
|
60
|
+
getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
|
|
61
|
+
setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
62
|
+
createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
|
|
63
|
+
// UserLikes belongsTo RadioShow via radioShowId
|
|
64
|
+
radioShow!: RadioShow;
|
|
65
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
66
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
67
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
68
|
+
|
|
69
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserLikes {
|
|
70
|
+
return UserLikes.init({
|
|
71
|
+
id: {
|
|
72
|
+
type: DataTypes.UUID,
|
|
73
|
+
allowNull: false,
|
|
74
|
+
defaultValue: DataTypes.UUIDV4,
|
|
75
|
+
primaryKey: true
|
|
76
|
+
},
|
|
77
|
+
appUserId: {
|
|
78
|
+
type: DataTypes.UUID,
|
|
79
|
+
allowNull: false,
|
|
80
|
+
references: {
|
|
81
|
+
model: 'app_user',
|
|
82
|
+
key: 'id'
|
|
83
|
+
},
|
|
84
|
+
field: 'app_user_id'
|
|
85
|
+
},
|
|
86
|
+
jukeboxId: {
|
|
87
|
+
type: DataTypes.UUID,
|
|
88
|
+
allowNull: true,
|
|
89
|
+
references: {
|
|
90
|
+
model: 'jukebox_session',
|
|
91
|
+
key: 'id'
|
|
92
|
+
},
|
|
93
|
+
field: 'jukebox_id'
|
|
94
|
+
},
|
|
95
|
+
playlistId: {
|
|
96
|
+
type: DataTypes.UUID,
|
|
97
|
+
allowNull: true,
|
|
98
|
+
references: {
|
|
99
|
+
model: 'platform_user_playlist',
|
|
100
|
+
key: 'id'
|
|
101
|
+
},
|
|
102
|
+
field: 'playlist_id'
|
|
103
|
+
},
|
|
104
|
+
radioShowId: {
|
|
105
|
+
type: DataTypes.UUID,
|
|
106
|
+
allowNull: true,
|
|
107
|
+
references: {
|
|
108
|
+
model: 'radio_show',
|
|
109
|
+
key: 'id'
|
|
110
|
+
},
|
|
111
|
+
field: 'radio_show_id'
|
|
112
|
+
},
|
|
113
|
+
createDate: {
|
|
114
|
+
type: DataTypes.DATE,
|
|
115
|
+
allowNull: false,
|
|
116
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
117
|
+
field: 'create_date'
|
|
118
|
+
},
|
|
119
|
+
updateDate: {
|
|
120
|
+
type: DataTypes.DATE,
|
|
121
|
+
allowNull: false,
|
|
122
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
123
|
+
field: 'update_date'
|
|
124
|
+
},
|
|
125
|
+
merchItemId: {
|
|
126
|
+
type: DataTypes.UUID,
|
|
127
|
+
allowNull: true,
|
|
128
|
+
references: {
|
|
129
|
+
model: 'merch_item',
|
|
130
|
+
key: 'id'
|
|
131
|
+
},
|
|
132
|
+
field: 'merch_item_id'
|
|
133
|
+
},
|
|
134
|
+
newsArticleId: {
|
|
135
|
+
type: DataTypes.UUID,
|
|
136
|
+
allowNull: true,
|
|
137
|
+
references: {
|
|
138
|
+
model: 'news_article',
|
|
139
|
+
key: 'id'
|
|
140
|
+
},
|
|
141
|
+
field: 'news_article_id'
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
sequelize,
|
|
145
|
+
tableName: 'user_likes',
|
|
146
|
+
schema: 'eb',
|
|
147
|
+
timestamps: false,
|
|
148
|
+
indexes: [
|
|
149
|
+
{
|
|
150
|
+
name: "idx_user_likes_jukebox",
|
|
151
|
+
fields: [
|
|
152
|
+
{ name: "jukebox_id" },
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "idx_user_likes_merch_item",
|
|
157
|
+
fields: [
|
|
158
|
+
{ name: "merch_item_id" },
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "idx_user_likes_news_article",
|
|
163
|
+
fields: [
|
|
164
|
+
{ name: "news_article_id" },
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "idx_user_likes_playlist",
|
|
169
|
+
fields: [
|
|
170
|
+
{ name: "playlist_id" },
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "idx_user_likes_radio_show",
|
|
175
|
+
fields: [
|
|
176
|
+
{ name: "radio_show_id" },
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "idx_user_likes_user",
|
|
181
|
+
fields: [
|
|
182
|
+
{ name: "app_user_id" },
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "uq_user_likes_user_jukebox",
|
|
187
|
+
unique: true,
|
|
188
|
+
fields: [
|
|
189
|
+
{ name: "app_user_id" },
|
|
190
|
+
{ name: "jukebox_id" },
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "uq_user_likes_user_merch_item",
|
|
195
|
+
unique: true,
|
|
196
|
+
fields: [
|
|
197
|
+
{ name: "app_user_id" },
|
|
198
|
+
{ name: "merch_item_id" },
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "uq_user_likes_user_news_article",
|
|
203
|
+
unique: true,
|
|
204
|
+
fields: [
|
|
205
|
+
{ name: "app_user_id" },
|
|
206
|
+
{ name: "news_article_id" },
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "uq_user_likes_user_playlist",
|
|
211
|
+
unique: true,
|
|
212
|
+
fields: [
|
|
213
|
+
{ name: "app_user_id" },
|
|
214
|
+
{ name: "playlist_id" },
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "uq_user_likes_user_radio_show",
|
|
219
|
+
unique: true,
|
|
220
|
+
fields: [
|
|
221
|
+
{ name: "app_user_id" },
|
|
222
|
+
{ name: "radio_show_id" },
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "user_likes_pkey",
|
|
227
|
+
unique: true,
|
|
228
|
+
fields: [
|
|
229
|
+
{ name: "id" },
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { UserAbuseReports, UserAbuseReportsId } from './UserAbuseReports';
|
|
5
|
+
|
|
6
|
+
export interface UserMessagesAttributes {
|
|
7
|
+
id: string;
|
|
8
|
+
senderId: string;
|
|
9
|
+
recipientId: string;
|
|
10
|
+
message: string;
|
|
11
|
+
hasBeenRead: boolean;
|
|
12
|
+
hasBeenEdited: boolean;
|
|
13
|
+
hasDeletedBySender: boolean;
|
|
14
|
+
hasDeletedByReceiver: boolean;
|
|
15
|
+
replyMessageId?: string;
|
|
16
|
+
createDate: Date;
|
|
17
|
+
updateDate: Date;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type UserMessagesPk = "id";
|
|
21
|
+
export type UserMessagesId = UserMessages[UserMessagesPk];
|
|
22
|
+
export type UserMessagesOptionalAttributes = "id" | "replyMessageId" | "createDate" | "updateDate";
|
|
23
|
+
export type UserMessagesCreationAttributes = Optional<UserMessagesAttributes, UserMessagesOptionalAttributes>;
|
|
24
|
+
|
|
25
|
+
export class UserMessages extends Model<UserMessagesAttributes, UserMessagesCreationAttributes> implements UserMessagesAttributes {
|
|
26
|
+
id!: string;
|
|
27
|
+
senderId!: string;
|
|
28
|
+
recipientId!: string;
|
|
29
|
+
message!: string;
|
|
30
|
+
hasBeenRead!: boolean;
|
|
31
|
+
hasBeenEdited!: boolean;
|
|
32
|
+
hasDeletedBySender!: boolean;
|
|
33
|
+
hasDeletedByReceiver!: boolean;
|
|
34
|
+
replyMessageId?: string;
|
|
35
|
+
createDate!: Date;
|
|
36
|
+
updateDate!: Date;
|
|
37
|
+
|
|
38
|
+
// UserMessages belongsTo AppUser via recipientId
|
|
39
|
+
recipient!: AppUser;
|
|
40
|
+
getRecipient!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
41
|
+
setRecipient!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
42
|
+
createRecipient!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
43
|
+
// UserMessages belongsTo AppUser via senderId
|
|
44
|
+
sender!: AppUser;
|
|
45
|
+
getSender!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
46
|
+
setSender!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
47
|
+
createSender!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
48
|
+
// UserMessages hasMany UserAbuseReports via directMessageId
|
|
49
|
+
userAbuseReports!: UserAbuseReports[];
|
|
50
|
+
getUserAbuseReports!: Sequelize.HasManyGetAssociationsMixin<UserAbuseReports>;
|
|
51
|
+
setUserAbuseReports!: Sequelize.HasManySetAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
52
|
+
addUserAbuseReport!: Sequelize.HasManyAddAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
53
|
+
addUserAbuseReports!: Sequelize.HasManyAddAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
54
|
+
createUserAbuseReport!: Sequelize.HasManyCreateAssociationMixin<UserAbuseReports>;
|
|
55
|
+
removeUserAbuseReport!: Sequelize.HasManyRemoveAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
56
|
+
removeUserAbuseReports!: Sequelize.HasManyRemoveAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
57
|
+
hasUserAbuseReport!: Sequelize.HasManyHasAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
58
|
+
hasUserAbuseReports!: Sequelize.HasManyHasAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
59
|
+
countUserAbuseReports!: Sequelize.HasManyCountAssociationsMixin;
|
|
60
|
+
// UserMessages belongsTo UserMessages via replyMessageId
|
|
61
|
+
replyMessage!: UserMessages;
|
|
62
|
+
getReplyMessage!: Sequelize.BelongsToGetAssociationMixin<UserMessages>;
|
|
63
|
+
setReplyMessage!: Sequelize.BelongsToSetAssociationMixin<UserMessages, UserMessagesId>;
|
|
64
|
+
createReplyMessage!: Sequelize.BelongsToCreateAssociationMixin<UserMessages>;
|
|
65
|
+
|
|
66
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserMessages {
|
|
67
|
+
return UserMessages.init({
|
|
68
|
+
id: {
|
|
69
|
+
type: DataTypes.UUID,
|
|
70
|
+
allowNull: false,
|
|
71
|
+
defaultValue: DataTypes.UUIDV4,
|
|
72
|
+
primaryKey: true
|
|
73
|
+
},
|
|
74
|
+
senderId: {
|
|
75
|
+
type: DataTypes.UUID,
|
|
76
|
+
allowNull: false,
|
|
77
|
+
references: {
|
|
78
|
+
model: 'app_user',
|
|
79
|
+
key: 'id'
|
|
80
|
+
},
|
|
81
|
+
field: 'sender_id'
|
|
82
|
+
},
|
|
83
|
+
recipientId: {
|
|
84
|
+
type: DataTypes.UUID,
|
|
85
|
+
allowNull: false,
|
|
86
|
+
references: {
|
|
87
|
+
model: 'app_user',
|
|
88
|
+
key: 'id'
|
|
89
|
+
},
|
|
90
|
+
field: 'recipient_id'
|
|
91
|
+
},
|
|
92
|
+
message: {
|
|
93
|
+
type: DataTypes.STRING(1000),
|
|
94
|
+
allowNull: false
|
|
95
|
+
},
|
|
96
|
+
hasBeenRead: {
|
|
97
|
+
type: DataTypes.BOOLEAN,
|
|
98
|
+
allowNull: false,
|
|
99
|
+
defaultValue: false,
|
|
100
|
+
field: 'has_been_read'
|
|
101
|
+
},
|
|
102
|
+
hasBeenEdited: {
|
|
103
|
+
type: DataTypes.BOOLEAN,
|
|
104
|
+
allowNull: false,
|
|
105
|
+
defaultValue: false,
|
|
106
|
+
field: 'has_been_edited'
|
|
107
|
+
},
|
|
108
|
+
hasDeletedBySender: {
|
|
109
|
+
type: DataTypes.BOOLEAN,
|
|
110
|
+
allowNull: false,
|
|
111
|
+
defaultValue: false,
|
|
112
|
+
field: 'has_deleted_by_sender'
|
|
113
|
+
},
|
|
114
|
+
hasDeletedByReceiver: {
|
|
115
|
+
type: DataTypes.BOOLEAN,
|
|
116
|
+
allowNull: false,
|
|
117
|
+
defaultValue: false,
|
|
118
|
+
field: 'has_deleted_by_receiver'
|
|
119
|
+
},
|
|
120
|
+
replyMessageId: {
|
|
121
|
+
type: DataTypes.UUID,
|
|
122
|
+
allowNull: true,
|
|
123
|
+
references: {
|
|
124
|
+
model: 'user_messages',
|
|
125
|
+
key: 'id'
|
|
126
|
+
},
|
|
127
|
+
field: 'reply_message_id'
|
|
128
|
+
},
|
|
129
|
+
createDate: {
|
|
130
|
+
type: DataTypes.DATE,
|
|
131
|
+
allowNull: false,
|
|
132
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
133
|
+
field: 'create_date'
|
|
134
|
+
},
|
|
135
|
+
updateDate: {
|
|
136
|
+
type: DataTypes.DATE,
|
|
137
|
+
allowNull: false,
|
|
138
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
139
|
+
field: 'update_date'
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
sequelize,
|
|
143
|
+
tableName: 'user_messages',
|
|
144
|
+
schema: 'eb',
|
|
145
|
+
timestamps: false,
|
|
146
|
+
indexes: [
|
|
147
|
+
{
|
|
148
|
+
name: "idx_user_messages_conversation",
|
|
149
|
+
fields: [
|
|
150
|
+
{ name: "sender_id" },
|
|
151
|
+
{ name: "recipient_id" },
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "idx_user_messages_recipient",
|
|
156
|
+
fields: [
|
|
157
|
+
{ name: "recipient_id" },
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "idx_user_messages_reply",
|
|
162
|
+
fields: [
|
|
163
|
+
{ name: "reply_message_id" },
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "idx_user_messages_sender",
|
|
168
|
+
fields: [
|
|
169
|
+
{ name: "sender_id" },
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "idx_user_messages_unread",
|
|
174
|
+
fields: [
|
|
175
|
+
{ name: "recipient_id" },
|
|
176
|
+
{ name: "has_been_read" },
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "user_messages_pkey",
|
|
181
|
+
unique: true,
|
|
182
|
+
fields: [
|
|
183
|
+
{ name: "id" },
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|