@earbug/db-models 0.0.15 → 0.0.16

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.
@@ -0,0 +1,89 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { MerchItem, MerchItemId } from './MerchItem';
4
+ import type { MerchOrchestration, MerchOrchestrationId } from './MerchOrchestration';
5
+
6
+ export interface MerchTypeAttributes {
7
+ id: string;
8
+ description: string;
9
+ createDate: Date;
10
+ updateDate: Date;
11
+ }
12
+
13
+ export type MerchTypePk = "id";
14
+ export type MerchTypeId = MerchType[MerchTypePk];
15
+ export type MerchTypeOptionalAttributes = "id" | "createDate" | "updateDate";
16
+ export type MerchTypeCreationAttributes = Optional<MerchTypeAttributes, MerchTypeOptionalAttributes>;
17
+
18
+ export class MerchType extends Model<MerchTypeAttributes, MerchTypeCreationAttributes> implements MerchTypeAttributes {
19
+ id!: string;
20
+ description!: string;
21
+ createDate!: Date;
22
+ updateDate!: Date;
23
+
24
+ // MerchType hasMany MerchItem via merchTypeId
25
+ merchItems!: MerchItem[];
26
+ getMerchItems!: Sequelize.HasManyGetAssociationsMixin<MerchItem>;
27
+ setMerchItems!: Sequelize.HasManySetAssociationsMixin<MerchItem, MerchItemId>;
28
+ addMerchItem!: Sequelize.HasManyAddAssociationMixin<MerchItem, MerchItemId>;
29
+ addMerchItems!: Sequelize.HasManyAddAssociationsMixin<MerchItem, MerchItemId>;
30
+ createMerchItem!: Sequelize.HasManyCreateAssociationMixin<MerchItem>;
31
+ removeMerchItem!: Sequelize.HasManyRemoveAssociationMixin<MerchItem, MerchItemId>;
32
+ removeMerchItems!: Sequelize.HasManyRemoveAssociationsMixin<MerchItem, MerchItemId>;
33
+ hasMerchItem!: Sequelize.HasManyHasAssociationMixin<MerchItem, MerchItemId>;
34
+ hasMerchItems!: Sequelize.HasManyHasAssociationsMixin<MerchItem, MerchItemId>;
35
+ countMerchItems!: Sequelize.HasManyCountAssociationsMixin;
36
+ // MerchType hasMany MerchOrchestration via merchTypeId
37
+ merchOrchestrations!: MerchOrchestration[];
38
+ getMerchOrchestrations!: Sequelize.HasManyGetAssociationsMixin<MerchOrchestration>;
39
+ setMerchOrchestrations!: Sequelize.HasManySetAssociationsMixin<MerchOrchestration, MerchOrchestrationId>;
40
+ addMerchOrchestration!: Sequelize.HasManyAddAssociationMixin<MerchOrchestration, MerchOrchestrationId>;
41
+ addMerchOrchestrations!: Sequelize.HasManyAddAssociationsMixin<MerchOrchestration, MerchOrchestrationId>;
42
+ createMerchOrchestration!: Sequelize.HasManyCreateAssociationMixin<MerchOrchestration>;
43
+ removeMerchOrchestration!: Sequelize.HasManyRemoveAssociationMixin<MerchOrchestration, MerchOrchestrationId>;
44
+ removeMerchOrchestrations!: Sequelize.HasManyRemoveAssociationsMixin<MerchOrchestration, MerchOrchestrationId>;
45
+ hasMerchOrchestration!: Sequelize.HasManyHasAssociationMixin<MerchOrchestration, MerchOrchestrationId>;
46
+ hasMerchOrchestrations!: Sequelize.HasManyHasAssociationsMixin<MerchOrchestration, MerchOrchestrationId>;
47
+ countMerchOrchestrations!: Sequelize.HasManyCountAssociationsMixin;
48
+
49
+ static initModel(sequelize: Sequelize.Sequelize): typeof MerchType {
50
+ return MerchType.init({
51
+ id: {
52
+ type: DataTypes.UUID,
53
+ allowNull: false,
54
+ defaultValue: DataTypes.UUIDV4,
55
+ primaryKey: true
56
+ },
57
+ description: {
58
+ type: DataTypes.TEXT,
59
+ allowNull: false
60
+ },
61
+ createDate: {
62
+ type: DataTypes.DATE,
63
+ allowNull: false,
64
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
65
+ field: 'create_date'
66
+ },
67
+ updateDate: {
68
+ type: DataTypes.DATE,
69
+ allowNull: false,
70
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
71
+ field: 'update_date'
72
+ }
73
+ }, {
74
+ sequelize,
75
+ tableName: 'merch_type',
76
+ schema: 'eb',
77
+ timestamps: false,
78
+ indexes: [
79
+ {
80
+ name: "merch_type_pkey",
81
+ unique: true,
82
+ fields: [
83
+ { name: "id" },
84
+ ]
85
+ },
86
+ ]
87
+ });
88
+ }
89
+ }
@@ -49,7 +49,7 @@ export class NewsArticle extends Model<NewsArticleAttributes, NewsArticleCreatio
49
49
  id: {
50
50
  type: DataTypes.UUID,
51
51
  allowNull: false,
52
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
52
+ defaultValue: DataTypes.UUIDV4,
53
53
  primaryKey: true
54
54
  },
