@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,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 UserBookmarksAttributes {
|
|
11
|
+
id: string;
|
|
12
|
+
appUserId: string;
|
|
13
|
+
jukeboxId?: string;
|
|
14
|
+
playlistId?: string;
|
|
15
|
+
radioShowId?: string;
|
|
16
|
+
merchItemId?: string;
|
|
17
|
+
newsArticleId?: string;
|
|
18
|
+
createDate: Date;
|
|
19
|
+
updateDate: Date;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type UserBookmarksPk = "id";
|
|
23
|
+
export type UserBookmarksId = UserBookmarks[UserBookmarksPk];
|
|
24
|
+
export type UserBookmarksOptionalAttributes = "id" | "jukeboxId" | "playlistId" | "radioShowId" | "merchItemId" | "newsArticleId" | "createDate" | "updateDate";
|
|
25
|
+
export type UserBookmarksCreationAttributes = Optional<UserBookmarksAttributes, UserBookmarksOptionalAttributes>;
|
|
26
|
+
|
|
27
|
+
export class UserBookmarks extends Model<UserBookmarksAttributes, UserBookmarksCreationAttributes> implements UserBookmarksAttributes {
|
|
28
|
+
id!: string;
|
|
29
|
+
appUserId!: string;
|
|
30
|
+
jukeboxId?: string;
|
|
31
|
+
playlistId?: string;
|
|
32
|
+
radioShowId?: string;
|
|
33
|
+
merchItemId?: string;
|
|
34
|
+
newsArticleId?: string;
|
|
35
|
+
createDate!: Date;
|
|
36
|
+
updateDate!: Date;
|
|
37
|
+
|
|
38
|
+
// UserBookmarks belongsTo AppUser via appUserId
|
|
39
|
+
appUser!: AppUser;
|
|
40
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
41
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
42
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
43
|
+
// UserBookmarks belongsTo JukeboxSession via jukeboxId
|
|
44
|
+
jukebox!: JukeboxSession;
|
|
45
|
+
getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
|
|
46
|
+
setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
|
|
47
|
+
createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
|
|
48
|
+
// UserBookmarks belongsTo MerchItem via merchItemId
|
|
49
|
+
merchItem!: MerchItem;
|
|
50
|
+
getMerchItem!: Sequelize.BelongsToGetAssociationMixin<MerchItem>;
|
|
51
|
+
setMerchItem!: Sequelize.BelongsToSetAssociationMixin<MerchItem, MerchItemId>;
|
|
52
|
+
createMerchItem!: Sequelize.BelongsToCreateAssociationMixin<MerchItem>;
|
|
53
|
+
// UserBookmarks belongsTo NewsArticle via newsArticleId
|
|
54
|
+
newsArticle!: NewsArticle;
|
|
55
|
+
getNewsArticle!: Sequelize.BelongsToGetAssociationMixin<NewsArticle>;
|
|
56
|
+
setNewsArticle!: Sequelize.BelongsToSetAssociationMixin<NewsArticle, NewsArticleId>;
|
|
57
|
+
createNewsArticle!: Sequelize.BelongsToCreateAssociationMixin<NewsArticle>;
|
|
58
|
+
// UserBookmarks belongsTo PlatformUserPlaylist via playlistId
|
|
59
|
+
playlist!: PlatformUserPlaylist;
|
|
60
|
+
getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
|
|
61
|
+
setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
62
|
+
createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
|
|
63
|
+
// UserBookmarks 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 UserBookmarks {
|
|
70
|
+
return UserBookmarks.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
|
+
merchItemId: {
|
|
114
|
+
type: DataTypes.UUID,
|
|
115
|
+
allowNull: true,
|
|
116
|
+
references: {
|
|
117
|
+
model: 'merch_item',
|
|
118
|
+
key: 'id'
|
|
119
|
+
},
|
|
120
|
+
field: 'merch_item_id'
|
|
121
|
+
},
|
|
122
|
+
newsArticleId: {
|
|
123
|
+
type: DataTypes.UUID,
|
|
124
|
+
allowNull: true,
|
|
125
|
+
references: {
|
|
126
|
+
model: 'news_article',
|
|
127
|
+
key: 'id'
|
|
128
|
+
},
|
|
129
|
+
field: 'news_article_id'
|
|
130
|
+
},
|
|
131
|
+
createDate: {
|
|
132
|
+
type: DataTypes.DATE,
|
|
133
|
+
allowNull: false,
|
|
134
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
135
|
+
field: 'create_date'
|
|
136
|
+
},
|
|
137
|
+
updateDate: {
|
|
138
|
+
type: DataTypes.DATE,
|
|
139
|
+
allowNull: false,
|
|
140
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
141
|
+
field: 'update_date'
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
sequelize,
|
|
145
|
+
tableName: 'user_bookmarks',
|
|
146
|
+
schema: 'eb',
|
|
147
|
+
timestamps: false,
|
|
148
|
+
indexes: [
|
|
149
|
+
{
|
|
150
|
+
name: "idx_user_bookmarks_jukebox",
|
|
151
|
+
fields: [
|
|
152
|
+
{ name: "jukebox_id" },
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "idx_user_bookmarks_merch_item",
|
|
157
|
+
fields: [
|
|
158
|
+
{ name: "merch_item_id" },
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "idx_user_bookmarks_news_article",
|
|
163
|
+
fields: [
|
|
164
|
+
{ name: "news_article_id" },
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "idx_user_bookmarks_playlist",
|
|
169
|
+
fields: [
|
|
170
|
+
{ name: "playlist_id" },
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "idx_user_bookmarks_radio_show",
|
|
175
|
+
fields: [
|
|
176
|
+
{ name: "radio_show_id" },
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "idx_user_bookmarks_user",
|
|
181
|
+
fields: [
|
|
182
|
+
{ name: "app_user_id" },
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "uq_user_bookmarks_user_jukebox",
|
|
187
|
+
unique: true,
|
|
188
|
+
fields: [
|
|
189
|
+
{ name: "app_user_id" },
|
|
190
|
+
{ name: "jukebox_id" },
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: "uq_user_bookmarks_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_bookmarks_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_bookmarks_user_playlist",
|
|
211
|
+
unique: true,
|
|
212
|
+
fields: [
|
|
213
|
+
{ name: "app_user_id" },
|
|
214
|
+
{ name: "playlist_id" },
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "uq_user_bookmarks_user_radio_show",
|
|
219
|
+
unique: true,
|
|
220
|
+
fields: [
|
|
221
|
+
{ name: "app_user_id" },
|
|
222
|
+
{ name: "radio_show_id" },
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "user_bookmarks_pkey",
|
|
227
|
+
unique: true,
|
|
228
|
+
fields: [
|
|
229
|
+
{ name: "id" },
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
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
|
+
import type { UserAbuseReports, UserAbuseReportsId } from './UserAbuseReports';
|
|
10
|
+
|
|
11
|
+
export interface UserCommentsAttributes {
|
|
12
|
+
id: string;
|
|
13
|
+
appUserId: string;
|
|
14
|
+
jukeboxId?: string;
|
|
15
|
+
playlistId?: string;
|
|
16
|
+
radioShowId?: string;
|
|
17
|
+
comment: string;
|
|
18
|
+
replyCommentId?: string;
|
|
19
|
+
deleted: boolean;
|
|
20
|
+
createDate: Date;
|
|
21
|
+
updateDate: Date;
|
|
22
|
+
modifiedComment?: string;
|
|
23
|
+
moderationScore?: number;
|
|
24
|
+
moderationLevel?: string;
|
|
25
|
+
strippedUrls?: object;
|
|
26
|
+
merchItemId?: string;
|
|
27
|
+
newsArticleId?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type UserCommentsPk = "id";
|
|
31
|
+
export type UserCommentsId = UserComments[UserCommentsPk];
|
|
32
|
+
export type UserCommentsOptionalAttributes = "id" | "jukeboxId" | "playlistId" | "radioShowId" | "replyCommentId" | "createDate" | "updateDate" | "modifiedComment" | "moderationScore" | "moderationLevel" | "strippedUrls" | "merchItemId" | "newsArticleId";
|
|
33
|
+
export type UserCommentsCreationAttributes = Optional<UserCommentsAttributes, UserCommentsOptionalAttributes>;
|
|
34
|
+
|
|
35
|
+
export class UserComments extends Model<UserCommentsAttributes, UserCommentsCreationAttributes> implements UserCommentsAttributes {
|
|
36
|
+
id!: string;
|
|
37
|
+
appUserId!: string;
|
|
38
|
+
jukeboxId?: string;
|
|
39
|
+
playlistId?: string;
|
|
40
|
+
radioShowId?: string;
|
|
41
|
+
comment!: string;
|
|
42
|
+
replyCommentId?: string;
|
|
43
|
+
deleted!: boolean;
|
|
44
|
+
createDate!: Date;
|
|
45
|
+
updateDate!: Date;
|
|
46
|
+
modifiedComment?: string;
|
|
47
|
+
moderationScore?: number;
|
|
48
|
+
moderationLevel?: string;
|
|
49
|
+
strippedUrls?: object;
|
|
50
|
+
merchItemId?: string;
|
|
51
|
+
newsArticleId?: string;
|
|
52
|
+
|
|
53
|
+
// UserComments belongsTo AppUser via appUserId
|
|
54
|
+
appUser!: AppUser;
|
|
55
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
56
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
57
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
58
|
+
// UserComments belongsTo JukeboxSession via jukeboxId
|
|
59
|
+
jukebox!: JukeboxSession;
|
|
60
|
+
getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
|
|
61
|
+
setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
|
|
62
|
+
createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
|
|
63
|
+
// UserComments belongsTo MerchItem via merchItemId
|
|
64
|
+
merchItem!: MerchItem;
|
|
65
|
+
getMerchItem!: Sequelize.BelongsToGetAssociationMixin<MerchItem>;
|
|
66
|
+
setMerchItem!: Sequelize.BelongsToSetAssociationMixin<MerchItem, MerchItemId>;
|
|
67
|
+
createMerchItem!: Sequelize.BelongsToCreateAssociationMixin<MerchItem>;
|
|
68
|
+
// UserComments belongsTo NewsArticle via newsArticleId
|
|
69
|
+
newsArticle!: NewsArticle;
|
|
70
|
+
getNewsArticle!: Sequelize.BelongsToGetAssociationMixin<NewsArticle>;
|
|
71
|
+
setNewsArticle!: Sequelize.BelongsToSetAssociationMixin<NewsArticle, NewsArticleId>;
|
|
72
|
+
createNewsArticle!: Sequelize.BelongsToCreateAssociationMixin<NewsArticle>;
|
|
73
|
+
// UserComments belongsTo PlatformUserPlaylist via playlistId
|
|
74
|
+
playlist!: PlatformUserPlaylist;
|
|
75
|
+
getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
|
|
76
|
+
setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
77
|
+
createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
|
|
78
|
+
// UserComments belongsTo RadioShow via radioShowId
|
|
79
|
+
radioShow!: RadioShow;
|
|
80
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
81
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
82
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
83
|
+
// UserComments hasMany UserAbuseReports via commentId
|
|
84
|
+
userAbuseReports!: UserAbuseReports[];
|
|
85
|
+
getUserAbuseReports!: Sequelize.HasManyGetAssociationsMixin<UserAbuseReports>;
|
|
86
|
+
setUserAbuseReports!: Sequelize.HasManySetAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
87
|
+
addUserAbuseReport!: Sequelize.HasManyAddAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
88
|
+
addUserAbuseReports!: Sequelize.HasManyAddAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
89
|
+
createUserAbuseReport!: Sequelize.HasManyCreateAssociationMixin<UserAbuseReports>;
|
|
90
|
+
removeUserAbuseReport!: Sequelize.HasManyRemoveAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
91
|
+
removeUserAbuseReports!: Sequelize.HasManyRemoveAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
92
|
+
hasUserAbuseReport!: Sequelize.HasManyHasAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
93
|
+
hasUserAbuseReports!: Sequelize.HasManyHasAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
|
|
94
|
+
countUserAbuseReports!: Sequelize.HasManyCountAssociationsMixin;
|
|
95
|
+
// UserComments belongsTo UserComments via replyCommentId
|
|
96
|
+
replyComment!: UserComments;
|
|
97
|
+
getReplyComment!: Sequelize.BelongsToGetAssociationMixin<UserComments>;
|
|
98
|
+
setReplyComment!: Sequelize.BelongsToSetAssociationMixin<UserComments, UserCommentsId>;
|
|
99
|
+
createReplyComment!: Sequelize.BelongsToCreateAssociationMixin<UserComments>;
|
|
100
|
+
|
|
101
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserComments {
|
|
102
|
+
return UserComments.init({
|
|
103
|
+
id: {
|
|
104
|
+
type: DataTypes.UUID,
|
|
105
|
+
allowNull: false,
|
|
106
|
+
defaultValue: DataTypes.UUIDV4,
|
|
107
|
+
primaryKey: true
|
|
108
|
+
},
|
|
109
|
+
appUserId: {
|
|
110
|
+
type: DataTypes.UUID,
|
|
111
|
+
allowNull: false,
|
|
112
|
+
references: {
|
|
113
|
+
model: 'app_user',
|
|
114
|
+
key: 'id'
|
|
115
|
+
},
|
|
116
|
+
field: 'app_user_id'
|
|
117
|
+
},
|
|
118
|
+
jukeboxId: {
|
|
119
|
+
type: DataTypes.UUID,
|
|
120
|
+
allowNull: true,
|
|
121
|
+
references: {
|
|
122
|
+
model: 'jukebox_session',
|
|
123
|
+
key: 'id'
|
|
124
|
+
},
|
|
125
|
+
field: 'jukebox_id'
|
|
126
|
+
},
|
|
127
|
+
playlistId: {
|
|
128
|
+
type: DataTypes.UUID,
|
|
129
|
+
allowNull: true,
|
|
130
|
+
references: {
|
|
131
|
+
model: 'platform_user_playlist',
|
|
132
|
+
key: 'id'
|
|
133
|
+
},
|
|
134
|
+
field: 'playlist_id'
|
|
135
|
+
},
|
|
136
|
+
radioShowId: {
|
|
137
|
+
type: DataTypes.UUID,
|
|
138
|
+
allowNull: true,
|
|
139
|
+
references: {
|
|
140
|
+
model: 'radio_show',
|
|
141
|
+
key: 'id'
|
|
142
|
+
},
|
|
143
|
+
field: 'radio_show_id'
|
|
144
|
+
},
|
|
145
|
+
comment: {
|
|
146
|
+
type: DataTypes.STRING(1000),
|
|
147
|
+
allowNull: false
|
|
148
|
+
},
|
|
149
|
+
replyCommentId: {
|
|
150
|
+
type: DataTypes.UUID,
|
|
151
|
+
allowNull: true,
|
|
152
|
+
references: {
|
|
153
|
+
model: 'user_comments',
|
|
154
|
+
key: 'id'
|
|
155
|
+
},
|
|
156
|
+
field: 'reply_comment_id'
|
|
157
|
+
},
|
|
158
|
+
deleted: {
|
|
159
|
+
type: DataTypes.BOOLEAN,
|
|
160
|
+
allowNull: false,
|
|
161
|
+
defaultValue: false
|
|
162
|
+
},
|
|
163
|
+
createDate: {
|
|
164
|
+
type: DataTypes.DATE,
|
|
165
|
+
allowNull: false,
|
|
166
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
167
|
+
field: 'create_date'
|
|
168
|
+
},
|
|
169
|
+
updateDate: {
|
|
170
|
+
type: DataTypes.DATE,
|
|
171
|
+
allowNull: false,
|
|
172
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
173
|
+
field: 'update_date'
|
|
174
|
+
},
|
|
175
|
+
modifiedComment: {
|
|
176
|
+
type: DataTypes.STRING(1000),
|
|
177
|
+
allowNull: true,
|
|
178
|
+
field: 'modified_comment'
|
|
179
|
+
},
|
|
180
|
+
moderationScore: {
|
|
181
|
+
type: DataTypes.DECIMAL,
|
|
182
|
+
allowNull: true,
|
|
183
|
+
field: 'moderation_score'
|
|
184
|
+
},
|
|
185
|
+
moderationLevel: {
|
|
186
|
+
type: DataTypes.STRING(10),
|
|
187
|
+
allowNull: true,
|
|
188
|
+
field: 'moderation_level'
|
|
189
|
+
},
|
|
190
|
+
strippedUrls: {
|
|
191
|
+
type: DataTypes.JSONB,
|
|
192
|
+
allowNull: true,
|
|
193
|
+
field: 'stripped_urls'
|
|
194
|
+
},
|
|
195
|
+
merchItemId: {
|
|
196
|
+
type: DataTypes.UUID,
|
|
197
|
+
allowNull: true,
|
|
198
|
+
references: {
|
|
199
|
+
model: 'merch_item',
|
|
200
|
+
key: 'id'
|
|
201
|
+
},
|
|
202
|
+
field: 'merch_item_id'
|
|
203
|
+
},
|
|
204
|
+
newsArticleId: {
|
|
205
|
+
type: DataTypes.UUID,
|
|
206
|
+
allowNull: true,
|
|
207
|
+
references: {
|
|
208
|
+
model: 'news_article',
|
|
209
|
+
key: 'id'
|
|
210
|
+
},
|
|
211
|
+
field: 'news_article_id'
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
sequelize,
|
|
215
|
+
tableName: 'user_comments',
|
|
216
|
+
schema: 'eb',
|
|
217
|
+
timestamps: false,
|
|
218
|
+
indexes: [
|
|
219
|
+
{
|
|
220
|
+
name: "idx_user_comments_jukebox",
|
|
221
|
+
fields: [
|
|
222
|
+
{ name: "jukebox_id" },
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "idx_user_comments_merch_item",
|
|
227
|
+
fields: [
|
|
228
|
+
{ name: "merch_item_id" },
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "idx_user_comments_news_article",
|
|
233
|
+
fields: [
|
|
234
|
+
{ name: "news_article_id" },
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "idx_user_comments_playlist",
|
|
239
|
+
fields: [
|
|
240
|
+
{ name: "playlist_id" },
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "idx_user_comments_radio_show",
|
|
245
|
+
fields: [
|
|
246
|
+
{ name: "radio_show_id" },
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "idx_user_comments_reply",
|
|
251
|
+
fields: [
|
|
252
|
+
{ name: "reply_comment_id" },
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "idx_user_comments_user",
|
|
257
|
+
fields: [
|
|
258
|
+
{ name: "app_user_id" },
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "user_comments_pkey",
|
|
263
|
+
unique: true,
|
|
264
|
+
fields: [
|
|
265
|
+
{ name: "id" },
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
]
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
|
|
5
|
+
export interface UserContactsAttributes {
|
|
6
|
+
appUserId: string;
|
|
7
|
+
contactId: string;
|
|
8
|
+
contactAppUserId?: string;
|
|
9
|
+
firstName?: string;
|
|
10
|
+
lastName?: string;
|
|
11
|
+
contactEmail1?: string;
|
|
12
|
+
contactEmail2?: string;
|
|
13
|
+
contactEmail3?: string;
|
|
14
|
+
contactPhone1?: string;
|
|
15
|
+
contactPhone1Type?: "mobile" | "work" | "home" | "main";
|
|
16
|
+
contactPhone2?: string;
|
|
17
|
+
contactPhone2Type?: "mobile" | "work" | "home" | "main";
|
|
18
|
+
contactPhone3?: string;
|
|
19
|
+
contactPhone3Type?: "mobile" | "work" | "home" | "main";
|
|
20
|
+
active?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type UserContactsPk = "contactId";
|
|
24
|
+
export type UserContactsId = UserContacts[UserContactsPk];
|
|
25
|
+
export type UserContactsOptionalAttributes = "contactId" | "contactAppUserId" | "firstName" | "lastName" | "contactEmail1" | "contactEmail2" | "contactEmail3" | "contactPhone1" | "contactPhone1Type" | "contactPhone2" | "contactPhone2Type" | "contactPhone3" | "contactPhone3Type" | "active";
|
|
26
|
+
export type UserContactsCreationAttributes = Optional<UserContactsAttributes, UserContactsOptionalAttributes>;
|
|
27
|
+
|
|
28
|
+
export class UserContacts extends Model<UserContactsAttributes, UserContactsCreationAttributes> implements UserContactsAttributes {
|
|
29
|
+
appUserId!: string;
|
|
30
|
+
contactId!: string;
|
|
31
|
+
contactAppUserId?: string;
|
|
32
|
+
firstName?: string;
|
|
33
|
+
lastName?: string;
|
|
34
|
+
contactEmail1?: string;
|
|
35
|
+
contactEmail2?: string;
|
|
36
|
+
contactEmail3?: string;
|
|
37
|
+
contactPhone1?: string;
|
|
38
|
+
contactPhone1Type?: "mobile" | "work" | "home" | "main";
|
|
39
|
+
contactPhone2?: string;
|
|
40
|
+
contactPhone2Type?: "mobile" | "work" | "home" | "main";
|
|
41
|
+
contactPhone3?: string;
|
|
42
|
+
contactPhone3Type?: "mobile" | "work" | "home" | "main";
|
|
43
|
+
active?: boolean;
|
|
44
|
+
|
|
45
|
+
// UserContacts belongsTo AppUser via appUserId
|
|
46
|
+
appUser!: AppUser;
|
|
47
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
48
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
49
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
50
|
+
|
|
51
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof UserContacts {
|
|
52
|
+
return UserContacts.init({
|
|
53
|
+
appUserId: {
|
|
54
|
+
type: DataTypes.UUID,
|
|
55
|
+
allowNull: false,
|
|
56
|
+
references: {
|
|
57
|
+
model: 'app_user',
|
|
58
|
+
key: 'id'
|
|
59
|
+
},
|
|
60
|
+
field: 'app_user_id'
|
|
61
|
+
},
|
|
62
|
+
contactId: {
|
|
63
|
+
type: DataTypes.UUID,
|
|
64
|
+
allowNull: false,
|
|
65
|
+
defaultValue: DataTypes.UUIDV4,
|
|
66
|
+
primaryKey: true,
|
|
67
|
+
field: 'contact_id'
|
|
68
|
+
},
|
|
69
|
+
contactAppUserId: {
|
|
70
|
+
type: DataTypes.UUID,
|
|
71
|
+
allowNull: true,
|
|
72
|
+
field: 'contact_app_user_id'
|
|
73
|
+
},
|
|
74
|
+
firstName: {
|
|
75
|
+
type: DataTypes.STRING(255),
|
|
76
|
+
allowNull: true,
|
|
77
|
+
field: 'first_name'
|
|
78
|
+
},
|
|
79
|
+
lastName: {
|
|
80
|
+
type: DataTypes.STRING(255),
|
|
81
|
+
allowNull: true,
|
|
82
|
+
field: 'last_name'
|
|
83
|
+
},
|
|
84
|
+
contactEmail1: {
|
|
85
|
+
type: DataTypes.STRING(255),
|
|
86
|
+
allowNull: true,
|
|
87
|
+
field: 'contact_email_1'
|
|
88
|
+
},
|
|
89
|
+
contactEmail2: {
|
|
90
|
+
type: DataTypes.STRING(255),
|
|
91
|
+
allowNull: true,
|
|
92
|
+
field: 'contact_email_2'
|
|
93
|
+
},
|
|
94
|
+
contactEmail3: {
|
|
95
|
+
type: DataTypes.STRING(255),
|
|
96
|
+
allowNull: true,
|
|
97
|
+
field: 'contact_email_3'
|
|
98
|
+
},
|
|
99
|
+
contactPhone1: {
|
|
100
|
+
type: DataTypes.STRING(255),
|
|
101
|
+
allowNull: true,
|
|
102
|
+
field: 'contact_phone_1'
|
|
103
|
+
},
|
|
104
|
+
contactPhone1Type: {
|
|
105
|
+
type: DataTypes.ENUM("mobile","work","home","main"),
|
|
106
|
+
allowNull: true,
|
|
107
|
+
field: 'contact_phone_1_type'
|
|
108
|
+
},
|
|
109
|
+
contactPhone2: {
|
|
110
|
+
type: DataTypes.STRING(255),
|
|
111
|
+
allowNull: true,
|
|
112
|
+
field: 'contact_phone_2'
|
|
113
|
+
},
|
|
114
|
+
contactPhone2Type: {
|
|
115
|
+
type: DataTypes.ENUM("mobile","work","home","main"),
|
|
116
|
+
allowNull: true,
|
|
117
|
+
field: 'contact_phone_2_type'
|
|
118
|
+
},
|
|
119
|
+
contactPhone3: {
|
|
120
|
+
type: DataTypes.STRING(255),
|
|
121
|
+
allowNull: true,
|
|
122
|
+
field: 'contact_phone_3'
|
|
123
|
+
},
|
|
124
|
+
contactPhone3Type: {
|
|
125
|
+
type: DataTypes.ENUM("mobile","work","home","main"),
|
|
126
|
+
allowNull: true,
|
|
127
|
+
field: 'contact_phone_3_type'
|
|
128
|
+
},
|
|
129
|
+
active: {
|
|
130
|
+
type: DataTypes.BOOLEAN,
|
|
131
|
+
allowNull: true
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
sequelize,
|
|
135
|
+
tableName: 'user_contacts',
|
|
136
|
+
schema: 'eb',
|
|
137
|
+
timestamps: false,
|
|
138
|
+
indexes: [
|
|
139
|
+
{
|
|
140
|
+
name: "idx_user_contacts_user",
|
|
141
|
+
fields: [
|
|
142
|
+
{ name: "app_user_id" },
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "user_contacts_pkey",
|
|
147
|
+
unique: true,
|
|
148
|
+
fields: [
|
|
149
|
+
{ name: "contact_id" },
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|