@earbug/db-models 0.0.16 → 0.0.18

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.
@@ -11,6 +11,8 @@ import type { JukeboxTerminationCondition, JukeboxTerminationConditionId } from
11
11
  import type { JukeboxType, JukeboxTypeId } from './JukeboxType';
12
12
  import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
13
13
  import type { Notification, NotificationId } from './Notification';
14
+ import type { UserComments, UserCommentsId } from './UserComments';
15
+ import type { UserLikes, UserLikesId } from './UserLikes';
14
16
 
15
17
  export interface JukeboxSessionAttributes {
16
18
  typeId: number;
@@ -128,6 +130,30 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
128
130
  hasNotification!: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
129
131
  hasNotifications!: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
130
132
  countNotifications!: Sequelize.HasManyCountAssociationsMixin;
133
+ // JukeboxSession hasMany UserComments via jukeboxId
134
+ userComments!: UserComments[];
135
+ getUserComments!: Sequelize.HasManyGetAssociationsMixin<UserComments>;
136
+ setUserComments!: Sequelize.HasManySetAssociationsMixin<UserComments, UserCommentsId>;
137
+ addUserComment!: Sequelize.HasManyAddAssociationMixin<UserComments, UserCommentsId>;
138
+ addUserComments!: Sequelize.HasManyAddAssociationsMixin<UserComments, UserCommentsId>;
139
+ createUserComment!: Sequelize.HasManyCreateAssociationMixin<UserComments>;
140
+ removeUserComment!: Sequelize.HasManyRemoveAssociationMixin<UserComments, UserCommentsId>;
141
+ removeUserComments!: Sequelize.HasManyRemoveAssociationsMixin<UserComments, UserCommentsId>;
142
+ hasUserComment!: Sequelize.HasManyHasAssociationMixin<UserComments, UserCommentsId>;
143
+ hasUserComments!: Sequelize.HasManyHasAssociationsMixin<UserComments, UserCommentsId>;
144
+ countUserComments!: Sequelize.HasManyCountAssociationsMixin;
145
+ // JukeboxSession hasMany UserLikes via jukeboxId
146
+ userLikes!: UserLikes[];
147
+ getUserLikes!: Sequelize.HasManyGetAssociationsMixin<UserLikes>;
148
+ setUserLikes!: Sequelize.HasManySetAssociationsMixin<UserLikes, UserLikesId>;
149
+ addUserLike!: Sequelize.HasManyAddAssociationMixin<UserLikes, UserLikesId>;
150
+ addUserLikes!: Sequelize.HasManyAddAssociationsMixin<UserLikes, UserLikesId>;
151
+ createUserLike!: Sequelize.HasManyCreateAssociationMixin<UserLikes>;
152
+ removeUserLike!: Sequelize.HasManyRemoveAssociationMixin<UserLikes, UserLikesId>;
153
+ removeUserLikes!: Sequelize.HasManyRemoveAssociationsMixin<UserLikes, UserLikesId>;
154
+ hasUserLike!: Sequelize.HasManyHasAssociationMixin<UserLikes, UserLikesId>;
155
+ hasUserLikes!: Sequelize.HasManyHasAssociationsMixin<UserLikes, UserLikesId>;
156
+ countUserLikes!: Sequelize.HasManyCountAssociationsMixin;
131
157
  // JukeboxSession belongsTo JukeboxStatus via jukeboxStatusId
132
158
  jukeboxStatus!: JukeboxStatus;
133
159
  getJukeboxStatus!: Sequelize.BelongsToGetAssociationMixin<JukeboxStatus>;
@@ -5,7 +5,6 @@ import type { MerchPlatform, MerchPlatformId } from './MerchPlatform';
5
5
  import type { MerchType, MerchTypeId } from './MerchType';
6
6
 
7
7
  export interface MerchItemAttributes {
8
- id: string;
9
8
  canonArtistId: string;
10
9
  merchTypeId: string;
11
10
  merchPlatformId: string;
@@ -14,6 +13,7 @@ export interface MerchItemAttributes {
14
13
  description: string;
15
14
  photo?: string;
16
15
  popularity?: number;
16
+ id: string;
17
17
  inactive?: boolean;
18
18
  createDate: Date;
19
19
  updateDate: Date;
@@ -21,11 +21,10 @@ export interface MerchItemAttributes {
21
21
 
22
22
  export type MerchItemPk = "id";
23
23
  export type MerchItemId = MerchItem[MerchItemPk];
24
- export type MerchItemOptionalAttributes = "id" | "photo" | "popularity" | "inactive" | "createDate" | "updateDate";
24
+ export type MerchItemOptionalAttributes = "photo" | "popularity" | "id" | "inactive" | "createDate" | "updateDate";
25
25
  export type MerchItemCreationAttributes = Optional<MerchItemAttributes, MerchItemOptionalAttributes>;
26
26
 
27
27
  export class MerchItem extends Model<MerchItemAttributes, MerchItemCreationAttributes> implements MerchItemAttributes {
28
- id!: string;
29
28
  canonArtistId!: string;
30
29
  merchTypeId!: string;
31
30
  merchPlatformId!: string;
@@ -34,6 +33,7 @@ export class MerchItem extends Model<MerchItemAttributes, MerchItemCreationAttri
34
33
  description!: string;
35
34
  photo?: string;
36
35
  popularity?: number;
36
+ id!: string;
37
37
  inactive?: boolean;
38
38
  createDate!: Date;
39
39
  updateDate!: Date;
@@ -56,12 +56,6 @@ export class MerchItem extends Model<MerchItemAttributes, MerchItemCreationAttri
56
56
 
57
57
  static initModel(sequelize: Sequelize.Sequelize): typeof MerchItem {
58
58
  return MerchItem.init({
59
- id: {
60
- type: DataTypes.UUID,
61
- allowNull: false,
62
- defaultValue: DataTypes.UUIDV4,
63
- primaryKey: true
64
- },
65
59
  canonArtistId: {
66
60
  type: DataTypes.UUID,
67
61
  allowNull: false,
@@ -110,6 +104,12 @@ export class MerchItem extends Model<MerchItemAttributes, MerchItemCreationAttri
110
104
  type: DataTypes.SMALLINT,
111
105
  allowNull: true
112
106
  },
107
+ id: {
108
+ type: DataTypes.UUID,
109
+ allowNull: false,
110
+ defaultValue: DataTypes.UUIDV4,
111
+ primaryKey: true
112
+ },
113
113
  inactive: {
114
114
  type: DataTypes.BOOLEAN,
115
115
  allowNull: true,
@@ -5,28 +5,28 @@ import type { MerchPlatform, MerchPlatformId } from './MerchPlatform';
5
5
  import type { MerchType, MerchTypeId } from './MerchType';
6
6
 
7
7
  export interface MerchOrchestrationAttributes {
8
- id: string;
9
8
  canonArtistId: string;
10
9
  merchTypeId: string;
11
10
  merchPlatformId: string;
12
11
  errorMessage?: string;
13
12
  lastHarvestDate?: Date;
13
+ id: string;
14
14
  createDate: Date;
15
15
  updateDate: Date;
16
16
  }
17
17
 
18
18
  export type MerchOrchestrationPk = "id";
19
19
  export type MerchOrchestrationId = MerchOrchestration[MerchOrchestrationPk];
20
- export type MerchOrchestrationOptionalAttributes = "id" | "errorMessage" | "lastHarvestDate" | "createDate" | "updateDate";
20
+ export type MerchOrchestrationOptionalAttributes = "errorMessage" | "lastHarvestDate" | "id" | "createDate" | "updateDate";
21
21
  export type MerchOrchestrationCreationAttributes = Optional<MerchOrchestrationAttributes, MerchOrchestrationOptionalAttributes>;
22
22
 
23
23
  export class MerchOrchestration extends Model<MerchOrchestrationAttributes, MerchOrchestrationCreationAttributes> implements MerchOrchestrationAttributes {
24
- id!: string;
25
24
  canonArtistId!: string;
26
25
  merchTypeId!: string;
27
26
  merchPlatformId!: string;
28
27
  errorMessage?: string;
29
28
  lastHarvestDate?: Date;
29
+ id!: string;
30
30
  createDate!: Date;
31
31
  updateDate!: Date;
32
32
 
@@ -48,12 +48,6 @@ export class MerchOrchestration extends Model<MerchOrchestrationAttributes, Merc
48
48
 
49
49
  static initModel(sequelize: Sequelize.Sequelize): typeof MerchOrchestration {
50
50
  return MerchOrchestration.init({
51
- id: {
52
- type: DataTypes.UUID,
53
- allowNull: false,
54
- defaultValue: DataTypes.UUIDV4,
55
- primaryKey: true
56
- },
57
51
  canonArtistId: {
58
52
  type: DataTypes.UUID,
59
53
  allowNull: false,
@@ -91,6 +85,12 @@ export class MerchOrchestration extends Model<MerchOrchestrationAttributes, Merc
91
85
  allowNull: true,
92
86
  field: 'last_harvest_date'
93
87
  },
88
+ id: {
89
+ type: DataTypes.UUID,
90
+ allowNull: false,
91
+ defaultValue: DataTypes.UUIDV4,
92
+ primaryKey: true
93
+ },
94
94
  createDate: {
95
95
  type: DataTypes.DATE,
96
96
  allowNull: false,
@@ -4,9 +4,9 @@ import type { MerchItem, MerchItemId } from './MerchItem';
4
4
  import type { MerchOrchestration, MerchOrchestrationId } from './MerchOrchestration';
5
5
 
6
6
  export interface MerchPlatformAttributes {
7
- id: string;
8
7
  name: string;
9
8
  host: string;
9
+ id: string;
10
10
  createDate: Date;
11
11
  updateDate: Date;
12
12
  }
@@ -17,9 +17,9 @@ export type MerchPlatformOptionalAttributes = "id" | "createDate" | "updateDate"
17
17
  export type MerchPlatformCreationAttributes = Optional<MerchPlatformAttributes, MerchPlatformOptionalAttributes>;
18
18
 
19
19
  export class MerchPlatform extends Model<MerchPlatformAttributes, MerchPlatformCreationAttributes> implements MerchPlatformAttributes {
20
- id!: string;
21
20
  name!: string;
22
21
  host!: string;
22
+ id!: string;
23
23
  createDate!: Date;
24
24
  updateDate!: Date;
25
25
 
@@ -50,12 +50,6 @@ export class MerchPlatform extends Model<MerchPlatformAttributes, MerchPlatformC
50
50
 
51
51
  static initModel(sequelize: Sequelize.Sequelize): typeof MerchPlatform {
52
52
  return MerchPlatform.init({
53
- id: {
54
- type: DataTypes.UUID,
55
- allowNull: false,
56
- defaultValue: DataTypes.UUIDV4,
57
- primaryKey: true
58
- },
59
53
  name: {
60
54
  type: DataTypes.TEXT,
61
55
  allowNull: false
@@ -64,6 +58,12 @@ export class MerchPlatform extends Model<MerchPlatformAttributes, MerchPlatformC
64
58
  type: DataTypes.TEXT,
65
59
  allowNull: false
66
60
  },
61
+ id: {
62
+ type: DataTypes.UUID,
63
+ allowNull: false,
64
+ defaultValue: DataTypes.UUIDV4,
65
+ primaryKey: true
66
+ },
67
67
  createDate: {
68
68
  type: DataTypes.DATE,
69
69
  allowNull: false,
@@ -4,8 +4,8 @@ import type { MerchItem, MerchItemId } from './MerchItem';
4
4
  import type { MerchOrchestration, MerchOrchestrationId } from './MerchOrchestration';
5
5
 
6
6
  export interface MerchTypeAttributes {
7
- id: string;
8
7
  description: string;
8
+ id: string;
9
9
  createDate: Date;
10
10
  updateDate: Date;
11
11
  }
@@ -16,8 +16,8 @@ export type MerchTypeOptionalAttributes = "id" | "createDate" | "updateDate";
16
16
  export type MerchTypeCreationAttributes = Optional<MerchTypeAttributes, MerchTypeOptionalAttributes>;
17
17
 
18
18
  export class MerchType extends Model<MerchTypeAttributes, MerchTypeCreationAttributes> implements MerchTypeAttributes {
19
- id!: string;
20
19
  description!: string;
20
+ id!: string;
21
21
  createDate!: Date;
22
22
  updateDate!: Date;
23
23
 
@@ -48,16 +48,16 @@ export class MerchType extends Model<MerchTypeAttributes, MerchTypeCreationAttri
48
48
 
49
49
  static initModel(sequelize: Sequelize.Sequelize): typeof MerchType {
50
50
  return MerchType.init({
51
+ description: {
52
+ type: DataTypes.TEXT,
53
+ allowNull: false
54
+ },
51
55
  id: {
52
56
  type: DataTypes.UUID,
53
57
  allowNull: false,
54
58
  defaultValue: DataTypes.UUIDV4,
55
59
  primaryKey: true
56
60
  },
57
- description: {
58
- type: DataTypes.TEXT,
59
- allowNull: false
60
- },
61
61
  createDate: {
62
62
  type: DataTypes.DATE,
63
63
  allowNull: false,
@@ -4,6 +4,8 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
  import type { Platform, PlatformId } from './Platform';
5
5
  import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
6
6
  import type { State, StateId } from './State';
7
+ import type { UserComments, UserCommentsId } from './UserComments';
8
+ import type { UserLikes, UserLikesId } from './UserLikes';
7
9
 
8
10
  export interface PlatformUserPlaylistAttributes {
9
11
  appUserId: string;
@@ -63,6 +65,30 @@ export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes,
63
65
  hasPlatformUserPlaylistTrack!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
64
66
  hasPlatformUserPlaylistTracks!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
65
67
  countPlatformUserPlaylistTracks!: Sequelize.HasManyCountAssociationsMixin;
68
+ // PlatformUserPlaylist hasMany UserComments via playlistId
69
+ userComments!: UserComments[];
70
+ getUserComments!: Sequelize.HasManyGetAssociationsMixin<UserComments>;
71
+ setUserComments!: Sequelize.HasManySetAssociationsMixin<UserComments, UserCommentsId>;
72
+ addUserComment!: Sequelize.HasManyAddAssociationMixin<UserComments, UserCommentsId>;
73
+ addUserComments!: Sequelize.HasManyAddAssociationsMixin<UserComments, UserCommentsId>;
74
+ createUserComment!: Sequelize.HasManyCreateAssociationMixin<UserComments>;
75
+ removeUserComment!: Sequelize.HasManyRemoveAssociationMixin<UserComments, UserCommentsId>;
76
+ removeUserComments!: Sequelize.HasManyRemoveAssociationsMixin<UserComments, UserCommentsId>;
77
+ hasUserComment!: Sequelize.HasManyHasAssociationMixin<UserComments, UserCommentsId>;
78
+ hasUserComments!: Sequelize.HasManyHasAssociationsMixin<UserComments, UserCommentsId>;
79
+ countUserComments!: Sequelize.HasManyCountAssociationsMixin;
80
+ // PlatformUserPlaylist hasMany UserLikes via playlistId
81
+ userLikes!: UserLikes[];
82
+ getUserLikes!: Sequelize.HasManyGetAssociationsMixin<UserLikes>;
83
+ setUserLikes!: Sequelize.HasManySetAssociationsMixin<UserLikes, UserLikesId>;
84
+ addUserLike!: Sequelize.HasManyAddAssociationMixin<UserLikes, UserLikesId>;
85
+ addUserLikes!: Sequelize.HasManyAddAssociationsMixin<UserLikes, UserLikesId>;
86
+ createUserLike!: Sequelize.HasManyCreateAssociationMixin<UserLikes>;
87
+ removeUserLike!: Sequelize.HasManyRemoveAssociationMixin<UserLikes, UserLikesId>;
88
+ removeUserLikes!: Sequelize.HasManyRemoveAssociationsMixin<UserLikes, UserLikesId>;
89
+ hasUserLike!: Sequelize.HasManyHasAssociationMixin<UserLikes, UserLikesId>;
90
+ hasUserLikes!: Sequelize.HasManyHasAssociationsMixin<UserLikes, UserLikesId>;
91
+ countUserLikes!: Sequelize.HasManyCountAssociationsMixin;
66
92
  // PlatformUserPlaylist belongsTo State via stateId
67
93
  state!: State;
68
94
  getState!: Sequelize.BelongsToGetAssociationMixin<State>;
@@ -5,6 +5,8 @@ import type { RadioShowGenres, RadioShowGenresId } from './RadioShowGenres';
5
5
  import type { RadioShowMedia, RadioShowMediaId } from './RadioShowMedia';
6
6
  import type { RadioShowPlacement, RadioShowPlacementId } from './RadioShowPlacement';
7
7
  import type { RadioShowPublishRequests, RadioShowPublishRequestsId } from './RadioShowPublishRequests';
8
+ import type { UserComments, UserCommentsId } from './UserComments';
9
+ import type { UserLikes, UserLikesId } from './UserLikes';
8
10
 
9
11
  export interface RadioShowAttributes {
10
12
  creatorUserId: string;
@@ -85,6 +87,30 @@ export class RadioShow extends Model<RadioShowAttributes, RadioShowCreationAttri
85
87
  hasRadioShowPublishRequest!: Sequelize.HasManyHasAssociationMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
86
88
  hasRadioShowPublishRequests!: Sequelize.HasManyHasAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
87
89
  countRadioShowPublishRequests!: Sequelize.HasManyCountAssociationsMixin;
90
+ // RadioShow hasMany UserComments via radioShowId
91
+ userComments!: UserComments[];
92
+ getUserComments!: Sequelize.HasManyGetAssociationsMixin<UserComments>;
93
+ setUserComments!: Sequelize.HasManySetAssociationsMixin<UserComments, UserCommentsId>;
94
+ addUserComment!: Sequelize.HasManyAddAssociationMixin<UserComments, UserCommentsId>;
95
+ addUserComments!: Sequelize.HasManyAddAssociationsMixin<UserComments, UserCommentsId>;
96
+ createUserComment!: Sequelize.HasManyCreateAssociationMixin<UserComments>;
97
+ removeUserComment!: Sequelize.HasManyRemoveAssociationMixin<UserComments, UserCommentsId>;
98
+ removeUserComments!: Sequelize.HasManyRemoveAssociationsMixin<UserComments, UserCommentsId>;
99
+ hasUserComment!: Sequelize.HasManyHasAssociationMixin<UserComments, UserCommentsId>;
100
+ hasUserComments!: Sequelize.HasManyHasAssociationsMixin<UserComments, UserCommentsId>;
101
+ countUserComments!: Sequelize.HasManyCountAssociationsMixin;
102
+ // RadioShow hasMany UserLikes via radioShowId
103
+ userLikes!: UserLikes[];
104
+ getUserLikes!: Sequelize.HasManyGetAssociationsMixin<UserLikes>;
105
+ setUserLikes!: Sequelize.HasManySetAssociationsMixin<UserLikes, UserLikesId>;
106
+ addUserLike!: Sequelize.HasManyAddAssociationMixin<UserLikes, UserLikesId>;
107
+ addUserLikes!: Sequelize.HasManyAddAssociationsMixin<UserLikes, UserLikesId>;
108
+ createUserLike!: Sequelize.HasManyCreateAssociationMixin<UserLikes>;
109
+ removeUserLike!: Sequelize.HasManyRemoveAssociationMixin<UserLikes, UserLikesId>;
110
+ removeUserLikes!: Sequelize.HasManyRemoveAssociationsMixin<UserLikes, UserLikesId>;
111
+ hasUserLike!: Sequelize.HasManyHasAssociationMixin<UserLikes, UserLikesId>;
112
+ hasUserLikes!: Sequelize.HasManyHasAssociationsMixin<UserLikes, UserLikesId>;
113
+ countUserLikes!: Sequelize.HasManyCountAssociationsMixin;
88
114
 
89
115
  static initModel(sequelize: Sequelize.Sequelize): typeof RadioShow {
90
116
  return RadioShow.init({
@@ -0,0 +1,184 @@
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 { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
6
+ import type { RadioShow, RadioShowId } from './RadioShow';
7
+
8
+ export interface UserCommentsAttributes {
9
+ appUserId: string;
10
+ jukeboxId?: string;
11
+ playlistId?: string;
12
+ radioShowId?: string;
13
+ comment: string;
14
+ id: string;
15
+ replyCommentId?: string;
16
+ deleted: boolean;
17
+ createDate: Date;
18
+ updateDate: Date;
19
+ }
20
+
21
+ export type UserCommentsPk = "id";
22
+ export type UserCommentsId = UserComments[UserCommentsPk];
23
+ export type UserCommentsOptionalAttributes = "jukeboxId" | "playlistId" | "radioShowId" | "id" | "replyCommentId" | "createDate" | "updateDate";
24
+ export type UserCommentsCreationAttributes = Optional<UserCommentsAttributes, UserCommentsOptionalAttributes>;
25
+
26
+ export class UserComments extends Model<UserCommentsAttributes, UserCommentsCreationAttributes> implements UserCommentsAttributes {
27
+ appUserId!: string;
28
+ jukeboxId?: string;
29
+ playlistId?: string;
30
+ radioShowId?: string;
31
+ comment!: string;
32
+ id!: string;
33
+ replyCommentId?: string;
34
+ deleted!: boolean;
35
+ createDate!: Date;
36
+ updateDate!: Date;
37
+
38
+ // UserComments belongsTo AppUser via appUserId
39
+ appUser!: AppUser;
40
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
41
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
42
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
43
+ // UserComments belongsTo JukeboxSession via jukeboxId
44
+ jukebox!: JukeboxSession;
45
+ getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
46
+ setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
47
+ createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
48
+ // UserComments belongsTo PlatformUserPlaylist via playlistId
49
+ playlist!: PlatformUserPlaylist;
50
+ getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
51
+ setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
52
+ createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
53
+ // UserComments belongsTo RadioShow via radioShowId
54
+ radioShow!: RadioShow;
55
+ getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
56
+ setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
57
+ createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
58
+ // UserComments belongsTo UserComments via replyCommentId
59
+ replyComment!: UserComments;
60
+ getReplyComment!: Sequelize.BelongsToGetAssociationMixin<UserComments>;
61
+ setReplyComment!: Sequelize.BelongsToSetAssociationMixin<UserComments, UserCommentsId>;
62
+ createReplyComment!: Sequelize.BelongsToCreateAssociationMixin<UserComments>;
63
+
64
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserComments {
65
+ return UserComments.init({
66
+ appUserId: {
67
+ type: DataTypes.UUID,
68
+ allowNull: false,
69
+ references: {
70
+ model: 'app_user',
71
+ key: 'id'
72
+ },
73
+ field: 'app_user_id'
74
+ },
75
+ jukeboxId: {
76
+ type: DataTypes.UUID,
77
+ allowNull: true,
78
+ references: {
79
+ model: 'jukebox_session',
80
+ key: 'id'
81
+ },
82
+ field: 'jukebox_id'
83
+ },
84
+ playlistId: {
85
+ type: DataTypes.UUID,
86
+ allowNull: true,
87
+ references: {
88
+ model: 'platform_user_playlist',
89
+ key: 'id'
90
+ },
91
+ field: 'playlist_id'
92
+ },
93
+ radioShowId: {
94
+ type: DataTypes.UUID,
95
+ allowNull: true,
96
+ references: {
97
+ model: 'radio_show',
98
+ key: 'id'
99
+ },
100
+ field: 'radio_show_id'
101
+ },
102
+ comment: {
103
+ type: DataTypes.STRING(1000),
104
+ allowNull: false
105
+ },
106
+ id: {
107
+ type: DataTypes.UUID,
108
+ allowNull: false,
109
+ defaultValue: DataTypes.UUIDV4,
110
+ primaryKey: true
111
+ },
112
+ replyCommentId: {
113
+ type: DataTypes.UUID,
114
+ allowNull: true,
115
+ references: {
116
+ model: 'user_comments',
117
+ key: 'id'
118
+ },
119
+ field: 'reply_comment_id'
120
+ },
121
+ deleted: {
122
+ type: DataTypes.BOOLEAN,
123
+ allowNull: false,
124
+ defaultValue: false
125
+ },
126
+ createDate: {
127
+ type: DataTypes.DATE,
128
+ allowNull: false,
129
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
130
+ field: 'create_date'
131
+ },
132
+ updateDate: {
133
+ type: DataTypes.DATE,
134
+ allowNull: false,
135
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
136
+ field: 'update_date'
137
+ }
138
+ }, {
139
+ sequelize,
140
+ tableName: 'user_comments',
141
+ schema: 'eb',
142
+ timestamps: false,
143
+ indexes: [
144
+ {
145
+ name: "idx_user_comments_jukebox",
146
+ fields: [
147
+ { name: "jukebox_id" },
148
+ ]
149
+ },
150
+ {
151
+ name: "idx_user_comments_playlist",
152
+ fields: [
153
+ { name: "playlist_id" },
154
+ ]
155
+ },
156
+ {
157
+ name: "idx_user_comments_radio_show",
158
+ fields: [
159
+ { name: "radio_show_id" },
160
+ ]
161
+ },
162
+ {
163
+ name: "idx_user_comments_reply",
164
+ fields: [
165
+ { name: "reply_comment_id" },
166
+ ]
167
+ },
168
+ {
169
+ name: "idx_user_comments_user",
170
+ fields: [
171
+ { name: "app_user_id" },
172
+ ]
173
+ },
174
+ {
175
+ name: "user_comments_pkey",
176
+ unique: true,
177
+ fields: [
178
+ { name: "id" },
179
+ ]
180
+ },
181
+ ]
182
+ });
183
+ }
184
+ }
@@ -0,0 +1,173 @@
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 { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
6
+ import type { RadioShow, RadioShowId } from './RadioShow';
7
+
8
+ export interface UserLikesAttributes {
9
+ appUserId: string;
10
+ jukeboxId?: string;
11
+ playlistId?: string;
12
+ radioShowId?: string;
13
+ id: string;
14
+ createDate: Date;
15
+ updateDate: Date;
16
+ }
17
+
18
+ export type UserLikesPk = "id";
19
+ export type UserLikesId = UserLikes[UserLikesPk];
20
+ export type UserLikesOptionalAttributes = "jukeboxId" | "playlistId" | "radioShowId" | "id" | "createDate" | "updateDate";
21
+ export type UserLikesCreationAttributes = Optional<UserLikesAttributes, UserLikesOptionalAttributes>;
22
+
23
+ export class UserLikes extends Model<UserLikesAttributes, UserLikesCreationAttributes> implements UserLikesAttributes {
24
+ appUserId!: string;
25
+ jukeboxId?: string;
26
+ playlistId?: string;
27
+ radioShowId?: string;
28
+ id!: string;
29
+ createDate!: Date;
30
+ updateDate!: Date;
31
+
32
+ // UserLikes belongsTo AppUser via appUserId
33
+ appUser!: AppUser;
34
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
35
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
36
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
37
+ // UserLikes belongsTo JukeboxSession via jukeboxId
38
+ jukebox!: JukeboxSession;
39
+ getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
40
+ setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
41
+ createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
42
+ // UserLikes belongsTo PlatformUserPlaylist via playlistId
43
+ playlist!: PlatformUserPlaylist;
44
+ getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
45
+ setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
46
+ createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
47
+ // UserLikes belongsTo RadioShow via radioShowId
48
+ radioShow!: RadioShow;
49
+ getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
50
+ setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
51
+ createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
52
+
53
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserLikes {
54
+ return UserLikes.init({
55
+ appUserId: {
56
+ type: DataTypes.UUID,
57
+ allowNull: false,
58
+ references: {
59
+ model: 'app_user',
60
+ key: 'id'
61
+ },
62
+ field: 'app_user_id'
63
+ },
64
+ jukeboxId: {
65
+ type: DataTypes.UUID,
66
+ allowNull: true,
67
+ references: {
68
+ model: 'jukebox_session',
69
+ key: 'id'
70
+ },
71
+ field: 'jukebox_id'
72
+ },
73
+ playlistId: {
74
+ type: DataTypes.UUID,
75
+ allowNull: true,
76
+ references: {
77
+ model: 'platform_user_playlist',
78
+ key: 'id'
79
+ },
80
+ field: 'playlist_id'
81
+ },
82
+ radioShowId: {
83
+ type: DataTypes.UUID,
84
+ allowNull: true,
85
+ references: {
86
+ model: 'radio_show',
87
+ key: 'id'
88
+ },
89
+ field: 'radio_show_id'
90
+ },
91
+ id: {
92
+ type: DataTypes.UUID,
93
+ allowNull: false,
94
+ defaultValue: DataTypes.UUIDV4,
95
+ primaryKey: true
96
+ },
97
+ createDate: {
98
+ type: DataTypes.DATE,
99
+ allowNull: false,
100
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
101
+ field: 'create_date'
102
+ },
103
+ updateDate: {
104
+ type: DataTypes.DATE,
105
+ allowNull: false,
106
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
107
+ field: 'update_date'
108
+ }
109
+ }, {
110
+ sequelize,
111
+ tableName: 'user_likes',
112
+ schema: 'eb',
113
+ timestamps: false,
114
+ indexes: [
115
+ {
116
+ name: "idx_user_likes_jukebox",
117
+ fields: [
118
+ { name: "jukebox_id" },
119
+ ]
120
+ },
121
+ {
122
+ name: "idx_user_likes_playlist",
123
+ fields: [
124
+ { name: "playlist_id" },
125
+ ]
126
+ },
127
+ {
128
+ name: "idx_user_likes_radio_show",
129
+ fields: [
130
+ { name: "radio_show_id" },
131
+ ]
132
+ },
133
+ {
134
+ name: "idx_user_likes_user",
135
+ fields: [
136
+ { name: "app_user_id" },
137
+ ]
138
+ },
139
+ {
140
+ name: "uq_user_likes_user_jukebox",
141
+ unique: true,
142
+ fields: [
143
+ { name: "app_user_id" },
144
+ { name: "jukebox_id" },
145
+ ]
146
+ },
147
+ {
148
+ name: "uq_user_likes_user_playlist",
149
+ unique: true,
150
+ fields: [
151
+ { name: "app_user_id" },
152
+ { name: "playlist_id" },
153
+ ]
154
+ },
155
+ {
156
+ name: "uq_user_likes_user_radio_show",
157
+ unique: true,
158
+ fields: [
159
+ { name: "app_user_id" },
160
+ { name: "radio_show_id" },
161
+ ]
162
+ },
163
+ {
164
+ name: "user_likes_pkey",
165
+ unique: true,
166
+ fields: [
167
+ { name: "id" },
168
+ ]
169
+ },
170
+ ]
171
+ });
172
+ }
173
+ }