55
55
  canonArtistId: {
@@ -71,20 +71,20 @@ export class NewsArticle extends Model<NewsArticleAttributes, NewsArticleCreatio
71
71
  field: 'news_platform_id'
72
72
  },
73
73
  title: {
74
- type: DataTypes.CITEXT,
74
+ type: DataTypes.TEXT,
75
75
  allowNull: false
76
76
  },
77
77
  description: {
78
- type: DataTypes.CITEXT,
78
+ type: DataTypes.TEXT,
79
79
  allowNull: false
80
80
  },
81
81
  articleUrl: {
82
- type: DataTypes.CITEXT,
82
+ type: DataTypes.TEXT,
83
83
  allowNull: false,
84
84
  field: 'article_url'
85
85
  },
86
86
  photoUrl: {
87
- type: DataTypes.CITEXT,
87
+ type: DataTypes.TEXT,
88
88
  allowNull: false,
89
89
  field: 'photo_url'
90
90
  },
@@ -123,4 +123,3 @@ export class NewsArticle extends Model<NewsArticleAttributes, NewsArticleCreatio
123
123
  });
124
124
  }
125
125
  }
126
-
@@ -38,11 +38,11 @@ export class NewsPlatform extends Model<NewsPlatformAttributes, NewsPlatformCrea
38
38
  id: {
39
39
  type: DataTypes.UUID,
40
40
  allowNull: false,
41
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
41
+ defaultValue: DataTypes.UUIDV4,
42
42
  primaryKey: true
43
43
  },
44
44
  name: {
45
- type: DataTypes.CITEXT,
45
+ type: DataTypes.TEXT,
46
46
  allowNull: false
47
47
  },
48
48
  createDate: {
@@ -74,4 +74,3 @@ export class NewsPlatform extends Model<NewsPlatformAttributes, NewsPlatformCrea
74
74
  });
75
75
  }
76
76
  }
77
-
@@ -2,6 +2,7 @@ import * as Sequelize from 'sequelize';
2
2
  import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { CanonToPlatformTrackRelation, CanonToPlatformTrackRelationId } from './CanonToPlatformTrackRelation';
4
4
  import type { CanonTrack, CanonTrackId } from './CanonTrack';
5
+ import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
5
6
  import type { Platform, PlatformId } from './Platform';
6
7
  import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
7
8
  import type { PlatformAlbumTrackRelation, PlatformAlbumTrackRelationId } from './PlatformAlbumTrackRelation';
@@ -79,6 +80,18 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
79
80
  hasCanonTrackIdCanonTrackCanonToPlatformTrackRelation!: Sequelize.BelongsToManyHasAssociationMixin<CanonTrack, CanonTrackId>;
