@earbug/db-models 0.0.8 → 0.0.10
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/dist/AppUser.d.ts +35 -0
- package/dist/CanonGenre.d.ts +12 -0
- package/dist/CanonTrack.d.ts +12 -0
- package/dist/JukeboxSession.d.ts +12 -0
- package/dist/Notification.d.ts +62 -0
- package/dist/Notification.js +163 -0
- package/dist/NotificationType.d.ts +26 -0
- package/dist/NotificationType.js +42 -0
- package/dist/RadioShow.d.ts +80 -0
- package/dist/RadioShow.js +93 -0
- package/dist/RadioShowGenres.d.ts +29 -0
- package/dist/RadioShowGenres.js +53 -0
- package/dist/RadioShowMedia.d.ts +30 -0
- package/dist/RadioShowMedia.js +89 -0
- package/dist/RadioShowPlacement.d.ts +35 -0
- package/dist/RadioShowPlacement.js +69 -0
- package/dist/RadioShowPublishRequests.d.ts +26 -0
- package/dist/RadioShowPublishRequests.js +80 -0
- package/dist/init-models.d.ts +23 -2
- package/dist/init-models.js +52 -2
- package/models/AppUser.ts +38 -0
- package/models/CanonGenre.ts +13 -0
- package/models/CanonTrack.ts +13 -0
- package/models/JukeboxSession.ts +13 -0
- package/models/Notification.ts +202 -0
- package/models/NotificationType.ts +66 -0
- package/models/RadioShow.ts +151 -0
- package/models/RadioShowGenres.ts +81 -0
- package/models/RadioShowMedia.ts +93 -0
- package/models/RadioShowPlacement.ts +103 -0
- package/models/RadioShowPublishRequests.ts +80 -0
- package/models/init-models.ts +71 -0
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
4
|
+
|
|
5
|
+
export interface RadioShowMediaAttributes {
|
|
6
|
+
radioShowId: string;
|
|
7
|
+
originalMediaType?: number;
|
|
8
|
+
s3VideoUrl?: string;
|
|
9
|
+
s3AudioUrl: string;
|
|
10
|
+
approved?: boolean;
|
|
11
|
+
id: string;
|
|
12
|
+
createDate: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type RadioShowMediaPk = "id";
|
|
16
|
+
export type RadioShowMediaId = RadioShowMedia[RadioShowMediaPk];
|
|
17
|
+
export type RadioShowMediaOptionalAttributes = "originalMediaType" | "s3VideoUrl" | "approved" | "id" | "createDate";
|
|
18
|
+
export type RadioShowMediaCreationAttributes = Optional<RadioShowMediaAttributes, RadioShowMediaOptionalAttributes>;
|
|
19
|
+
|
|
20
|
+
export class RadioShowMedia extends Model<RadioShowMediaAttributes, RadioShowMediaCreationAttributes> implements RadioShowMediaAttributes {
|
|
21
|
+
radioShowId!: string;
|
|
22
|
+
originalMediaType?: number;
|
|
23
|
+
s3VideoUrl?: string;
|
|
24
|
+
s3AudioUrl!: string;
|
|
25
|
+
approved?: boolean;
|
|
26
|
+
id!: string;
|
|
27
|
+
createDate!: Date;
|
|
28
|
+
|
|
29
|
+
// RadioShowMedia belongsTo RadioShow via radioShowId
|
|
30
|
+
radioShow!: RadioShow;
|
|
31
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
32
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
33
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
34
|
+
|
|
35
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowMedia {
|
|
36
|
+
return RadioShowMedia.init({
|
|
37
|
+
radioShowId: {
|
|
38
|
+
type: DataTypes.UUID,
|
|
39
|
+
allowNull: false,
|
|
40
|
+
references: {
|
|
41
|
+
model: 'radio_show',
|
|
42
|
+
key: 'id'
|
|
43
|
+
},
|
|
44
|
+
field: 'radio_show_id'
|
|
45
|
+
},
|
|
46
|
+
originalMediaType: {
|
|
47
|
+
type: DataTypes.INTEGER,
|
|
48
|
+
allowNull: true,
|
|
49
|
+
field: 'original_media_type'
|
|
50
|
+
},
|
|
51
|
+
s3VideoUrl: {
|
|
52
|
+
type: DataTypes.TEXT,
|
|
53
|
+
allowNull: true,
|
|
54
|
+
field: 's3_video_url'
|
|
55
|
+
},
|
|
56
|
+
s3AudioUrl: {
|
|
57
|
+
type: DataTypes.TEXT,
|
|
58
|
+
allowNull: false,
|
|
59
|
+
field: 's3_audio_url'
|
|
60
|
+
},
|
|
61
|
+
approved: {
|
|
62
|
+
type: DataTypes.BOOLEAN,
|
|
63
|
+
allowNull: true
|
|
64
|
+
},
|
|
65
|
+
id: {
|
|
66
|
+
type: DataTypes.UUID,
|
|
67
|
+
allowNull: false,
|
|
68
|
+
defaultValue: DataTypes.UUIDV4,
|
|
69
|
+
primaryKey: true
|
|
70
|
+
},
|
|
71
|
+
createDate: {
|
|
72
|
+
type: DataTypes.DATE,
|
|
73
|
+
allowNull: false,
|
|
74
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
75
|
+
field: 'create_date'
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
sequelize,
|
|
79
|
+
tableName: 'radio_show_media',
|
|
80
|
+
schema: 'eb',
|
|
81
|
+
timestamps: false,
|
|
82
|
+
indexes: [
|
|
83
|
+
{
|
|
84
|
+
name: "radio_show_media_pkey",
|
|
85
|
+
unique: true,
|
|
86
|
+
fields: [
|
|
87
|
+
{ name: "id" },
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { CanonTrack, CanonTrackId } from './CanonTrack';
|
|
4
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
5
|
+
|
|
6
|
+
export interface RadioShowPlacementAttributes {
|
|
7
|
+
radioShowId: string;
|
|
8
|
+
canonTrackId?: string;
|
|
9
|
+
radioShowMediaId?: string;
|
|
10
|
+
seqNum: number;
|
|
11
|
+
startTime?: string;
|
|
12
|
+
endTime?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type RadioShowPlacementPk = "id";
|
|
17
|
+
export type RadioShowPlacementId = RadioShowPlacement[RadioShowPlacementPk];
|
|
18
|
+
export type RadioShowPlacementOptionalAttributes = "canonTrackId" | "radioShowMediaId" | "startTime" | "endTime" | "id";
|
|
19
|
+
export type RadioShowPlacementCreationAttributes = Optional<RadioShowPlacementAttributes, RadioShowPlacementOptionalAttributes>;
|
|
20
|
+
|
|
21
|
+
export class RadioShowPlacement extends Model<RadioShowPlacementAttributes, RadioShowPlacementCreationAttributes> implements RadioShowPlacementAttributes {
|
|
22
|
+
radioShowId!: string;
|
|
23
|
+
canonTrackId?: string;
|
|
24
|
+
radioShowMediaId?: string;
|
|
25
|
+
seqNum!: number;
|
|
26
|
+
startTime?: string;
|
|
27
|
+
endTime?: string;
|
|
28
|
+
id!: string;
|
|
29
|
+
|
|
30
|
+
// RadioShowPlacement belongsTo CanonTrack via canonTrackId
|
|
31
|
+
canonTrack!: CanonTrack;
|
|
32
|
+
getCanonTrack!: Sequelize.BelongsToGetAssociationMixin<CanonTrack>;
|
|
33
|
+
setCanonTrack!: Sequelize.BelongsToSetAssociationMixin<CanonTrack, CanonTrackId>;
|
|
34
|
+
createCanonTrack!: Sequelize.BelongsToCreateAssociationMixin<CanonTrack>;
|
|
35
|
+
// RadioShowPlacement belongsTo RadioShow via radioShowId
|
|
36
|
+
radioShow!: RadioShow;
|
|
37
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
38
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
39
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
40
|
+
|
|
41
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowPlacement {
|
|
42
|
+
return RadioShowPlacement.init({
|
|
43
|
+
radioShowId: {
|
|
44
|
+
type: DataTypes.UUID,
|
|
45
|
+
allowNull: false,
|
|
46
|
+
references: {
|
|
47
|
+
model: 'radio_show',
|
|
48
|
+
key: 'id'
|
|
49
|
+
},
|
|
50
|
+
field: 'radio_show_id'
|
|
51
|
+
},
|
|
52
|
+
canonTrackId: {
|
|
53
|
+
type: DataTypes.UUID,
|
|
54
|
+
allowNull: true,
|
|
55
|
+
references: {
|
|
56
|
+
model: 'canon_track',
|
|
57
|
+
key: 'id'
|
|
58
|
+
},
|
|
59
|
+
field: 'canon_track_id'
|
|
60
|
+
},
|
|
61
|
+
radioShowMediaId: {
|
|
62
|
+
type: DataTypes.UUID,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
field: 'radio_show_media_id'
|
|
65
|
+
},
|
|
66
|
+
seqNum: {
|
|
67
|
+
type: DataTypes.INTEGER,
|
|
68
|
+
allowNull: false,
|
|
69
|
+
field: 'seq_num'
|
|
70
|
+
},
|
|
71
|
+
startTime: {
|
|
72
|
+
type: DataTypes.TIME,
|
|
73
|
+
allowNull: true,
|
|
74
|
+
field: 'start_time'
|
|
75
|
+
},
|
|
76
|
+
endTime: {
|
|
77
|
+
type: DataTypes.TIME,
|
|
78
|
+
allowNull: true,
|
|
79
|
+
field: 'end_time'
|
|
80
|
+
},
|
|
81
|
+
id: {
|
|
82
|
+
type: DataTypes.UUID,
|
|
83
|
+
allowNull: false,
|
|
84
|
+
defaultValue: DataTypes.UUIDV4,
|
|
85
|
+
primaryKey: true
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
sequelize,
|
|
89
|
+
tableName: 'radio_show_placement',
|
|
90
|
+
schema: 'eb',
|
|
91
|
+
timestamps: false,
|
|
92
|
+
indexes: [
|
|
93
|
+
{
|
|
94
|
+
name: "radio_show_placement_pkey",
|
|
95
|
+
unique: true,
|
|
96
|
+
fields: [
|
|
97
|
+
{ name: "id" },
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { RadioShow, RadioShowId } from './RadioShow';
|
|
4
|
+
|
|
5
|
+
export interface RadioShowPublishRequestsAttributes {
|
|
6
|
+
radioShowId: string;
|
|
7
|
+
approved?: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
createDate: Date;
|
|
10
|
+
updateDate: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RadioShowPublishRequestsPk = "id";
|
|
14
|
+
export type RadioShowPublishRequestsId = RadioShowPublishRequests[RadioShowPublishRequestsPk];
|
|
15
|
+
export type RadioShowPublishRequestsOptionalAttributes = "approved" | "id" | "createDate" | "updateDate";
|
|
16
|
+
export type RadioShowPublishRequestsCreationAttributes = Optional<RadioShowPublishRequestsAttributes, RadioShowPublishRequestsOptionalAttributes>;
|
|
17
|
+
|
|
18
|
+
export class RadioShowPublishRequests extends Model<RadioShowPublishRequestsAttributes, RadioShowPublishRequestsCreationAttributes> implements RadioShowPublishRequestsAttributes {
|
|
19
|
+
radioShowId!: string;
|
|
20
|
+
approved?: boolean;
|
|
21
|
+
id!: string;
|
|
22
|
+
createDate!: Date;
|
|
23
|
+
updateDate!: Date;
|
|
24
|
+
|
|
25
|
+
// RadioShowPublishRequests belongsTo RadioShow via radioShowId
|
|
26
|
+
radioShow!: RadioShow;
|
|
27
|
+
getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
|
|
28
|
+
setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
|
|
29
|
+
createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
|
|
30
|
+
|
|
31
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof RadioShowPublishRequests {
|
|
32
|
+
return RadioShowPublishRequests.init({
|
|
33
|
+
radioShowId: {
|
|
34
|
+
type: DataTypes.UUID,
|
|
35
|
+
allowNull: false,
|
|
36
|
+
references: {
|
|
37
|
+
model: 'radio_show',
|
|
38
|
+
key: 'id'
|
|
39
|
+
},
|
|
40
|
+
field: 'radio_show_id'
|
|
41
|
+
},
|
|
42
|
+
approved: {
|
|
43
|
+
type: DataTypes.BOOLEAN,
|
|
44
|
+
allowNull: true
|
|
45
|
+
},
|
|
46
|
+
id: {
|
|
47
|
+
type: DataTypes.UUID,
|
|
48
|
+
allowNull: false,
|
|
49
|
+
defaultValue: DataTypes.UUIDV4,
|
|
50
|
+
primaryKey: true
|
|
51
|
+
},
|
|
52
|
+
createDate: {
|
|
53
|
+
type: DataTypes.DATE,
|
|
54
|
+
allowNull: false,
|
|
55
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
56
|
+
field: 'create_date'
|
|
57
|
+
},
|
|
58
|
+
updateDate: {
|
|
59
|
+
type: DataTypes.DATE,
|
|
60
|
+
allowNull: false,
|
|
61
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
62
|
+
field: 'update_date'
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
sequelize,
|
|
66
|
+
tableName: 'radio_show_publish_requests',
|
|
67
|
+
schema: 'eb',
|
|
68
|
+
timestamps: false,
|
|
69
|
+
indexes: [
|
|
70
|
+
{
|
|
71
|
+
name: "radio_show_publish_requests_pkey",
|
|
72
|
+
unique: true,
|
|
73
|
+
fields: [
|
|
74
|
+
{ name: "id" },
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
package/models/init-models.ts
CHANGED
|
@@ -91,6 +91,10 @@ import { MetricsEvent as _MetricsEvent } from "./MetricsEvent";
|
|
|
91
91
|
import type { MetricsEventAttributes, MetricsEventCreationAttributes } from "./MetricsEvent";
|
|
92
92
|
import { NewsSite as _NewsSite } from "./NewsSite";
|
|
93
93
|
import type { NewsSiteAttributes, NewsSiteCreationAttributes } from "./NewsSite";
|
|
94
|
+
import { Notification as _Notification } from "./Notification";
|
|
95
|
+
import type { NotificationAttributes, NotificationCreationAttributes } from "./Notification";
|
|
96
|
+
import { NotificationType as _NotificationType } from "./NotificationType";
|
|
97
|
+
import type { NotificationTypeAttributes, NotificationTypeCreationAttributes } from "./NotificationType";
|
|
94
98
|
import { PauseStatusType as _PauseStatusType } from "./PauseStatusType";
|
|
95
99
|
import type { PauseStatusTypeAttributes, PauseStatusTypeCreationAttributes } from "./PauseStatusType";
|
|
96
100
|
import { Platform as _Platform } from "./Platform";
|
|
@@ -127,6 +131,16 @@ import { PlaybackStatus as _PlaybackStatus } from "./PlaybackStatus";
|
|
|
127
131
|
import type { PlaybackStatusAttributes, PlaybackStatusCreationAttributes } from "./PlaybackStatus";
|
|
128
132
|
import { PlaybackStatusType as _PlaybackStatusType } from "./PlaybackStatusType";
|
|
129
133
|
import type { PlaybackStatusTypeAttributes, PlaybackStatusTypeCreationAttributes } from "./PlaybackStatusType";
|
|
134
|
+
import { RadioShow as _RadioShow } from "./RadioShow";
|
|
135
|
+
import type { RadioShowAttributes, RadioShowCreationAttributes } from "./RadioShow";
|
|
136
|
+
import { RadioShowGenres as _RadioShowGenres } from "./RadioShowGenres";
|
|
137
|
+
import type { RadioShowGenresAttributes, RadioShowGenresCreationAttributes } from "./RadioShowGenres";
|
|
138
|
+
import { RadioShowMedia as _RadioShowMedia } from "./RadioShowMedia";
|
|
139
|
+
import type { RadioShowMediaAttributes, RadioShowMediaCreationAttributes } from "./RadioShowMedia";
|
|
140
|
+
import { RadioShowPlacement as _RadioShowPlacement } from "./RadioShowPlacement";
|
|
141
|
+
import type { RadioShowPlacementAttributes, RadioShowPlacementCreationAttributes } from "./RadioShowPlacement";
|
|
142
|
+
import { RadioShowPublishRequests as _RadioShowPublishRequests } from "./RadioShowPublishRequests";
|
|
143
|
+
import type { RadioShowPublishRequestsAttributes, RadioShowPublishRequestsCreationAttributes } from "./RadioShowPublishRequests";
|
|
130
144
|
import { State as _State } from "./State";
|
|
131
145
|
import type { StateAttributes, StateCreationAttributes } from "./State";
|
|
132
146
|
import { TrackDeletionReason as _TrackDeletionReason } from "./TrackDeletionReason";
|
|
@@ -185,6 +199,8 @@ export {
|
|
|
185
199
|
_MetricsDaily as MetricsDaily,
|
|
186
200
|
_MetricsEvent as MetricsEvent,
|
|
187
201
|
_NewsSite as NewsSite,
|
|
202
|
+
_Notification as Notification,
|
|
203
|
+
_NotificationType as NotificationType,
|
|
188
204
|
_PauseStatusType as PauseStatusType,
|
|
189
205
|
_Platform as Platform,
|
|
190
206
|
_PlatformAlbum as PlatformAlbum,
|
|
@@ -203,6 +219,11 @@ export {
|
|
|
203
219
|
_PlatformUserPlaylistTrack as PlatformUserPlaylistTrack,
|
|
204
220
|
_PlaybackStatus as PlaybackStatus,
|
|
205
221
|
_PlaybackStatusType as PlaybackStatusType,
|
|
222
|
+
_RadioShow as RadioShow,
|
|
223
|
+
_RadioShowGenres as RadioShowGenres,
|
|
224
|
+
_RadioShowMedia as RadioShowMedia,
|
|
225
|
+
_RadioShowPlacement as RadioShowPlacement,
|
|
226
|
+
_RadioShowPublishRequests as RadioShowPublishRequests,
|
|
206
227
|
_State as State,
|
|
207
228
|
_TrackDeletionReason as TrackDeletionReason,
|
|
208
229
|
_UnmatchedAlbum as UnmatchedAlbum,
|
|
@@ -303,6 +324,10 @@ export type {
|
|
|
303
324
|
MetricsEventCreationAttributes,
|
|
304
325
|
NewsSiteAttributes,
|
|
305
326
|
NewsSiteCreationAttributes,
|
|
327
|
+
NotificationAttributes,
|
|
328
|
+
NotificationCreationAttributes,
|
|
329
|
+
NotificationTypeAttributes,
|
|
330
|
+
NotificationTypeCreationAttributes,
|
|
306
331
|
PauseStatusTypeAttributes,
|
|
307
332
|
PauseStatusTypeCreationAttributes,
|
|
308
333
|
PlatformAttributes,
|
|
@@ -339,6 +364,16 @@ export type {
|
|
|
339
364
|
PlaybackStatusCreationAttributes,
|
|
340
365
|
PlaybackStatusTypeAttributes,
|
|
341
366
|
PlaybackStatusTypeCreationAttributes,
|
|
367
|
+
RadioShowAttributes,
|
|
368
|
+
RadioShowCreationAttributes,
|
|
369
|
+
RadioShowGenresAttributes,
|
|
370
|
+
RadioShowGenresCreationAttributes,
|
|
371
|
+
RadioShowMediaAttributes,
|
|
372
|
+
RadioShowMediaCreationAttributes,
|
|
373
|
+
RadioShowPlacementAttributes,
|
|
374
|
+
RadioShowPlacementCreationAttributes,
|
|
375
|
+
RadioShowPublishRequestsAttributes,
|
|
376
|
+
RadioShowPublishRequestsCreationAttributes,
|
|
342
377
|
StateAttributes,
|
|
343
378
|
StateCreationAttributes,
|
|
344
379
|
TrackDeletionReasonAttributes,
|
|
@@ -398,6 +433,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
398
433
|
const MetricsDaily = _MetricsDaily.initModel(sequelize);
|
|
399
434
|
const MetricsEvent = _MetricsEvent.initModel(sequelize);
|
|
400
435
|
const NewsSite = _NewsSite.initModel(sequelize);
|
|
436
|
+
const Notification = _Notification.initModel(sequelize);
|
|
437
|
+
const NotificationType = _NotificationType.initModel(sequelize);
|
|
401
438
|
const PauseStatusType = _PauseStatusType.initModel(sequelize);
|
|
402
439
|
const Platform = _Platform.initModel(sequelize);
|
|
403
440
|
const PlatformAlbum = _PlatformAlbum.initModel(sequelize);
|
|
@@ -416,6 +453,11 @@ export function initModels(sequelize: Sequelize) {
|
|
|
416
453
|
const PlatformUserPlaylistTrack = _PlatformUserPlaylistTrack.initModel(sequelize);
|
|
417
454
|
const PlaybackStatus = _PlaybackStatus.initModel(sequelize);
|
|
418
455
|
const PlaybackStatusType = _PlaybackStatusType.initModel(sequelize);
|
|
456
|
+
const RadioShow = _RadioShow.initModel(sequelize);
|
|
457
|
+
const RadioShowGenres = _RadioShowGenres.initModel(sequelize);
|
|
458
|
+
const RadioShowMedia = _RadioShowMedia.initModel(sequelize);
|
|
459
|
+
const RadioShowPlacement = _RadioShowPlacement.initModel(sequelize);
|
|
460
|
+
const RadioShowPublishRequests = _RadioShowPublishRequests.initModel(sequelize);
|
|
419
461
|
const State = _State.initModel(sequelize);
|
|
420
462
|
const TrackDeletionReason = _TrackDeletionReason.initModel(sequelize);
|
|
421
463
|
const UnmatchedAlbum = _UnmatchedAlbum.initModel(sequelize);
|
|
@@ -482,10 +524,16 @@ export function initModels(sequelize: Sequelize) {
|
|
|
482
524
|
AppUser.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackAddedUserId"});
|
|
483
525
|
JukeboxUser.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
484
526
|
AppUser.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "appUserId"});
|
|
527
|
+
Notification.belongsTo(AppUser, { as: "sourceUser", foreignKey: "sourceUserId"});
|
|
528
|
+
AppUser.hasMany(Notification, { as: "notifications", foreignKey: "sourceUserId"});
|
|
529
|
+
Notification.belongsTo(AppUser, { as: "targetUser", foreignKey: "targetUserId"});
|
|
530
|
+
AppUser.hasMany(Notification, { as: "targetUserNotifications", foreignKey: "targetUserId"});
|
|
485
531
|
PlatformUserAlbum.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
486
532
|
AppUser.hasMany(PlatformUserAlbum, { as: "platformUserAlbums", foreignKey: "appUserId"});
|
|
487
533
|
PlatformUserPlaylist.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
488
534
|
AppUser.hasMany(PlatformUserPlaylist, { as: "platformUserPlaylists", foreignKey: "appUserId"});
|
|
535
|
+
RadioShow.belongsTo(AppUser, { as: "creatorUser", foreignKey: "creatorUserId"});
|
|
536
|
+
AppUser.hasMany(RadioShow, { as: "radioShows", foreignKey: "creatorUserId"});
|
|
489
537
|
UserContacts.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
|
|
490
538
|
AppUser.hasMany(UserContacts, { as: "userContacts", foreignKey: "appUserId"});
|
|
491
539
|
CanonAlbumExternalReferenceRelation.belongsTo(CanonAlbum, { as: "canonAlbum", foreignKey: "canonAlbumId"});
|
|
@@ -514,6 +562,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
514
562
|
CanonGenre.hasMany(CanonToPlatformGenreRelation, { as: "canonToPlatformGenreRelations", foreignKey: "canonGenreId"});
|
|
515
563
|
JukeboxCanonGenreRelation.belongsTo(CanonGenre, { as: "canonGenre", foreignKey: "canonGenreId"});
|
|
516
564
|
CanonGenre.hasMany(JukeboxCanonGenreRelation, { as: "jukeboxCanonGenreRelations", foreignKey: "canonGenreId"});
|
|
565
|
+
RadioShowGenres.belongsTo(CanonGenre, { as: "canonGenre", foreignKey: "canonGenreId"});
|
|
566
|
+
CanonGenre.hasMany(RadioShowGenres, { as: "radioShowGenres", foreignKey: "canonGenreId"});
|
|
517
567
|
CanonAlbumLabelRelation.belongsTo(CanonLabel, { as: "canonLabel", foreignKey: "canonLabelId"});
|
|
518
568
|
CanonLabel.hasMany(CanonAlbumLabelRelation, { as: "canonAlbumLabelRelations", foreignKey: "canonLabelId"});
|
|
519
569
|
CanonLabelExternalReferenceRelation.belongsTo(CanonLabel, { as: "canonLabel", foreignKey: "canonLabelId"});
|
|
@@ -530,6 +580,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
530
580
|
CanonTrack.hasMany(CanonToPlatformTrackRelation, { as: "canonToPlatformTrackRelations", foreignKey: "canonTrackId"});
|
|
531
581
|
JukeboxQueueEntry.belongsTo(CanonTrack, { as: "track", foreignKey: "trackId"});
|
|
532
582
|
CanonTrack.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackId"});
|
|
583
|
+
RadioShowPlacement.belongsTo(CanonTrack, { as: "canonTrack", foreignKey: "canonTrackId"});
|
|
584
|
+
CanonTrack.hasMany(RadioShowPlacement, { as: "radioShowPlacements", foreignKey: "canonTrackId"});
|
|
533
585
|
CanonAlbumExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
|
|
534
586
|
ExternalReference.hasMany(CanonAlbumExternalReferenceRelation, { as: "canonAlbumExternalReferenceRelations", foreignKey: "externalReferenceId"});
|
|
535
587
|
CanonArtistExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
|
|
@@ -554,6 +606,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
554
606
|
JukeboxSession.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "jukeboxSessionId"});
|
|
555
607
|
JukeboxUser.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId"});
|
|
556
608
|
JukeboxSession.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "jukeboxSessionId"});
|
|
609
|
+
Notification.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId"});
|
|
610
|
+
JukeboxSession.hasMany(Notification, { as: "notifications", foreignKey: "jukeboxSessionId"});
|
|
557
611
|
JukeboxSession.belongsTo(JukeboxStatus, { as: "jukeboxStatus", foreignKey: "jukeboxStatusId"});
|
|
558
612
|
JukeboxStatus.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "jukeboxStatusId"});
|
|
559
613
|
JukeboxSession.belongsTo(JukeboxTerminationCondition, { as: "terminationCondition", foreignKey: "terminationConditionId"});
|
|
@@ -562,6 +616,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
562
616
|
JukeboxType.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "typeId"});
|
|
563
617
|
JukeboxUser.belongsTo(JukeboxUserType, { as: "jukeboxUserType", foreignKey: "jukeboxUserTypeId"});
|
|
564
618
|
JukeboxUserType.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "jukeboxUserTypeId"});
|
|
619
|
+
Notification.belongsTo(NotificationType, { as: "notificationType", foreignKey: "notificationTypeId"});
|
|
620
|
+
NotificationType.hasMany(Notification, { as: "notifications", foreignKey: "notificationTypeId"});
|
|
565
621
|
JukeboxUser.belongsTo(PauseStatusType, { as: "pauseStatusType", foreignKey: "pauseStatusTypeId"});
|
|
566
622
|
PauseStatusType.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "pauseStatusTypeId"});
|
|
567
623
|
AppUserPlatformRelation.belongsTo(Platform, { as: "platform", foreignKey: "platformId"});
|
|
@@ -640,6 +696,14 @@ export function initModels(sequelize: Sequelize) {
|
|
|
640
696
|
PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId"});
|
|
641
697
|
JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
|
|
642
698
|
PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
|
|
699
|
+
RadioShowGenres.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
700
|
+
RadioShow.hasMany(RadioShowGenres, { as: "radioShowGenres", foreignKey: "radioShowId"});
|
|
701
|
+
RadioShowMedia.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
702
|
+
RadioShow.hasMany(RadioShowMedia, { as: "radioShowMedia", foreignKey: "radioShowId"});
|
|
703
|
+
RadioShowPlacement.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
704
|
+
RadioShow.hasMany(RadioShowPlacement, { as: "radioShowPlacements", foreignKey: "radioShowId"});
|
|
705
|
+
RadioShowPublishRequests.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
|
|
706
|
+
RadioShow.hasMany(RadioShowPublishRequests, { as: "radioShowPublishRequests", foreignKey: "radioShowId"});
|
|
643
707
|
AppUser.belongsTo(State, { as: "state", foreignKey: "stateId"});
|
|
644
708
|
State.hasMany(AppUser, { as: "appUsers", foreignKey: "stateId"});
|
|
645
709
|
PlatformUserPlaylist.belongsTo(State, { as: "state", foreignKey: "stateId"});
|
|
@@ -696,6 +760,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
696
760
|
MetricsDaily: MetricsDaily,
|
|
697
761
|
MetricsEvent: MetricsEvent,
|
|
698
762
|
NewsSite: NewsSite,
|
|
763
|
+
Notification: Notification,
|
|
764
|
+
NotificationType: NotificationType,
|
|
699
765
|
PauseStatusType: PauseStatusType,
|
|
700
766
|
Platform: Platform,
|
|
701
767
|
PlatformAlbum: PlatformAlbum,
|
|
@@ -714,6 +780,11 @@ export function initModels(sequelize: Sequelize) {
|
|
|
714
780
|
PlatformUserPlaylistTrack: PlatformUserPlaylistTrack,
|
|
715
781
|
PlaybackStatus: PlaybackStatus,
|
|
716
782
|
PlaybackStatusType: PlaybackStatusType,
|
|
783
|
+
RadioShow: RadioShow,
|
|
784
|
+
RadioShowGenres: RadioShowGenres,
|
|
785
|
+
RadioShowMedia: RadioShowMedia,
|
|
786
|
+
RadioShowPlacement: RadioShowPlacement,
|
|
787
|
+
RadioShowPublishRequests: RadioShowPublishRequests,
|
|
717
788
|
State: State,
|
|
718
789
|
TrackDeletionReason: TrackDeletionReason,
|
|
719
790
|
UnmatchedAlbum: UnmatchedAlbum,
|