@earbug/db-models 0.0.6 → 0.0.8
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 +5 -5
- package/dist/AppUser.js +13 -13
- package/dist/AppUserDevice.d.ts +4 -4
- package/dist/AppUserDevice.js +8 -8
- package/dist/AppUserFollowRelation.d.ts +3 -3
- package/dist/AppUserFollowRelation.js +6 -6
- package/dist/AppUserPlatformRelation.d.ts +7 -7
- package/dist/AppUserPlatformRelation.js +18 -18
- package/dist/CanonAlbum.d.ts +29 -5
- package/dist/CanonAlbum.js +10 -10
- package/dist/CanonAlbumImageHarvested.d.ts +9 -9
- package/dist/CanonAlbumImageHarvested.js +24 -32
- package/dist/CanonAlbumTrackRelation.d.ts +10 -10
- package/dist/CanonAlbumTrackRelation.js +2 -2
- package/dist/CanonArtist.d.ts +14 -14
- package/dist/CanonArtist.js +6 -6
- package/dist/CanonArtistImageHarvested.d.ts +9 -9
- package/dist/CanonArtistImageHarvested.js +24 -24
- package/dist/CanonGenre.d.ts +3 -3
- package/dist/CanonGenre.js +6 -6
- package/dist/CanonLabel.d.ts +2 -2
- package/dist/CanonLabel.js +6 -6
- package/dist/CanonMember.d.ts +3 -3
- package/dist/CanonMember.js +6 -6
- package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
- package/dist/CanonMemberExternalReferenceRelation.js +5 -5
- package/dist/CanonTrack.d.ts +29 -5
- package/dist/CanonTrack.js +11 -11
- package/dist/ConfigParam.d.ts +2 -2
- package/dist/ConfigParam.js +5 -5
- package/dist/ExternalReference.d.ts +2 -2
- package/dist/ExternalReference.js +5 -5
- package/dist/JukeboxAccessType.d.ts +2 -2
- package/dist/JukeboxAccessType.js +4 -4
- package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
- package/dist/JukeboxCanonGenreRelation.js +6 -6
- package/dist/JukeboxInvite.d.ts +3 -3
- package/dist/JukeboxInvite.js +6 -6
- package/dist/JukeboxQueueEntry.d.ts +10 -10
- package/dist/JukeboxQueueEntry.js +12 -12
- package/dist/JukeboxQueueMode.d.ts +2 -2
- package/dist/JukeboxQueueMode.js +4 -4
- package/dist/JukeboxSession.d.ts +9 -9
- package/dist/JukeboxSession.js +20 -20
- package/dist/JukeboxTerminationCondition.d.ts +2 -2
- package/dist/JukeboxTerminationCondition.js +4 -4
- package/dist/JukeboxType.d.ts +2 -2
- package/dist/JukeboxType.js +4 -4
- package/dist/JukeboxUser.d.ts +7 -7
- package/dist/JukeboxUser.js +20 -20
- package/dist/KnexMigrations.d.ts +3 -3
- package/dist/KnexMigrations.js +6 -6
- package/dist/KnexMigrationsLock.d.ts +3 -3
- package/dist/KnexMigrationsLock.js +5 -5
- package/dist/MetricsDaily.d.ts +3 -3
- package/dist/MetricsDaily.js +4 -4
- package/dist/MetricsEvent.d.ts +5 -1
- package/dist/MetricsEvent.js +6 -0
- package/dist/NewsSite.d.ts +3 -3
- package/dist/NewsSite.js +6 -6
- package/dist/Platform.d.ts +2 -2
- package/dist/Platform.js +7 -7
- package/dist/PlatformAlbum.d.ts +5 -28
- package/dist/PlatformAlbum.js +10 -10
- package/dist/PlatformArtist.d.ts +5 -5
- package/dist/PlatformArtist.js +10 -10
- package/dist/PlatformGenre.d.ts +2 -2
- package/dist/PlatformGenre.js +6 -6
- package/dist/PlatformTrack.d.ts +3 -26
- package/dist/PlatformTrack.js +6 -6
- package/dist/PlatformUserAlbum.d.ts +2 -2
- package/dist/PlatformUserAlbum.js +6 -6
- package/dist/PlatformUserAlbumTrack.d.ts +4 -4
- package/dist/PlatformUserAlbumTrack.js +11 -11
- package/dist/PlatformUserPlaylist.d.ts +5 -5
- package/dist/PlatformUserPlaylist.js +11 -11
- package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
- package/dist/PlatformUserPlaylistTrack.js +17 -17
- package/dist/PlaybackStatus.d.ts +2 -14
- package/dist/PlaybackStatus.js +4 -4
- package/dist/PlaybackStatusType.d.ts +12 -0
- package/dist/State.d.ts +2 -2
- package/dist/State.js +4 -4
- package/dist/UnmatchedAlbum.d.ts +2 -2
- package/dist/UnmatchedAlbum.js +6 -6
- package/dist/UnmatchedArtist.d.ts +2 -2
- package/dist/UnmatchedArtist.js +6 -6
- package/dist/UserContacts.d.ts +3 -3
- package/dist/UserContacts.js +7 -7
- package/dist/init-models.js +9 -9
- package/models/AppUser.ts +18 -18
- package/models/AppUserDevice.ts +12 -12
- package/models/AppUserFollowRelation.ts +9 -9
- package/models/AppUserPlatformRelation.ts +25 -25
- package/models/CanonAlbum.ts +41 -15
- package/models/CanonAlbumImageHarvested.ts +33 -41
- package/models/CanonAlbumTrackRelation.ts +14 -14
- package/models/CanonArtist.ts +20 -20
- package/models/CanonArtistImageHarvested.ts +33 -33
- package/models/CanonGenre.ts +9 -9
- package/models/CanonLabel.ts +8 -8
- package/models/CanonMember.ts +9 -9
- package/models/CanonMemberExternalReferenceRelation.ts +7 -7
- package/models/CanonTrack.ts +42 -16
- package/models/ConfigParam.ts +7 -7
- package/models/ExternalReference.ts +7 -7
- package/models/JukeboxAccessType.ts +6 -6
- package/models/JukeboxCanonGenreRelation.ts +8 -8
- package/models/JukeboxInvite.ts +9 -9
- package/models/JukeboxQueueEntry.ts +23 -23
- package/models/JukeboxQueueMode.ts +6 -6
- package/models/JukeboxSession.ts +29 -29
- package/models/JukeboxTerminationCondition.ts +6 -6
- package/models/JukeboxType.ts +6 -6
- package/models/JukeboxUser.ts +27 -27
- package/models/KnexMigrations.ts +9 -9
- package/models/KnexMigrationsLock.ts +8 -8
- package/models/MetricsDaily.ts +7 -7
- package/models/MetricsEvent.ts +11 -1
- package/models/NewsSite.ts +9 -9
- package/models/Platform.ts +9 -9
- package/models/PlatformAlbum.ts +15 -40
- package/models/PlatformArtist.ts +15 -15
- package/models/PlatformGenre.ts +8 -8
- package/models/PlatformTrack.ts +9 -34
- package/models/PlatformUserAlbum.ts +8 -8
- package/models/PlatformUserAlbumTrack.ts +15 -15
- package/models/PlatformUserPlaylist.ts +16 -16
- package/models/PlatformUserPlaylistTrack.ts +24 -24
- package/models/PlaybackStatus.ts +6 -19
- package/models/PlaybackStatusType.ts +13 -0
- package/models/State.ts +6 -6
- package/models/UnmatchedAlbum.ts +8 -8
- package/models/UnmatchedArtist.ts +8 -8
- package/models/UserContacts.ts +10 -10
- package/models/init-models.ts +9 -9
- package/package.json +1 -1
package/models/Platform.ts
CHANGED
|
@@ -11,10 +11,10 @@ import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUse
|
|
|
11
11
|
import type { UnmatchedArtist, UnmatchedArtistId } from './UnmatchedArtist';
|
|
12
12
|
|
|
13
13
|
export interface PlatformAttributes {
|
|
14
|
-
id: number;
|
|
15
14
|
name: string;
|
|
16
15
|
createDate: Date;
|
|
17
16
|
updateDate: Date;
|
|
17
|
+
id: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type PlatformPk = "id";
|
|
@@ -23,10 +23,10 @@ export type PlatformOptionalAttributes = "createDate" | "updateDate";
|
|
|
23
23
|
export type PlatformCreationAttributes = Optional<PlatformAttributes, PlatformOptionalAttributes>;
|
|
24
24
|
|
|
25
25
|
export class Platform extends Model<PlatformAttributes, PlatformCreationAttributes> implements PlatformAttributes {
|
|
26
|
-
id!: number;
|
|
27
26
|
name!: string;
|
|
28
27
|
createDate!: Date;
|
|
29
28
|
updateDate!: Date;
|
|
29
|
+
id!: number;
|
|
30
30
|
|
|
31
31
|
// Platform hasMany AppUserPlatformRelation via platformId
|
|
32
32
|
appUserPlatformRelations!: AppUserPlatformRelation[];
|
|
@@ -139,13 +139,6 @@ export class Platform extends Model<PlatformAttributes, PlatformCreationAttribut
|
|
|
139
139
|
|
|
140
140
|
static initModel(sequelize: Sequelize.Sequelize): typeof Platform {
|
|
141
141
|
return Platform.init({
|
|
142
|
-
id: {
|
|
143
|
-
autoIncrement: true,
|
|
144
|
-
autoIncrementIdentity: true,
|
|
145
|
-
type: DataTypes.SMALLINT,
|
|
146
|
-
allowNull: false,
|
|
147
|
-
primaryKey: true
|
|
148
|
-
},
|
|
149
142
|
name: {
|
|
150
143
|
type: DataTypes.TEXT,
|
|
151
144
|
allowNull: false,
|
|
@@ -162,6 +155,13 @@ export class Platform extends Model<PlatformAttributes, PlatformCreationAttribut
|
|
|
162
155
|
allowNull: false,
|
|
163
156
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
164
157
|
field: 'update_date'
|
|
158
|
+
},
|
|
159
|
+
id: {
|
|
160
|
+
autoIncrement: true,
|
|
161
|
+
autoIncrementIdentity: true,
|
|
162
|
+
type: DataTypes.SMALLINT,
|
|
163
|
+
allowNull: false,
|
|
164
|
+
primaryKey: true
|
|
165
165
|
}
|
|
166
166
|
}, {
|
|
167
167
|
sequelize,
|
package/models/PlatformAlbum.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { DataTypes, Model, Optional } from 'sequelize';
|
|
|
3
3
|
import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
|
|
4
4
|
import type { CanonAlbumGenreRelation, CanonAlbumGenreRelationId } from './CanonAlbumGenreRelation';
|
|
5
5
|
import type { CanonAlbumLabelRelation, CanonAlbumLabelRelationId } from './CanonAlbumLabelRelation';
|
|
6
|
-
import type { CanonAlbumTrackRelation, CanonAlbumTrackRelationId } from './CanonAlbumTrackRelation';
|
|
7
6
|
import type { CanonArtist, CanonArtistId } from './CanonArtist';
|
|
8
7
|
import type { CanonArtistAlbumRelation, CanonArtistAlbumRelationId } from './CanonArtistAlbumRelation';
|
|
9
8
|
import type { CanonGenre, CanonGenreId } from './CanonGenre';
|
|
@@ -20,7 +19,6 @@ import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum
|
|
|
20
19
|
import type { UnmatchedAlbum, UnmatchedAlbumId } from './UnmatchedAlbum';
|
|
21
20
|
|
|
22
21
|
export interface PlatformAlbumAttributes {
|
|
23
|
-
id: string;
|
|
24
22
|
platformId: number;
|
|
25
23
|
externalAlbumId: string;
|
|
26
24
|
name: string;
|
|
@@ -29,20 +27,20 @@ export interface PlatformAlbumAttributes {
|
|
|
29
27
|
releaseDate?: string;
|
|
30
28
|
popularity?: number;
|
|
31
29
|
recordLabel?: string;
|
|
30
|
+
images?: object;
|
|
31
|
+
id: string;
|
|
32
32
|
createDate: Date;
|
|
33
33
|
updateDate: Date;
|
|
34
|
-
images?: object;
|
|
35
34
|
lastHarvestDate?: Date;
|
|
36
35
|
lastHarvestLog?: string;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
export type PlatformAlbumPk = "id";
|
|
40
39
|
export type PlatformAlbumId = PlatformAlbum[PlatformAlbumPk];
|
|
41
|
-
export type PlatformAlbumOptionalAttributes = "
|
|
40
|
+
export type PlatformAlbumOptionalAttributes = "albumType" | "releaseDate" | "popularity" | "recordLabel" | "images" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
|
|
42
41
|
export type PlatformAlbumCreationAttributes = Optional<PlatformAlbumAttributes, PlatformAlbumOptionalAttributes>;
|
|
43
42
|
|
|
44
43
|
export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumCreationAttributes> implements PlatformAlbumAttributes {
|
|
45
|
-
id!: string;
|
|
46
44
|
platformId!: number;
|
|
47
45
|
externalAlbumId!: string;
|
|
48
46
|
name!: string;
|
|
@@ -51,9 +49,10 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
51
49
|
releaseDate?: string;
|
|
52
50
|
popularity?: number;
|
|
53
51
|
recordLabel?: string;
|
|
52
|
+
images?: object;
|
|
53
|
+
id!: string;
|
|
54
54
|
createDate!: Date;
|
|
55
55
|
updateDate!: Date;
|
|
56
|
-
images?: object;
|
|
57
56
|
lastHarvestDate?: Date;
|
|
58
57
|
lastHarvestLog?: string;
|
|
59
58
|
|
|
@@ -98,18 +97,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
98
97
|
hasCanonAlbumLabelRelation!: Sequelize.HasManyHasAssociationMixin<CanonAlbumLabelRelation, CanonAlbumLabelRelationId>;
|
|
99
98
|
hasCanonAlbumLabelRelations!: Sequelize.HasManyHasAssociationsMixin<CanonAlbumLabelRelation, CanonAlbumLabelRelationId>;
|
|
100
99
|
countCanonAlbumLabelRelations!: Sequelize.HasManyCountAssociationsMixin;
|
|
101
|
-
// PlatformAlbum hasMany CanonAlbumTrackRelation via canonAlbumId
|
|
102
|
-
canonAlbumTrackRelations!: CanonAlbumTrackRelation[];
|
|
103
|
-
getCanonAlbumTrackRelations!: Sequelize.HasManyGetAssociationsMixin<CanonAlbumTrackRelation>;
|
|
104
|
-
setCanonAlbumTrackRelations!: Sequelize.HasManySetAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
105
|
-
addCanonAlbumTrackRelation!: Sequelize.HasManyAddAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
106
|
-
addCanonAlbumTrackRelations!: Sequelize.HasManyAddAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
107
|
-
createCanonAlbumTrackRelation!: Sequelize.HasManyCreateAssociationMixin<CanonAlbumTrackRelation>;
|
|
108
|
-
removeCanonAlbumTrackRelation!: Sequelize.HasManyRemoveAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
109
|
-
removeCanonAlbumTrackRelations!: Sequelize.HasManyRemoveAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
110
|
-
hasCanonAlbumTrackRelation!: Sequelize.HasManyHasAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
111
|
-
hasCanonAlbumTrackRelations!: Sequelize.HasManyHasAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
112
|
-
countCanonAlbumTrackRelations!: Sequelize.HasManyCountAssociationsMixin;
|
|
113
100
|
// PlatformAlbum belongsToMany CanonArtist via canonAlbumId and canonArtistId
|
|
114
101
|
canonArtistIdCanonArtists!: CanonArtist[];
|
|
115
102
|
getCanonArtistIdCanonArtists!: Sequelize.BelongsToManyGetAssociationsMixin<CanonArtist>;
|
|
@@ -230,18 +217,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
230
217
|
hasPlatformGenreIdPlatformGenrePlatformAlbumGenreRelation!: Sequelize.BelongsToManyHasAssociationMixin<PlatformGenre, PlatformGenreId>;
|
|
231
218
|
hasPlatformGenreIdPlatformGenrePlatformAlbumGenreRelations!: Sequelize.BelongsToManyHasAssociationsMixin<PlatformGenre, PlatformGenreId>;
|
|
232
219
|
countPlatformGenreIdPlatformGenrePlatformAlbumGenreRelations!: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
233
|
-
// PlatformAlbum belongsToMany PlatformTrack via canonAlbumId and canonTrackId
|
|
234
|
-
canonTrackIdPlatformTracks!: PlatformTrack[];
|
|
235
|
-
getCanonTrackIdPlatformTracks!: Sequelize.BelongsToManyGetAssociationsMixin<PlatformTrack>;
|
|
236
|
-
setCanonTrackIdPlatformTracks!: Sequelize.BelongsToManySetAssociationsMixin<PlatformTrack, PlatformTrackId>;
|
|
237
|
-
addCanonTrackIdPlatformTrack!: Sequelize.BelongsToManyAddAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
238
|
-
addCanonTrackIdPlatformTracks!: Sequelize.BelongsToManyAddAssociationsMixin<PlatformTrack, PlatformTrackId>;
|
|
239
|
-
createCanonTrackIdPlatformTrack!: Sequelize.BelongsToManyCreateAssociationMixin<PlatformTrack>;
|
|
240
|
-
removeCanonTrackIdPlatformTrack!: Sequelize.BelongsToManyRemoveAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
241
|
-
removeCanonTrackIdPlatformTracks!: Sequelize.BelongsToManyRemoveAssociationsMixin<PlatformTrack, PlatformTrackId>;
|
|
242
|
-
hasCanonTrackIdPlatformTrack!: Sequelize.BelongsToManyHasAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
243
|
-
hasCanonTrackIdPlatformTracks!: Sequelize.BelongsToManyHasAssociationsMixin<PlatformTrack, PlatformTrackId>;
|
|
244
|
-
countCanonTrackIdPlatformTracks!: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
245
220
|
// PlatformAlbum belongsToMany PlatformTrack via platformAlbumId and platformTrackId
|
|
246
221
|
platformTrackIdPlatformTrackPlatformAlbumTrackRelations!: PlatformTrack[];
|
|
247
222
|
getPlatformTrackIdPlatformTrackPlatformAlbumTrackRelations!: Sequelize.BelongsToManyGetAssociationsMixin<PlatformTrack>;
|
|
@@ -281,12 +256,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
281
256
|
|
|
282
257
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformAlbum {
|
|
283
258
|
return PlatformAlbum.init({
|
|
284
|
-
id: {
|
|
285
|
-
type: DataTypes.UUID,
|
|
286
|
-
allowNull: false,
|
|
287
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
288
|
-
primaryKey: true
|
|
289
|
-
},
|
|
290
259
|
platformId: {
|
|
291
260
|
type: DataTypes.SMALLINT,
|
|
292
261
|
allowNull: false,
|
|
@@ -331,6 +300,16 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
331
300
|
allowNull: true,
|
|
332
301
|
field: 'record_label'
|
|
333
302
|
},
|
|
303
|
+
images: {
|
|
304
|
+
type: DataTypes.JSONB,
|
|
305
|
+
allowNull: true
|
|
306
|
+
},
|
|
307
|
+
id: {
|
|
308
|
+
type: DataTypes.UUID,
|
|
309
|
+
allowNull: false,
|
|
310
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
311
|
+
primaryKey: true
|
|
312
|
+
},
|
|
334
313
|
createDate: {
|
|
335
314
|
type: DataTypes.DATE,
|
|
336
315
|
allowNull: false,
|
|
@@ -343,10 +322,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
343
322
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
344
323
|
field: 'update_date'
|
|
345
324
|
},
|
|
346
|
-
images: {
|
|
347
|
-
type: DataTypes.JSONB,
|
|
348
|
-
allowNull: true
|
|
349
|
-
},
|
|
350
325
|
lastHarvestDate: {
|
|
351
326
|
type: DataTypes.DATE,
|
|
352
327
|
allowNull: true,
|
package/models/PlatformArtist.ts
CHANGED
|
@@ -17,15 +17,15 @@ import type { PlatformGenre, PlatformGenreId } from './PlatformGenre';
|
|
|
17
17
|
import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
18
18
|
|
|
19
19
|
export interface PlatformArtistAttributes {
|
|
20
|
-
id: string;
|
|
21
20
|
externalArtistId: string;
|
|
22
21
|
platformId: number;
|
|
23
22
|
name: string;
|
|
24
23
|
asciiName: string;
|
|
25
24
|
externalUri?: string;
|
|
25
|
+
genres?: string[];
|
|
26
|
+
id: string;
|
|
26
27
|
createDate: Date;
|
|
27
28
|
updateDate: Date;
|
|
28
|
-
genres?: string[];
|
|
29
29
|
lastHarvestDate?: Date;
|
|
30
30
|
lastHarvestLog?: string;
|
|
31
31
|
images?: object;
|
|
@@ -33,19 +33,19 @@ export interface PlatformArtistAttributes {
|
|
|
33
33
|
|
|
34
34
|
export type PlatformArtistPk = "id";
|
|
35
35
|
export type PlatformArtistId = PlatformArtist[PlatformArtistPk];
|
|
36
|
-
export type PlatformArtistOptionalAttributes = "
|
|
36
|
+
export type PlatformArtistOptionalAttributes = "externalUri" | "genres" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog" | "images";
|
|
37
37
|
export type PlatformArtistCreationAttributes = Optional<PlatformArtistAttributes, PlatformArtistOptionalAttributes>;
|
|
38
38
|
|
|
39
39
|
export class PlatformArtist extends Model<PlatformArtistAttributes, PlatformArtistCreationAttributes> implements PlatformArtistAttributes {
|
|
40
|
-
id!: string;
|
|
41
40
|
externalArtistId!: string;
|
|
42
41
|
platformId!: number;
|
|
43
42
|
name!: string;
|
|
44
43
|
asciiName!: string;
|
|
45
44
|
externalUri?: string;
|
|
45
|
+
genres?: string[];
|
|
46
|
+
id!: string;
|
|
46
47
|
createDate!: Date;
|
|
47
48
|
updateDate!: Date;
|
|
48
|
-
genres?: string[];
|
|
49
49
|
lastHarvestDate?: Date;
|
|
50
50
|
lastHarvestLog?: string;
|
|
51
51
|
images?: object;
|
|
@@ -226,12 +226,6 @@ export class PlatformArtist extends Model<PlatformArtistAttributes, PlatformArti
|
|
|
226
226
|
|
|
227
227
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformArtist {
|
|
228
228
|
return PlatformArtist.init({
|
|
229
|
-
id: {
|
|
230
|
-
type: DataTypes.UUID,
|
|
231
|
-
allowNull: false,
|
|
232
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
233
|
-
primaryKey: true
|
|
234
|
-
},
|
|
235
229
|
externalArtistId: {
|
|
236
230
|
type: DataTypes.TEXT,
|
|
237
231
|
allowNull: false,
|
|
@@ -262,6 +256,16 @@ export class PlatformArtist extends Model<PlatformArtistAttributes, PlatformArti
|
|
|
262
256
|
allowNull: true,
|
|
263
257
|
field: 'external_uri'
|
|
264
258
|
},
|
|
259
|
+
genres: {
|
|
260
|
+
type: DataTypes.ARRAY(DataTypes.TEXT),
|
|
261
|
+
allowNull: true
|
|
262
|
+
},
|
|
263
|
+
id: {
|
|
264
|
+
type: DataTypes.UUID,
|
|
265
|
+
allowNull: false,
|
|
266
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
267
|
+
primaryKey: true
|
|
268
|
+
},
|
|
265
269
|
createDate: {
|
|
266
270
|
type: DataTypes.DATE,
|
|
267
271
|
allowNull: false,
|
|
@@ -274,10 +278,6 @@ export class PlatformArtist extends Model<PlatformArtistAttributes, PlatformArti
|
|
|
274
278
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
275
279
|
field: 'update_date'
|
|
276
280
|
},
|
|
277
|
-
genres: {
|
|
278
|
-
type: DataTypes.ARRAY(DataTypes.TEXT),
|
|
279
|
-
allowNull: true
|
|
280
|
-
},
|
|
281
281
|
lastHarvestDate: {
|
|
282
282
|
type: DataTypes.DATE,
|
|
283
283
|
allowNull: true,
|
package/models/PlatformGenre.ts
CHANGED
|
@@ -11,9 +11,9 @@ import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
|
11
11
|
import type { PlatformTrackGenreRelation, PlatformTrackGenreRelationId } from './PlatformTrackGenreRelation';
|
|
12
12
|
|
|
13
13
|
export interface PlatformGenreAttributes {
|
|
14
|
-
id: string;
|
|
15
14
|
platformId: number;
|
|
16
15
|
name: string;
|
|
16
|
+
id: string;
|
|
17
17
|
createDate: Date;
|
|
18
18
|
updateDate: Date;
|
|
19
19
|
}
|
|
@@ -24,9 +24,9 @@ export type PlatformGenreOptionalAttributes = "id" | "createDate" | "updateDate"
|
|
|
24
24
|
export type PlatformGenreCreationAttributes = Optional<PlatformGenreAttributes, PlatformGenreOptionalAttributes>;
|
|
25
25
|
|
|
26
26
|
export class PlatformGenre extends Model<PlatformGenreAttributes, PlatformGenreCreationAttributes> implements PlatformGenreAttributes {
|
|
27
|
-
id!: string;
|
|
28
27
|
platformId!: number;
|
|
29
28
|
name!: string;
|
|
29
|
+
id!: string;
|
|
30
30
|
createDate!: Date;
|
|
31
31
|
updateDate!: Date;
|
|
32
32
|
|
|
@@ -134,12 +134,6 @@ export class PlatformGenre extends Model<PlatformGenreAttributes, PlatformGenreC
|
|
|
134
134
|
|
|
135
135
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformGenre {
|
|
136
136
|
return PlatformGenre.init({
|
|
137
|
-
id: {
|
|
138
|
-
type: DataTypes.UUID,
|
|
139
|
-
allowNull: false,
|
|
140
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
141
|
-
primaryKey: true
|
|
142
|
-
},
|
|
143
137
|
platformId: {
|
|
144
138
|
type: DataTypes.SMALLINT,
|
|
145
139
|
allowNull: false,
|
|
@@ -155,6 +149,12 @@ export class PlatformGenre extends Model<PlatformGenreAttributes, PlatformGenreC
|
|
|
155
149
|
allowNull: false,
|
|
156
150
|
unique: "platform_genre_name_pkey"
|
|
157
151
|
},
|
|
152
|
+
id: {
|
|
153
|
+
type: DataTypes.UUID,
|
|
154
|
+
allowNull: false,
|
|
155
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
156
|
+
primaryKey: true
|
|
157
|
+
},
|
|
158
158
|
createDate: {
|
|
159
159
|
type: DataTypes.DATE,
|
|
160
160
|
allowNull: false,
|
package/models/PlatformTrack.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { CanonAlbumTrackRelation, CanonAlbumTrackRelationId } from './CanonAlbumTrackRelation';
|
|
4
3
|
import type { CanonToPlatformTrackRelation, CanonToPlatformTrackRelationId } from './CanonToPlatformTrackRelation';
|
|
5
4
|
import type { CanonTrack, CanonTrackId } from './CanonTrack';
|
|
6
5
|
import type { Platform, PlatformId } from './Platform';
|
|
@@ -14,7 +13,6 @@ import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './Platfor
|
|
|
14
13
|
import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
|
|
15
14
|
|
|
16
15
|
export interface PlatformTrackAttributes {
|
|
17
|
-
id: string;
|
|
18
16
|
platformId: number;
|
|
19
17
|
externalTrackId: string;
|
|
20
18
|
name: string;
|
|
@@ -24,6 +22,7 @@ export interface PlatformTrackAttributes {
|
|
|
24
22
|
popularity?: number;
|
|
25
23
|
discNumber?: number;
|
|
26
24
|
discTrackNumber?: number;
|
|
25
|
+
id: string;
|
|
27
26
|
createDate: Date;
|
|
28
27
|
updateDate: Date;
|
|
29
28
|
lastHarvestDate?: Date;
|
|
@@ -32,11 +31,10 @@ export interface PlatformTrackAttributes {
|
|
|
32
31
|
|
|
33
32
|
export type PlatformTrackPk = "id";
|
|
34
33
|
export type PlatformTrackId = PlatformTrack[PlatformTrackPk];
|
|
35
|
-
export type PlatformTrackOptionalAttributes = "
|
|
34
|
+
export type PlatformTrackOptionalAttributes = "explicit" | "popularity" | "discNumber" | "discTrackNumber" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
|
|
36
35
|
export type PlatformTrackCreationAttributes = Optional<PlatformTrackAttributes, PlatformTrackOptionalAttributes>;
|
|
37
36
|
|
|
38
37
|
export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackCreationAttributes> implements PlatformTrackAttributes {
|
|
39
|
-
id!: string;
|
|
40
38
|
platformId!: number;
|
|
41
39
|
externalTrackId!: string;
|
|
42
40
|
name!: string;
|
|
@@ -46,6 +44,7 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
46
44
|
popularity?: number;
|
|
47
45
|
discNumber?: number;
|
|
48
46
|
discTrackNumber?: number;
|
|
47
|
+
id!: string;
|
|
49
48
|
createDate!: Date;
|
|
50
49
|
updateDate!: Date;
|
|
51
50
|
lastHarvestDate?: Date;
|
|
@@ -56,18 +55,6 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
56
55
|
getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
|
|
57
56
|
setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
|
|
58
57
|
createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
|
|
59
|
-
// PlatformTrack hasMany CanonAlbumTrackRelation via canonTrackId
|
|
60
|
-
canonAlbumTrackRelations!: CanonAlbumTrackRelation[];
|
|
61
|
-
getCanonAlbumTrackRelations!: Sequelize.HasManyGetAssociationsMixin<CanonAlbumTrackRelation>;
|
|
62
|
-
setCanonAlbumTrackRelations!: Sequelize.HasManySetAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
63
|
-
addCanonAlbumTrackRelation!: Sequelize.HasManyAddAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
64
|
-
addCanonAlbumTrackRelations!: Sequelize.HasManyAddAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
65
|
-
createCanonAlbumTrackRelation!: Sequelize.HasManyCreateAssociationMixin<CanonAlbumTrackRelation>;
|
|
66
|
-
removeCanonAlbumTrackRelation!: Sequelize.HasManyRemoveAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
67
|
-
removeCanonAlbumTrackRelations!: Sequelize.HasManyRemoveAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
68
|
-
hasCanonAlbumTrackRelation!: Sequelize.HasManyHasAssociationMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
69
|
-
hasCanonAlbumTrackRelations!: Sequelize.HasManyHasAssociationsMixin<CanonAlbumTrackRelation, CanonAlbumTrackRelationId>;
|
|
70
|
-
countCanonAlbumTrackRelations!: Sequelize.HasManyCountAssociationsMixin;
|
|
71
58
|
// PlatformTrack hasMany CanonToPlatformTrackRelation via platformTrackId
|
|
72
59
|
canonToPlatformTrackRelations!: CanonToPlatformTrackRelation[];
|
|
73
60
|
getCanonToPlatformTrackRelations!: Sequelize.HasManyGetAssociationsMixin<CanonToPlatformTrackRelation>;
|
|
@@ -92,18 +79,6 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
92
79
|
hasCanonTrackIdCanonTrackCanonToPlatformTrackRelation!: Sequelize.BelongsToManyHasAssociationMixin<CanonTrack, CanonTrackId>;
|
|
93
80
|
hasCanonTrackIdCanonTrackCanonToPlatformTrackRelations!: Sequelize.BelongsToManyHasAssociationsMixin<CanonTrack, CanonTrackId>;
|
|
94
81
|
countCanonTrackIdCanonTrackCanonToPlatformTrackRelations!: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
95
|
-
// PlatformTrack belongsToMany PlatformAlbum via canonTrackId and canonAlbumId
|
|
96
|
-
canonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: PlatformAlbum[];
|
|
97
|
-
getCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManyGetAssociationsMixin<PlatformAlbum>;
|
|
98
|
-
setCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManySetAssociationsMixin<PlatformAlbum, PlatformAlbumId>;
|
|
99
|
-
addCanonAlbumIdPlatformAlbumCanonAlbumTrackRelation!: Sequelize.BelongsToManyAddAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
100
|
-
addCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManyAddAssociationsMixin<PlatformAlbum, PlatformAlbumId>;
|
|
101
|
-
createCanonAlbumIdPlatformAlbumCanonAlbumTrackRelation!: Sequelize.BelongsToManyCreateAssociationMixin<PlatformAlbum>;
|
|
102
|
-
removeCanonAlbumIdPlatformAlbumCanonAlbumTrackRelation!: Sequelize.BelongsToManyRemoveAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
103
|
-
removeCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManyRemoveAssociationsMixin<PlatformAlbum, PlatformAlbumId>;
|
|
104
|
-
hasCanonAlbumIdPlatformAlbumCanonAlbumTrackRelation!: Sequelize.BelongsToManyHasAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
105
|
-
hasCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManyHasAssociationsMixin<PlatformAlbum, PlatformAlbumId>;
|
|
106
|
-
countCanonAlbumIdPlatformAlbumCanonAlbumTrackRelations!: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
107
82
|
// PlatformTrack belongsToMany PlatformAlbum via platformTrackId and platformAlbumId
|
|
108
83
|
platformAlbumIdPlatformAlbumPlatformAlbumTrackRelations!: PlatformAlbum[];
|
|
109
84
|
getPlatformAlbumIdPlatformAlbumPlatformAlbumTrackRelations!: Sequelize.BelongsToManyGetAssociationsMixin<PlatformAlbum>;
|
|
@@ -203,12 +178,6 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
203
178
|
|
|
204
179
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformTrack {
|
|
205
180
|
return PlatformTrack.init({
|
|
206
|
-
id: {
|
|
207
|
-
type: DataTypes.UUID,
|
|
208
|
-
allowNull: false,
|
|
209
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
210
|
-
primaryKey: true
|
|
211
|
-
},
|
|
212
181
|
platformId: {
|
|
213
182
|
type: DataTypes.SMALLINT,
|
|
214
183
|
allowNull: false,
|
|
@@ -257,6 +226,12 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
257
226
|
allowNull: true,
|
|
258
227
|
field: 'disc_track_number'
|
|
259
228
|
},
|
|
229
|
+
id: {
|
|
230
|
+
type: DataTypes.UUID,
|
|
231
|
+
allowNull: false,
|
|
232
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
233
|
+
primaryKey: true
|
|
234
|
+
},
|
|
260
235
|
createDate: {
|
|
261
236
|
type: DataTypes.DATE,
|
|
262
237
|
allowNull: false,
|
|
@@ -6,11 +6,11 @@ import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
|
|
|
6
6
|
import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './PlatformUserAlbumTrack';
|
|
7
7
|
|
|
8
8
|
export interface PlatformUserAlbumAttributes {
|
|
9
|
-
id: string;
|
|
10
9
|
appUserId: string;
|
|
11
10
|
platformId: number;
|
|
12
11
|
externalUserAlbumId: string;
|
|
13
12
|
platformAlbumId: string;
|
|
13
|
+
id: string;
|
|
14
14
|
createdAt: Date;
|
|
15
15
|
updatedAt: Date;
|
|
16
16
|
stateId: number;
|
|
@@ -22,11 +22,11 @@ export type PlatformUserAlbumOptionalAttributes = "id" | "createdAt" | "updatedA
|
|
|
22
22
|
export type PlatformUserAlbumCreationAttributes = Optional<PlatformUserAlbumAttributes, PlatformUserAlbumOptionalAttributes>;
|
|
23
23
|
|
|
24
24
|
export class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, PlatformUserAlbumCreationAttributes> implements PlatformUserAlbumAttributes {
|
|
25
|
-
id!: string;
|
|
26
25
|
appUserId!: string;
|
|
27
26
|
platformId!: number;
|
|
28
27
|
externalUserAlbumId!: string;
|
|
29
28
|
platformAlbumId!: string;
|
|
29
|
+
id!: string;
|
|
30
30
|
createdAt!: Date;
|
|
31
31
|
updatedAt!: Date;
|
|
32
32
|
stateId!: number;
|
|
@@ -61,12 +61,6 @@ export class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, Platfo
|
|
|
61
61
|
|
|
62
62
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbum {
|
|
63
63
|
return PlatformUserAlbum.init({
|
|
64
|
-
id: {
|
|
65
|
-
type: DataTypes.UUID,
|
|
66
|
-
allowNull: false,
|
|
67
|
-
defaultValue: DataTypes.UUIDV4,
|
|
68
|
-
primaryKey: true
|
|
69
|
-
},
|
|
70
64
|
appUserId: {
|
|
71
65
|
type: DataTypes.UUID,
|
|
72
66
|
allowNull: false,
|
|
@@ -101,6 +95,12 @@ export class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, Platfo
|
|
|
101
95
|
unique: "platform_user_album_app_user_id_platform_album_id_unique",
|
|
102
96
|
field: 'platform_album_id'
|
|
103
97
|
},
|
|
98
|
+
id: {
|
|
99
|
+
type: DataTypes.UUID,
|
|
100
|
+
allowNull: false,
|
|
101
|
+
defaultValue: DataTypes.UUIDV4,
|
|
102
|
+
primaryKey: true
|
|
103
|
+
},
|
|
104
104
|
createdAt: {
|
|
105
105
|
type: DataTypes.DATE,
|
|
106
106
|
allowNull: false,
|
|
@@ -5,14 +5,14 @@ import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
|
5
5
|
import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
|
|
6
6
|
|
|
7
7
|
export interface PlatformUserAlbumTrackAttributes {
|
|
8
|
-
id: string;
|
|
9
8
|
platformUserAlbumId: string;
|
|
10
9
|
platformId: number;
|
|
11
10
|
externalUserAlbumTrackId: string;
|
|
12
11
|
platformTrackId: string;
|
|
12
|
+
stateId: number;
|
|
13
|
+
id: string;
|
|
13
14
|
createdAt: Date;
|
|
14
15
|
updatedAt: Date;
|
|
15
|
-
stateId: number;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export type PlatformUserAlbumTrackPk = "id";
|
|
@@ -21,14 +21,14 @@ export type PlatformUserAlbumTrackOptionalAttributes = "id" | "createdAt" | "upd
|
|
|
21
21
|
export type PlatformUserAlbumTrackCreationAttributes = Optional<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackOptionalAttributes>;
|
|
22
22
|
|
|
23
23
|
export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackCreationAttributes> implements PlatformUserAlbumTrackAttributes {
|
|
24
|
-
id!: string;
|
|
25
24
|
platformUserAlbumId!: string;
|
|
26
25
|
platformId!: number;
|
|
27
26
|
externalUserAlbumTrackId!: string;
|
|
28
27
|
platformTrackId!: string;
|
|
28
|
+
stateId!: number;
|
|
29
|
+
id!: string;
|
|
29
30
|
createdAt!: Date;
|
|
30
31
|
updatedAt!: Date;
|
|
31
|
-
stateId!: number;
|
|
32
32
|
|
|
33
33
|
// PlatformUserAlbumTrack belongsTo Platform via platformId
|
|
34
34
|
platform!: Platform;
|
|
@@ -48,12 +48,6 @@ export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttribut
|
|
|
48
48
|
|
|
49
49
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbumTrack {
|
|
50
50
|
return PlatformUserAlbumTrack.init({
|
|
51
|
-
id: {
|
|
52
|
-
type: DataTypes.UUID,
|
|
53
|
-
allowNull: false,
|
|
54
|
-
defaultValue: DataTypes.UUIDV4,
|
|
55
|
-
primaryKey: true
|
|
56
|
-
},
|
|
57
51
|
platformUserAlbumId: {
|
|
58
52
|
type: DataTypes.UUID,
|
|
59
53
|
allowNull: false,
|
|
@@ -88,6 +82,17 @@ export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttribut
|
|
|
88
82
|
unique: "platform_user_album_track_platform_user_album_id_platform_track",
|
|
89
83
|
field: 'platform_track_id'
|
|
90
84
|
},
|
|
85
|
+
stateId: {
|
|
86
|
+
type: DataTypes.SMALLINT,
|
|
87
|
+
allowNull: false,
|
|
88
|
+
field: 'state_id'
|
|
89
|
+
},
|
|
90
|
+
id: {
|
|
91
|
+
type: DataTypes.UUID,
|
|
92
|
+
allowNull: false,
|
|
93
|
+
defaultValue: DataTypes.UUIDV4,
|
|
94
|
+
primaryKey: true
|
|
95
|
+
},
|
|
91
96
|
createdAt: {
|
|
92
97
|
type: DataTypes.DATE,
|
|
93
98
|
allowNull: false,
|
|
@@ -99,11 +104,6 @@ export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttribut
|
|
|
99
104
|
allowNull: false,
|
|
100
105
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
101
106
|
field: 'updated_at'
|
|
102
|
-
},
|
|
103
|
-
stateId: {
|
|
104
|
-
type: DataTypes.SMALLINT,
|
|
105
|
-
allowNull: false,
|
|
106
|
-
field: 'state_id'
|
|
107
107
|
}
|
|
108
108
|
}, {
|
|
109
109
|
sequelize,
|
|
@@ -6,14 +6,14 @@ import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './P
|
|
|
6
6
|
import type { State, StateId } from './State';
|
|
7
7
|
|
|
8
8
|
export interface PlatformUserPlaylistAttributes {
|
|
9
|
-
id: string;
|
|
10
9
|
appUserId: string;
|
|
11
10
|
platformId: number;
|
|
12
11
|
externalPlaylistId: string;
|
|
13
12
|
name: string;
|
|
14
13
|
description?: string;
|
|
15
|
-
public?: boolean;
|
|
16
14
|
snapshotId: string;
|
|
15
|
+
id: string;
|
|
16
|
+
public?: boolean;
|
|
17
17
|
collaborative: boolean;
|
|
18
18
|
createDate: Date;
|
|
19
19
|
updateDate: Date;
|
|
@@ -22,18 +22,18 @@ export interface PlatformUserPlaylistAttributes {
|
|
|
22
22
|
|
|
23
23
|
export type PlatformUserPlaylistPk = "id";
|
|
24
24
|
export type PlatformUserPlaylistId = PlatformUserPlaylist[PlatformUserPlaylistPk];
|
|
25
|
-
export type PlatformUserPlaylistOptionalAttributes = "
|
|
25
|
+
export type PlatformUserPlaylistOptionalAttributes = "description" | "id" | "public" | "createDate" | "updateDate" | "stateId";
|
|
26
26
|
export type PlatformUserPlaylistCreationAttributes = Optional<PlatformUserPlaylistAttributes, PlatformUserPlaylistOptionalAttributes>;
|
|
27
27
|
|
|
28
28
|
export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes, PlatformUserPlaylistCreationAttributes> implements PlatformUserPlaylistAttributes {
|
|
29
|
-
id!: string;
|
|
30
29
|
appUserId!: string;
|
|
31
30
|
platformId!: number;
|
|
32
31
|
externalPlaylistId!: string;
|
|
33
32
|
name!: string;
|
|
34
33
|
description?: string;
|
|
35
|
-
public?: boolean;
|
|
36
34
|
snapshotId!: string;
|
|
35
|
+
id!: string;
|
|
36
|
+
public?: boolean;
|
|
37
37
|
collaborative!: boolean;
|
|
38
38
|
createDate!: Date;
|
|
39
39
|
updateDate!: Date;
|
|
@@ -69,12 +69,6 @@ export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes,
|
|
|
69
69
|
|
|
70
70
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserPlaylist {
|
|
71
71
|
return PlatformUserPlaylist.init({
|
|
72
|
-
id: {
|
|
73
|
-
type: DataTypes.UUID,
|
|
74
|
-
allowNull: false,
|
|
75
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
76
|
-
primaryKey: true
|
|
77
|
-
},
|
|
78
72
|
appUserId: {
|
|
79
73
|
type: DataTypes.UUID,
|
|
80
74
|
allowNull: false,
|
|
@@ -109,16 +103,22 @@ export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes,
|
|
|
109
103
|
type: DataTypes.TEXT,
|
|
110
104
|
allowNull: true
|
|
111
105
|
},
|
|
112
|
-
public: {
|
|
113
|
-
type: DataTypes.BOOLEAN,
|
|
114
|
-
allowNull: true,
|
|
115
|
-
defaultValue: false
|
|
116
|
-
},
|
|
117
106
|
snapshotId: {
|
|
118
107
|
type: DataTypes.TEXT,
|
|
119
108
|
allowNull: false,
|
|
120
109
|
field: 'snapshot_id'
|
|
121
110
|
},
|
|
111
|
+
id: {
|
|
112
|
+
type: DataTypes.UUID,
|
|
113
|
+
allowNull: false,
|
|
114
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
115
|
+
primaryKey: true
|
|
116
|
+
},
|
|
117
|
+
public: {
|
|
118
|
+
type: DataTypes.BOOLEAN,
|
|
119
|
+
allowNull: true,
|
|
120
|
+
defaultValue: false
|
|
121
|
+
},
|
|
122
122
|
collaborative: {
|
|
123
123
|
type: DataTypes.BOOLEAN,
|
|
124
124
|
allowNull: false,
|