80
81
  hasCanonTrackIdCanonTrackCanonToPlatformTrackRelations!: Sequelize.BelongsToManyHasAssociationsMixin<CanonTrack, CanonTrackId>;
81
82
  countCanonTrackIdCanonTrackCanonToPlatformTrackRelations!: Sequelize.BelongsToManyCountAssociationsMixin;
83
+ // PlatformTrack hasMany JukeboxQueueEntry via platformTrackId
84
+ jukeboxQueueEntries!: JukeboxQueueEntry[];
85
+ getJukeboxQueueEntries!: Sequelize.HasManyGetAssociationsMixin<JukeboxQueueEntry>;
86
+ setJukeboxQueueEntries!: Sequelize.HasManySetAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
87
+ addJukeboxQueueEntry!: Sequelize.HasManyAddAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
88
+ addJukeboxQueueEntries!: Sequelize.HasManyAddAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
89
+ createJukeboxQueueEntry!: Sequelize.HasManyCreateAssociationMixin<JukeboxQueueEntry>;
90
+ removeJukeboxQueueEntry!: Sequelize.HasManyRemoveAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
91
+ removeJukeboxQueueEntries!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
92
+ hasJukeboxQueueEntry!: Sequelize.HasManyHasAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
93
+ hasJukeboxQueueEntries!: Sequelize.HasManyHasAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
94
+ countJukeboxQueueEntries!: Sequelize.HasManyCountAssociationsMixin;
82
95
  // PlatformTrack belongsToMany PlatformAlbum via platformTrackId and platformAlbumId
83
96
  platformAlbumIdPlatformAlbumPlatformAlbumTrackRelations!: PlatformAlbum[];
84
97
  getPlatformAlbumIdPlatformAlbumPlatformAlbumTrackRelations!: Sequelize.BelongsToManyGetAssociationsMixin<PlatformAlbum>;
@@ -138,6 +138,12 @@ export class RadioShow extends Model<RadioShowAttributes, RadioShowCreationAttri
138
138
  schema: 'eb',
139
139
  timestamps: false,
140
140
  indexes: [
141
+ {
142
+ name: "idx_radio_show_creator",
143
+ fields: [
144
+ { name: "creator_user_id" },
145
+ ]
146
+ },
141
147
  {
142
148
  name: "radio_show_pkey",
143
149
  unique: true,
@@ -8,11 +8,12 @@ export interface RadioShowGenresAttributes {
8
8
  radioShowId: string;
9
9
  title: string;
10
10
  id: string;
11
+ seqNum?: number;
11
12
  }
12
13
 
13
14
  export type RadioShowGenresPk = "id";
14
15
  export type RadioShowGenresId = RadioShowGenres[RadioShowGenresPk];
15
- export type RadioShowGenresOptionalAttributes = "id";
16
+ export type RadioShowGenresOptionalAttributes = "id" | "seqNum";
16
17
  export type RadioShowGenresCreationAttributes = Optional<RadioShowGenresAttributes, RadioShowGenresOptionalAttributes>;
17
18
 
18
19
  export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowGenresCreationAttributes> implements RadioShowGenresAttributes {
@@ -20,6 +21,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
20
21
  radioShowId!: string;
21
22
  title!: string;
22
23
  id!: string;
24
+ seqNum?: number;
23
25
 
24
26
  // RadioShowGenres belongsTo CanonGenre via canonGenreId
25
27
  canonGenre!: CanonGenre;
@@ -41,6 +43,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
41
43
  model: 'canon_genre',
42
44
  key: 'id'
43
45
  },
46
+ unique: "uq_radio_show_genre_unique",
44
47
  field: 'canon_genre_id'
45
48
  },
46
49
  radioShowId: {
@@ -50,6 +53,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
50
53
  model: 'radio_show',
51
54
  key: 'id'
52
55
  },
56
+ unique: "uq_radio_show_genre_unique",
53
57
  field: 'radio_show_id'
54
58
  },
55
59
  title: {
@@ -61,6 +65,12 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
61
65
  allowNull: false,
62
66
  defaultValue: DataTypes.UUIDV4,
63
67
  primaryKey: true
68
+ },
69
+ seqNum: {
70
+ type: DataTypes.SMALLINT,
71
+ allowNull: true,
72
+ unique: "uq_radio_show_genre_seq_unique",
73
+ field: 'seq_num'
64
74
  }
65
75
  }, {
66
76
  sequelize,
@@ -75,6 +85,22 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
75
85
  { name: "id" },
76
86
  ]
77
87
  },
88
+ {
89
+ name: "uq_radio_show_genre_seq_unique",
90
+ unique: true,
91
+ fields: [
92
+ { name: "radio_show_id" },
93
+ { name: "seq_num" },
94
+ ]
95
+ },
96
+ {
97
+ name: "uq_radio_show_genre_unique",
98
+ unique: true,
99
+ fields: [
100
+ { name: "radio_show_id" },
101
+ { name: "canon_genre_id" },
102
+ ]
103
+ },
78
104
  ]
79
105
  });
80
106
  }
@@ -61,6 +61,8 @@ import { ConfigParam as _ConfigParam } from "./ConfigParam";
61
61
  import type { ConfigParamAttributes, ConfigParamCreationAttributes } from "./ConfigParam";
62
62
  import { ExternalReference as _ExternalReference } from "./ExternalReference";
63
63
  import type { ExternalReferenceAttributes, ExternalReferenceCreationAttributes } from "./ExternalReference";
64
+ import { GuestUser as _GuestUser } from "./GuestUser";
65
+ import type { GuestUserAttributes, GuestUserCreationAttributes } from "./GuestUser";
64
66
  import { JukeboxAccessType as _JukeboxAccessType } from "./JukeboxAccessType";
65
67
  import type { JukeboxAccessTypeAttributes, JukeboxAccessTypeCreationAttributes } from "./JukeboxAccessType";
66
68
  import { JukeboxCanonGenreRelation as _JukeboxCanonGenreRelation } from "./JukeboxCanonGenreRelation";
@@ -87,6 +89,14 @@ import { KnexMigrations as _KnexMigrations } from "./KnexMigrations";
87
89
  import type { KnexMigrationsAttributes, KnexMigrationsCreationAttributes } from "./KnexMigrations";
88
90
  import { KnexMigrationsLock as _KnexMigrationsLock } from "./KnexMigrationsLock";
89
91
  import type { KnexMigrationsLockAttributes, KnexMigrationsLockCreationAttributes } from "./KnexMigrationsLock";
92
+ import { MerchItem as _MerchItem } from "./MerchItem";
93
+ import type { MerchItemAttributes, MerchItemCreationAttributes } from "./MerchItem";
94
+ import { MerchOrchestration as _MerchOrchestration } from "./MerchOrchestration";
95
+ import type { MerchOrchestrationAttributes, MerchOrchestrationCreationAttributes } from "./MerchOrchestration";
96
+ import { MerchPlatform as _MerchPlatform } from "./MerchPlatform";
97
+ import type { MerchPlatformAttributes, MerchPlatformCreationAttributes } from "./MerchPlatform";
98
+ import { MerchType as _MerchType } from "./MerchType";
99
+ import type { MerchTypeAttributes, MerchTypeCreationAttributes } from "./MerchType";
90
100
  import { MetricsDaily as _MetricsDaily } from "./MetricsDaily";
91
101
  import type { MetricsDailyAttributes, MetricsDailyCreationAttributes } from "./MetricsDaily";
92
102
  import { MetricsEvent as _MetricsEvent } from "./MetricsEvent";
@@ -190,6 +200,7 @@ export {
190
200
  _CanonTrack as CanonTrack,
191
201
  _ConfigParam as ConfigParam,
192
202
  _ExternalReference as ExternalReference,
203
+ _GuestUser as GuestUser,
193
204
  _JukeboxAccessType as JukeboxAccessType,
194
205
  _JukeboxCanonGenreRelation as JukeboxCanonGenreRelation,
195
206
  _JukeboxInvite as JukeboxInvite,
@@ -203,6 +214,10 @@ export {
203
214
  _JukeboxUserType as JukeboxUserType,
204
215
  _KnexMigrations as KnexMigrations,
205
216
  _KnexMigrationsLock as KnexMigrationsLock,
217
+ _MerchItem as MerchItem,
218
+ _MerchOrchestration as MerchOrchestration,
219
+ _MerchPlatform as MerchPlatform,
220
+ _MerchType as MerchType,
206
221
  _MetricsDaily as MetricsDaily,
207
222
  _MetricsEvent as MetricsEvent,
208
223
  _NewsArticle as NewsArticle,
@@ -303,6 +318,8 @@ export type {
303
318
  ConfigParamCreationAttributes,
304
319
  ExternalReferenceAttributes,
305
320
  ExternalReferenceCreationAttributes,
321
+ GuestUserAttributes,
322
+ GuestUserCreationAttributes,
306
323
  JukeboxAccessTypeAttributes,
307
324
  JukeboxAccessTypeCreationAttributes,
308
325
  JukeboxCanonGenreRelationAttributes,
@@ -329,6 +346,14 @@ export type {
329
346
  KnexMigrationsCreationAttributes,
330
347
  KnexMigrationsLockAttributes,
331
348
  KnexMigrationsLockCreationAttributes,
349
+ MerchItemAttributes,
350
+ MerchItemCreationAttributes,
351
+ MerchOrchestrationAttributes,
352
+ MerchOrchestrationCreationAttributes,
353
+ MerchPlatformAttributes,
354
+ MerchPlatformCreationAttributes,
355
+ MerchTypeAttributes,
356
+ MerchTypeCreationAttributes,
332
357
  MetricsDailyAttributes,
333
358
  MetricsDailyCreationAttributes,
334
359
  MetricsEventAttributes,
@@ -433,6 +458,7 @@ export function initModels(sequelize: Sequelize) {
433
458
  const CanonTrack = _CanonTrack.initModel(sequelize);
434
459
  const ConfigParam = _ConfigParam.initModel(sequelize);
435
460
  const ExternalReference = _ExternalReference.initModel(sequelize);
461
+ const GuestUser = _GuestUser.initModel(sequelize);
436
462
  const JukeboxAccessType = _JukeboxAccessType.initModel(sequelize);
437
463
  const JukeboxCanonGenreRelation = _JukeboxCanonGenreRelation.initModel(sequelize);
438
464
  const JukeboxInvite = _JukeboxInvite.initModel(sequelize);
@@ -446,6 +472,10 @@ export function initModels(sequelize: Sequelize) {
446
472
  const JukeboxUserType = _JukeboxUserType.initModel(sequelize);
447
473
  const KnexMigrations = _KnexMigrations.initModel(sequelize);
448
474
  const KnexMigrationsLock = _KnexMigrationsLock.initModel(sequelize);
475
+ const MerchItem = _MerchItem.initModel(sequelize);
476
+ const MerchOrchestration = _MerchOrchestration.initModel(sequelize);
477
+ const MerchPlatform = _MerchPlatform.initModel(sequelize);
478
+ const MerchType = _MerchType.initModel(sequelize);
449
479
  const MetricsDaily = _MetricsDaily.initModel(sequelize);
450
480
  const MetricsEvent = _MetricsEvent.initModel(sequelize);
451
481
  const NewsArticle = _NewsArticle.initModel(sequelize);
@@ -570,6 +600,10 @@ export function initModels(sequelize: Sequelize) {
570
600
  CanonArtist.hasMany(CanonArtistTrackRelation, { as: "canonArtistTrackRelations", foreignKey: "canonArtistId"});
571
601
  CanonToPlatformArtistRelation.belongsTo(CanonArtist, { as: "canonArtist", foreignKey: "canonArtistId"});
572
602
  CanonArtist.hasMany(CanonToPlatformArtistRelation, { as: "canonToPlatformArtistRelations", foreignKey: "canonArtistId"});
603
+ MerchItem.belongsTo(CanonArtist, { as: "canonArtist", foreignKey: "canonArtistId"});
604
+ CanonArtist.hasMany(MerchItem, { as: "merchItems", foreignKey: "canonArtistId"});
605
+ MerchOrchestration.belongsTo(CanonArtist, { as: "canonArtist", foreignKey: "canonArtistId"});
606
+ CanonArtist.hasMany(MerchOrchestration, { as: "merchOrchestrations", foreignKey: "canonArtistId"});
573
607
  NewsArticle.belongsTo(CanonArtist, { as: "canonArtist", foreignKey: "canonArtistId"});
574
608
  CanonArtist.hasMany(NewsArticle, { as: "newsArticles", foreignKey: "canonArtistId"});
575
609
  CanonAlbumGenreRelation.belongsTo(CanonGenre, { as: "canonGenre", foreignKey: "canonGenreId"});
@@ -612,12 +646,16 @@ export function initModels(sequelize: Sequelize) {
612
646
  ExternalReference.hasMany(CanonLabelExternalReferenceRelation, { as: "canonLabelExternalReferenceRelations", foreignKey: "externalReferenceId"});
613
647
  CanonMemberExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
614
648
  ExternalReference.hasMany(CanonMemberExternalReferenceRelation, { as: "canonMemberExternalReferenceRelations", foreignKey: "externalReferenceId"});
649
+ JukeboxQueueEntry.belongsTo(GuestUser, { as: "trackAddedGuestUser", foreignKey: "trackAddedGuestUserId"});
650
+ GuestUser.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackAddedGuestUserId"});
615
651
  JukeboxSession.belongsTo(JukeboxAccessType, { as: "accessType", foreignKey: "accessTypeId"});
616
652
  JukeboxAccessType.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "accessTypeId"});
617
653
  JukeboxUser.belongsTo(JukeboxQueueEntry, { as: "pausedQueueEntry", foreignKey: "pausedQueueEntryId"});
618
654
  JukeboxQueueEntry.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "pausedQueueEntryId"});
619
655
  JukeboxSession.belongsTo(JukeboxQueueMode, { as: "jukeboxQueueMode", foreignKey: "jukeboxQueueModeId"});
620
656
  JukeboxQueueMode.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "jukeboxQueueModeId"});
657
+ GuestUser.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId"});
658
+ JukeboxSession.hasMany(GuestUser, { as: "guestUsers", foreignKey: "jukeboxSessionId"});
621
659
  JukeboxCanonGenreRelation.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId"});
622
660
  JukeboxSession.hasMany(JukeboxCanonGenreRelation, { as: "jukeboxCanonGenreRelations", foreignKey: "jukeboxSessionId"});
623
661
  JukeboxInvite.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId"});
@@ -636,6 +674,14 @@ export function initModels(sequelize: Sequelize) {
636
674
  JukeboxType.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "typeId"});
637
675
  JukeboxUser.belongsTo(JukeboxUserType, { as: "jukeboxUserType", foreignKey: "jukeboxUserTypeId"});
638
676
  JukeboxUserType.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "jukeboxUserTypeId"});
677
+ MerchItem.belongsTo(MerchPlatform, { as: "merchPlatform", foreignKey: "merchPlatformId"});
678
+ MerchPlatform.hasMany(MerchItem, { as: "merchItems", foreignKey: "merchPlatformId"});
679
+ MerchOrchestration.belongsTo(MerchPlatform, { as: "merchPlatform", foreignKey: "merchPlatformId"});
680
+ MerchPlatform.hasMany(MerchOrchestration, { as: "merchOrchestrations", foreignKey: "merchPlatformId"});
681
+ MerchItem.belongsTo(MerchType, { as: "merchType", foreignKey: "merchTypeId"});
682
+ MerchType.hasMany(MerchItem, { as: "merchItems", foreignKey: "merchTypeId"});
683
+ MerchOrchestration.belongsTo(MerchType, { as: "merchType", foreignKey: "merchTypeId"});
684
+ MerchType.hasMany(MerchOrchestration, { as: "merchOrchestrations", foreignKey: "merchTypeId"});
639
685
  NewsArticle.belongsTo(NewsPlatform, { as: "newsPlatform", foreignKey: "newsPlatformId"});
640
686
  NewsPlatform.hasMany(NewsArticle, { as: "newsArticles", foreignKey: "newsPlatformId"});
641
687
  Notification.belongsTo(NotificationType, { as: "notificationType", foreignKey: "notificationTypeId"});
@@ -702,6 +748,8 @@ export function initModels(sequelize: Sequelize) {
702
748
  PlatformGenre.hasMany(PlatformTrackGenreRelation, { as: "platformTrackGenreRelations", foreignKey: "platformGenreId"});
703
749
  CanonToPlatformTrackRelation.belongsTo(PlatformTrack, { as: "platformTrack", foreignKey: "platformTrackId"});
704
750
  PlatformTrack.hasMany(CanonToPlatformTrackRelation, { as: "canonToPlatformTrackRelations", foreignKey: "platformTrackId"});
751
+ JukeboxQueueEntry.belongsTo(PlatformTrack, { as: "platformTrack", foreignKey: "platformTrackId"});
752
+ PlatformTrack.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "platformTrackId"});
705
753
  PlatformAlbumTrackRelation.belongsTo(PlatformTrack, { as: "platformTrack", foreignKey: "platformTrackId"});
706
754
  PlatformTrack.hasMany(PlatformAlbumTrackRelation, { as: "platformAlbumTrackRelations", foreignKey: "platformTrackId"});
707
755
  PlatformArtistTrackRelation.belongsTo(PlatformTrack, { as: "platformTrack", foreignKey: "platformTrackId"});
@@ -716,8 +764,8 @@ export function initModels(sequelize: Sequelize) {
716
764
  PlatformUserAlbum.hasMany(PlatformUserAlbumTrack, { as: "platformUserAlbumTracks", foreignKey: "platformUserAlbumId"});
717
765
  PlatformUserPlaylistTrack.belongsTo(PlatformUserPlaylist, { as: "platformUserPlaylist", foreignKey: "platformUserPlaylistId"});
718
766
  PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId"});
719
- JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
720
- PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
767
+ JukeboxQueueEntry.belongsTo(PlaybackStatus, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
768
+ PlaybackStatus.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
721
769
  RadioShowGenres.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
722
770
  RadioShow.hasMany(RadioShowGenres, { as: "radioShowGenres", foreignKey: "radioShowId"});
723
771
  RadioShowMedia.belongsTo(RadioShow, { as: "radioShow", foreignKey: "radioShowId"});
@@ -767,6 +815,7 @@ export function initModels(sequelize: Sequelize) {
767
815
  CanonTrack: CanonTrack,
768
816
  ConfigParam: ConfigParam,
769
817
  ExternalReference: ExternalReference,
818
+ GuestUser: GuestUser,
770
819
  JukeboxAccessType: JukeboxAccessType,
771
820
  JukeboxCanonGenreRelation: JukeboxCanonGenreRelation,
772
821
  JukeboxInvite: JukeboxInvite,
@@ -780,6 +829,10 @@ export function initModels(sequelize: Sequelize) {
780
829
  JukeboxUserType: JukeboxUserType,
781
830
  KnexMigrations: KnexMigrations,
782
831
  KnexMigrationsLock: KnexMigrationsLock,
832
+ MerchItem: MerchItem,
833
+ MerchOrchestration: MerchOrchestration,
834
+ MerchPlatform: MerchPlatform,
835
+ MerchType: MerchType,
783
836
  MetricsDaily: MetricsDaily,
784
837
  MetricsEvent: MetricsEvent,
785
838
  NewsArticle: NewsArticle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earbug/db-models",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "main": "dist/init-models.js",
5
5
  "types": "dist/init-models.d.ts",
6
6
  "scripts": {