@earbug/db-models 0.0.1
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/.nvmrc +1 -0
- package/dist/AppUser.d.ts +161 -0
- package/dist/AppUser.js +121 -0
- package/dist/AppUserDevice.d.ts +26 -0
- package/dist/AppUserDevice.js +88 -0
- package/dist/AppUserFollowRelation.d.ts +34 -0
- package/dist/AppUserFollowRelation.js +113 -0
- package/dist/AppUserPlatformRelation.d.ts +43 -0
- package/dist/AppUserPlatformRelation.js +132 -0
- package/dist/CanonAlbum.d.ts +119 -0
- package/dist/CanonAlbum.js +117 -0
- package/dist/CanonAlbumExternalReferenceRelation.d.ts +31 -0
- package/dist/CanonAlbumExternalReferenceRelation.js +86 -0
- package/dist/CanonAlbumGenreRelation.d.ts +29 -0
- package/dist/CanonAlbumGenreRelation.js +82 -0
- package/dist/CanonAlbumImageHarvested.d.ts +30 -0
- package/dist/CanonAlbumImageHarvested.js +78 -0
- package/dist/CanonAlbumLabelRelation.d.ts +29 -0
- package/dist/CanonAlbumLabelRelation.js +82 -0
- package/dist/CanonAlbumTrackRelation.d.ts +29 -0
- package/dist/CanonAlbumTrackRelation.js +82 -0
- package/dist/CanonArtist.d.ts +91 -0
- package/dist/CanonArtist.js +114 -0
- package/dist/CanonArtistAlbumRelation.d.ts +29 -0
- package/dist/CanonArtistAlbumRelation.js +82 -0
- package/dist/CanonArtistExternalReferenceRelation.d.ts +31 -0
- package/dist/CanonArtistExternalReferenceRelation.js +86 -0
- package/dist/CanonArtistGenreRelation.d.ts +29 -0
- package/dist/CanonArtistGenreRelation.js +82 -0
- package/dist/CanonArtistImageHarvested.d.ts +30 -0
- package/dist/CanonArtistImageHarvested.js +70 -0
- package/dist/CanonArtistMemberRelation.d.ts +29 -0
- package/dist/CanonArtistMemberRelation.js +82 -0
- package/dist/CanonArtistTrackRelation.d.ts +29 -0
- package/dist/CanonArtistTrackRelation.js +82 -0
- package/dist/CanonGenre.d.ts +133 -0
- package/dist/CanonGenre.js +93 -0
- package/dist/CanonGenreExternalReferenceRelation.d.ts +31 -0
- package/dist/CanonGenreExternalReferenceRelation.js +86 -0
- package/dist/CanonLabel.d.ts +69 -0
- package/dist/CanonLabel.js +83 -0
- package/dist/CanonLabelExternalReferenceRelation.d.ts +31 -0
- package/dist/CanonLabelExternalReferenceRelation.js +86 -0
- package/dist/CanonMember.d.ts +71 -0
- package/dist/CanonMember.js +82 -0
- package/dist/CanonMemberExternalReferenceRelation.d.ts +33 -0
- package/dist/CanonMemberExternalReferenceRelation.js +91 -0
- package/dist/CanonToPlatformAlbumRelation.d.ts +29 -0
- package/dist/CanonToPlatformAlbumRelation.js +82 -0
- package/dist/CanonToPlatformArtistRelation.d.ts +29 -0
- package/dist/CanonToPlatformArtistRelation.js +82 -0
- package/dist/CanonToPlatformGenreRelation.d.ts +29 -0
- package/dist/CanonToPlatformGenreRelation.js +82 -0
- package/dist/CanonToPlatformTrackRelation.d.ts +29 -0
- package/dist/CanonToPlatformTrackRelation.js +82 -0
- package/dist/CanonTrack.d.ts +89 -0
- package/dist/CanonTrack.js +99 -0
- package/dist/ConfigParam.d.ts +19 -0
- package/dist/ConfigParam.js +70 -0
- package/dist/ExternalReference.d.ts +139 -0
- package/dist/ExternalReference.js +79 -0
- package/dist/JukeboxAccessType.d.ts +26 -0
- package/dist/JukeboxAccessType.js +36 -0
- package/dist/JukeboxCanonGenreRelation.d.ts +33 -0
- package/dist/JukeboxCanonGenreRelation.js +101 -0
- package/dist/JukeboxInvite.d.ts +39 -0
- package/dist/JukeboxInvite.js +98 -0
- package/dist/JukeboxQueueEntry.d.ts +74 -0
- package/dist/JukeboxQueueEntry.js +142 -0
- package/dist/JukeboxQueueMode.d.ts +26 -0
- package/dist/JukeboxQueueMode.js +36 -0
- package/dist/JukeboxSession.d.ts +108 -0
- package/dist/JukeboxSession.js +133 -0
- package/dist/JukeboxStatus.d.ts +26 -0
- package/dist/JukeboxStatus.js +34 -0
- package/dist/JukeboxTerminationCondition.d.ts +26 -0
- package/dist/JukeboxTerminationCondition.js +36 -0
- package/dist/JukeboxType.d.ts +26 -0
- package/dist/JukeboxType.js +36 -0
- package/dist/JukeboxUser.d.ts +56 -0
- package/dist/JukeboxUser.js +135 -0
- package/dist/JukeboxUserType.d.ts +26 -0
- package/dist/JukeboxUserType.js +34 -0
- package/dist/KnexMigrations.d.ts +19 -0
- package/dist/KnexMigrations.js +44 -0
- package/dist/KnexMigrationsLock.d.ts +15 -0
- package/dist/KnexMigrationsLock.js +36 -0
- package/dist/MetricsDaily.d.ts +19 -0
- package/dist/MetricsDaily.js +87 -0
- package/dist/MetricsEvent.d.ts +23 -0
- package/dist/MetricsEvent.js +117 -0
- package/dist/NewsSite.d.ts +21 -0
- package/dist/NewsSite.js +57 -0
- package/dist/PauseStatusType.d.ts +26 -0
- package/dist/PauseStatusType.js +34 -0
- package/dist/Platform.d.ts +127 -0
- package/dist/Platform.js +80 -0
- package/dist/PlatformAlbum.d.ts +232 -0
- package/dist/PlatformAlbum.js +123 -0
- package/dist/PlatformAlbumGenreRelation.d.ts +29 -0
- package/dist/PlatformAlbumGenreRelation.js +82 -0
- package/dist/PlatformAlbumTrackRelation.d.ts +29 -0
- package/dist/PlatformAlbumTrackRelation.js +82 -0
- package/dist/PlatformArtist.d.ts +225 -0
- package/dist/PlatformArtist.js +109 -0
- package/dist/PlatformArtistAlbumRelation.d.ts +29 -0
- package/dist/PlatformArtistAlbumRelation.js +82 -0
- package/dist/PlatformArtistGenreRelation.d.ts +29 -0
- package/dist/PlatformArtistGenreRelation.js +82 -0
- package/dist/PlatformArtistTrackRelation.d.ts +29 -0
- package/dist/PlatformArtistTrackRelation.js +82 -0
- package/dist/PlatformGenre.d.ts +122 -0
- package/dist/PlatformGenre.js +90 -0
- package/dist/PlatformTrack.d.ts +183 -0
- package/dist/PlatformTrack.js +129 -0
- package/dist/PlatformTrackGenreRelation.d.ts +29 -0
- package/dist/PlatformTrackGenreRelation.js +82 -0
- package/dist/PlatformUserAlbum.d.ts +54 -0
- package/dist/PlatformUserAlbum.js +121 -0
- package/dist/PlatformUserAlbumTrack.d.ts +42 -0
- package/dist/PlatformUserAlbumTrack.js +121 -0
- package/dist/PlatformUserPlaylist.d.ts +62 -0
- package/dist/PlatformUserPlaylist.js +135 -0
- package/dist/PlatformUserPlaylistTrack.d.ts +48 -0
- package/dist/PlatformUserPlaylistTrack.js +132 -0
- package/dist/PlaybackStatus.d.ts +26 -0
- package/dist/PlaybackStatus.js +36 -0
- package/dist/State.d.ts +50 -0
- package/dist/State.js +36 -0
- package/dist/TrackDeletionReason.d.ts +26 -0
- package/dist/TrackDeletionReason.js +34 -0
- package/dist/UnmatchedAlbum.d.ts +22 -0
- package/dist/UnmatchedAlbum.js +70 -0
- package/dist/UnmatchedArtist.d.ts +26 -0
- package/dist/UnmatchedArtist.js +81 -0
- package/dist/UserContacts.d.ts +46 -0
- package/dist/UserContacts.js +105 -0
- package/dist/init-models.d.ts +209 -0
- package/dist/init-models.js +507 -0
- package/model_options.json +3 -0
- package/models/AppUser.ts +267 -0
- package/models/AppUserDevice.ts +88 -0
- package/models/AppUserFollowRelation.ts +122 -0
- package/models/AppUserPlatformRelation.ts +150 -0
- package/models/CanonAlbum.ts +216 -0
- package/models/CanonAlbumExternalReferenceRelation.ts +92 -0
- package/models/CanonAlbumGenreRelation.ts +86 -0
- package/models/CanonAlbumImageHarvested.ts +106 -0
- package/models/CanonAlbumLabelRelation.ts +86 -0
- package/models/CanonAlbumTrackRelation.ts +86 -0
- package/models/CanonArtist.ts +183 -0
- package/models/CanonArtistAlbumRelation.ts +86 -0
- package/models/CanonArtistExternalReferenceRelation.ts +92 -0
- package/models/CanonArtistGenreRelation.ts +86 -0
- package/models/CanonArtistImageHarvested.ts +98 -0
- package/models/CanonArtistMemberRelation.ts +86 -0
- package/models/CanonArtistTrackRelation.ts +86 -0
- package/models/CanonGenre.ts +208 -0
- package/models/CanonGenreExternalReferenceRelation.ts +92 -0
- package/models/CanonLabel.ts +129 -0
- package/models/CanonLabelExternalReferenceRelation.ts +92 -0
- package/models/CanonMember.ts +130 -0
- package/models/CanonMemberExternalReferenceRelation.ts +99 -0
- package/models/CanonToPlatformAlbumRelation.ts +86 -0
- package/models/CanonToPlatformArtistRelation.ts +86 -0
- package/models/CanonToPlatformGenreRelation.ts +86 -0
- package/models/CanonToPlatformTrackRelation.ts +86 -0
- package/models/CanonTrack.ts +167 -0
- package/models/ConfigParam.ts +62 -0
- package/models/ExternalReference.ts +201 -0
- package/models/JukeboxAccessType.ts +60 -0
- package/models/JukeboxCanonGenreRelation.ts +109 -0
- package/models/JukeboxInvite.ts +113 -0
- package/models/JukeboxQueueEntry.ts +195 -0
- package/models/JukeboxQueueMode.ts +60 -0
- package/models/JukeboxSession.ts +223 -0
- package/models/JukeboxStatus.ts +58 -0
- package/models/JukeboxTerminationCondition.ts +60 -0
- package/models/JukeboxType.ts +60 -0
- package/models/JukeboxUser.ts +169 -0
- package/models/JukeboxUserType.ts +58 -0
- package/models/KnexMigrations.ts +60 -0
- package/models/KnexMigrationsLock.ts +48 -0
- package/models/MetricsDaily.ts +79 -0
- package/models/MetricsEvent.ts +114 -0
- package/models/NewsSite.ts +75 -0
- package/models/PauseStatusType.ts +58 -0
- package/models/Platform.ts +189 -0
- package/models/PlatformAlbum.ts +345 -0
- package/models/PlatformAlbumGenreRelation.ts +86 -0
- package/models/PlatformAlbumTrackRelation.ts +86 -0
- package/models/PlatformArtist.ts +324 -0
- package/models/PlatformArtistAlbumRelation.ts +86 -0
- package/models/PlatformArtistGenreRelation.ts +86 -0
- package/models/PlatformArtistTrackRelation.ts +86 -0
- package/models/PlatformGenre.ts +194 -0
- package/models/PlatformTrack.ts +298 -0
- package/models/PlatformTrackGenreRelation.ts +86 -0
- package/models/PlatformUserAlbum.ts +152 -0
- package/models/PlatformUserAlbumTrack.ts +139 -0
- package/models/PlatformUserPlaylist.ts +174 -0
- package/models/PlatformUserPlaylistTrack.ts +156 -0
- package/models/PlaybackStatus.ts +60 -0
- package/models/State.ts +86 -0
- package/models/TrackDeletionReason.ts +58 -0
- package/models/UnmatchedAlbum.ts +66 -0
- package/models/UnmatchedArtist.ts +81 -0
- package/models/UserContacts.ts +149 -0
- package/models/init-models.ts +716 -0
- package/package.json +19 -0
- package/tsconfig.json +52 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { Platform, PlatformId } from './Platform';
|
|
5
|
+
import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
|
|
6
|
+
import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './PlatformUserAlbumTrack';
|
|
7
|
+
|
|
8
|
+
export interface PlatformUserAlbumAttributes {
|
|
9
|
+
id: string;
|
|
10
|
+
appUserId: string;
|
|
11
|
+
platformId: number;
|
|
12
|
+
externalUserAlbumId: string;
|
|
13
|
+
platformAlbumId: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
stateId: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type PlatformUserAlbumPk = "id";
|
|
20
|
+
export type PlatformUserAlbumId = PlatformUserAlbum[PlatformUserAlbumPk];
|
|
21
|
+
export type PlatformUserAlbumOptionalAttributes = "id" | "createdAt" | "updatedAt" | "stateId";
|
|
22
|
+
export type PlatformUserAlbumCreationAttributes = Optional<PlatformUserAlbumAttributes, PlatformUserAlbumOptionalAttributes>;
|
|
23
|
+
|
|
24
|
+
export class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, PlatformUserAlbumCreationAttributes> implements PlatformUserAlbumAttributes {
|
|
25
|
+
id!: string;
|
|
26
|
+
appUserId!: string;
|
|
27
|
+
platformId!: number;
|
|
28
|
+
externalUserAlbumId!: string;
|
|
29
|
+
platformAlbumId!: string;
|
|
30
|
+
createdAt!: Date;
|
|
31
|
+
updatedAt!: Date;
|
|
32
|
+
stateId!: number;
|
|
33
|
+
|
|
34
|
+
// PlatformUserAlbum belongsTo AppUser via appUserId
|
|
35
|
+
appUser!: AppUser;
|
|
36
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
37
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
38
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
39
|
+
// PlatformUserAlbum belongsTo Platform via platformId
|
|
40
|
+
platform!: Platform;
|
|
41
|
+
getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
|
|
42
|
+
setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
|
|
43
|
+
createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
|
|
44
|
+
// PlatformUserAlbum belongsTo PlatformAlbum via platformAlbumId
|
|
45
|
+
platformAlbum!: PlatformAlbum;
|
|
46
|
+
getPlatformAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformAlbum>;
|
|
47
|
+
setPlatformAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
48
|
+
createPlatformAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformAlbum>;
|
|
49
|
+
// PlatformUserAlbum hasMany PlatformUserAlbumTrack via platformUserAlbumId
|
|
50
|
+
platformUserAlbumTracks!: PlatformUserAlbumTrack[];
|
|
51
|
+
getPlatformUserAlbumTracks!: Sequelize.HasManyGetAssociationsMixin<PlatformUserAlbumTrack>;
|
|
52
|
+
setPlatformUserAlbumTracks!: Sequelize.HasManySetAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
53
|
+
addPlatformUserAlbumTrack!: Sequelize.HasManyAddAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
54
|
+
addPlatformUserAlbumTracks!: Sequelize.HasManyAddAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
55
|
+
createPlatformUserAlbumTrack!: Sequelize.HasManyCreateAssociationMixin<PlatformUserAlbumTrack>;
|
|
56
|
+
removePlatformUserAlbumTrack!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
57
|
+
removePlatformUserAlbumTracks!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
58
|
+
hasPlatformUserAlbumTrack!: Sequelize.HasManyHasAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
59
|
+
hasPlatformUserAlbumTracks!: Sequelize.HasManyHasAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
|
|
60
|
+
countPlatformUserAlbumTracks!: Sequelize.HasManyCountAssociationsMixin;
|
|
61
|
+
|
|
62
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbum {
|
|
63
|
+
return PlatformUserAlbum.init({
|
|
64
|
+
id: {
|
|
65
|
+
type: DataTypes.UUID,
|
|
66
|
+
allowNull: false,
|
|
67
|
+
defaultValue: DataTypes.UUIDV4,
|
|
68
|
+
primaryKey: true
|
|
69
|
+
},
|
|
70
|
+
appUserId: {
|
|
71
|
+
type: DataTypes.UUID,
|
|
72
|
+
allowNull: false,
|
|
73
|
+
references: {
|
|
74
|
+
model: 'app_user',
|
|
75
|
+
key: 'id'
|
|
76
|
+
},
|
|
77
|
+
unique: "platform_user_album_app_user_id_platform_album_id_unique",
|
|
78
|
+
field: 'app_user_id'
|
|
79
|
+
},
|
|
80
|
+
platformId: {
|
|
81
|
+
type: DataTypes.SMALLINT,
|
|
82
|
+
allowNull: false,
|
|
83
|
+
references: {
|
|
84
|
+
model: 'platform',
|
|
85
|
+
key: 'id'
|
|
86
|
+
},
|
|
87
|
+
field: 'platform_id'
|
|
88
|
+
},
|
|
89
|
+
externalUserAlbumId: {
|
|
90
|
+
type: DataTypes.STRING(255),
|
|
91
|
+
allowNull: false,
|
|
92
|
+
field: 'external_user_album_id'
|
|
93
|
+
},
|
|
94
|
+
platformAlbumId: {
|
|
95
|
+
type: DataTypes.UUID,
|
|
96
|
+
allowNull: false,
|
|
97
|
+
references: {
|
|
98
|
+
model: 'platform_album',
|
|
99
|
+
key: 'id'
|
|
100
|
+
},
|
|
101
|
+
unique: "platform_user_album_app_user_id_platform_album_id_unique",
|
|
102
|
+
field: 'platform_album_id'
|
|
103
|
+
},
|
|
104
|
+
createdAt: {
|
|
105
|
+
type: DataTypes.DATE,
|
|
106
|
+
allowNull: false,
|
|
107
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
108
|
+
field: 'created_at'
|
|
109
|
+
},
|
|
110
|
+
updatedAt: {
|
|
111
|
+
type: DataTypes.DATE,
|
|
112
|
+
allowNull: false,
|
|
113
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
114
|
+
field: 'updated_at'
|
|
115
|
+
},
|
|
116
|
+
stateId: {
|
|
117
|
+
type: DataTypes.SMALLINT,
|
|
118
|
+
allowNull: false,
|
|
119
|
+
defaultValue: 0,
|
|
120
|
+
field: 'state_id'
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
sequelize,
|
|
124
|
+
tableName: 'platform_user_album',
|
|
125
|
+
schema: 'eb',
|
|
126
|
+
timestamps: false,
|
|
127
|
+
indexes: [
|
|
128
|
+
{
|
|
129
|
+
name: "platform_user_album_app_user_id_index",
|
|
130
|
+
fields: [
|
|
131
|
+
{ name: "app_user_id" },
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "platform_user_album_app_user_id_platform_album_id_unique",
|
|
136
|
+
unique: true,
|
|
137
|
+
fields: [
|
|
138
|
+
{ name: "app_user_id" },
|
|
139
|
+
{ name: "platform_album_id" },
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "platform_user_album_pkey",
|
|
144
|
+
unique: true,
|
|
145
|
+
fields: [
|
|
146
|
+
{ name: "id" },
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { Platform, PlatformId } from './Platform';
|
|
4
|
+
import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
5
|
+
import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
|
|
6
|
+
|
|
7
|
+
export interface PlatformUserAlbumTrackAttributes {
|
|
8
|
+
id: string;
|
|
9
|
+
platformUserAlbumId: string;
|
|
10
|
+
platformId: number;
|
|
11
|
+
externalUserAlbumTrackId: string;
|
|
12
|
+
platformTrackId: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
stateId: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type PlatformUserAlbumTrackPk = "id";
|
|
19
|
+
export type PlatformUserAlbumTrackId = PlatformUserAlbumTrack[PlatformUserAlbumTrackPk];
|
|
20
|
+
export type PlatformUserAlbumTrackOptionalAttributes = "id" | "createdAt" | "updatedAt" | "stateId";
|
|
21
|
+
export type PlatformUserAlbumTrackCreationAttributes = Optional<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackOptionalAttributes>;
|
|
22
|
+
|
|
23
|
+
export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackCreationAttributes> implements PlatformUserAlbumTrackAttributes {
|
|
24
|
+
id!: string;
|
|
25
|
+
platformUserAlbumId!: string;
|
|
26
|
+
platformId!: number;
|
|
27
|
+
externalUserAlbumTrackId!: string;
|
|
28
|
+
platformTrackId!: string;
|
|
29
|
+
createdAt!: Date;
|
|
30
|
+
updatedAt!: Date;
|
|
31
|
+
stateId!: number;
|
|
32
|
+
|
|
33
|
+
// PlatformUserAlbumTrack belongsTo Platform via platformId
|
|
34
|
+
platform!: Platform;
|
|
35
|
+
getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
|
|
36
|
+
setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
|
|
37
|
+
createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
|
|
38
|
+
// PlatformUserAlbumTrack belongsTo PlatformTrack via platformTrackId
|
|
39
|
+
platformTrack!: PlatformTrack;
|
|
40
|
+
getPlatformTrack!: Sequelize.BelongsToGetAssociationMixin<PlatformTrack>;
|
|
41
|
+
setPlatformTrack!: Sequelize.BelongsToSetAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
42
|
+
createPlatformTrack!: Sequelize.BelongsToCreateAssociationMixin<PlatformTrack>;
|
|
43
|
+
// PlatformUserAlbumTrack belongsTo PlatformUserAlbum via platformUserAlbumId
|
|
44
|
+
platformUserAlbum!: PlatformUserAlbum;
|
|
45
|
+
getPlatformUserAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformUserAlbum>;
|
|
46
|
+
setPlatformUserAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
47
|
+
createPlatformUserAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserAlbum>;
|
|
48
|
+
|
|
49
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbumTrack {
|
|
50
|
+
return PlatformUserAlbumTrack.init({
|
|
51
|
+
id: {
|
|
52
|
+
type: DataTypes.UUID,
|
|
53
|
+
allowNull: false,
|
|
54
|
+
defaultValue: DataTypes.UUIDV4,
|
|
55
|
+
primaryKey: true
|
|
56
|
+
},
|
|
57
|
+
platformUserAlbumId: {
|
|
58
|
+
type: DataTypes.UUID,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
references: {
|
|
61
|
+
model: 'platform_user_album',
|
|
62
|
+
key: 'id'
|
|
63
|
+
},
|
|
64
|
+
unique: "platform_user_album_track_platform_user_album_id_platform_track",
|
|
65
|
+
field: 'platform_user_album_id'
|
|
66
|
+
},
|
|
67
|
+
platformId: {
|
|
68
|
+
type: DataTypes.SMALLINT,
|
|
69
|
+
allowNull: false,
|
|
70
|
+
references: {
|
|
71
|
+
model: 'platform',
|
|
72
|
+
key: 'id'
|
|
73
|
+
},
|
|
74
|
+
field: 'platform_id'
|
|
75
|
+
},
|
|
76
|
+
externalUserAlbumTrackId: {
|
|
77
|
+
type: DataTypes.STRING(255),
|
|
78
|
+
allowNull: false,
|
|
79
|
+
field: 'external_user_album_track_id'
|
|
80
|
+
},
|
|
81
|
+
platformTrackId: {
|
|
82
|
+
type: DataTypes.UUID,
|
|
83
|
+
allowNull: false,
|
|
84
|
+
references: {
|
|
85
|
+
model: 'platform_track',
|
|
86
|
+
key: 'id'
|
|
87
|
+
},
|
|
88
|
+
unique: "platform_user_album_track_platform_user_album_id_platform_track",
|
|
89
|
+
field: 'platform_track_id'
|
|
90
|
+
},
|
|
91
|
+
createdAt: {
|
|
92
|
+
type: DataTypes.DATE,
|
|
93
|
+
allowNull: false,
|
|
94
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
95
|
+
field: 'created_at'
|
|
96
|
+
},
|
|
97
|
+
updatedAt: {
|
|
98
|
+
type: DataTypes.DATE,
|
|
99
|
+
allowNull: false,
|
|
100
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
101
|
+
field: 'updated_at'
|
|
102
|
+
},
|
|
103
|
+
stateId: {
|
|
104
|
+
type: DataTypes.SMALLINT,
|
|
105
|
+
allowNull: false,
|
|
106
|
+
defaultValue: 0,
|
|
107
|
+
field: 'state_id'
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
sequelize,
|
|
111
|
+
tableName: 'platform_user_album_track',
|
|
112
|
+
schema: 'eb',
|
|
113
|
+
timestamps: false,
|
|
114
|
+
indexes: [
|
|
115
|
+
{
|
|
116
|
+
name: "platform_user_album_track_pkey",
|
|
117
|
+
unique: true,
|
|
118
|
+
fields: [
|
|
119
|
+
{ name: "id" },
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "platform_user_album_track_platform_user_album_id_index",
|
|
124
|
+
fields: [
|
|
125
|
+
{ name: "platform_user_album_id" },
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "platform_user_album_track_platform_user_album_id_platform_track",
|
|
130
|
+
unique: true,
|
|
131
|
+
fields: [
|
|
132
|
+
{ name: "platform_user_album_id" },
|
|
133
|
+
{ name: "platform_track_id" },
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
import type { Platform, PlatformId } from './Platform';
|
|
5
|
+
import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
|
|
6
|
+
import type { State, StateId } from './State';
|
|
7
|
+
|
|
8
|
+
export interface PlatformUserPlaylistAttributes {
|
|
9
|
+
id: string;
|
|
10
|
+
appUserId: string;
|
|
11
|
+
platformId: number;
|
|
12
|
+
externalPlaylistId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
public?: boolean;
|
|
16
|
+
snapshotId: string;
|
|
17
|
+
collaborative: boolean;
|
|
18
|
+
createDate: Date;
|
|
19
|
+
updateDate: Date;
|
|
20
|
+
stateId: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type PlatformUserPlaylistPk = "id";
|
|
24
|
+
export type PlatformUserPlaylistId = PlatformUserPlaylist[PlatformUserPlaylistPk];
|
|
25
|
+
export type PlatformUserPlaylistOptionalAttributes = "id" | "description" | "public" | "createDate" | "updateDate" | "stateId";
|
|
26
|
+
export type PlatformUserPlaylistCreationAttributes = Optional<PlatformUserPlaylistAttributes, PlatformUserPlaylistOptionalAttributes>;
|
|
27
|
+
|
|
28
|
+
export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes, PlatformUserPlaylistCreationAttributes> implements PlatformUserPlaylistAttributes {
|
|
29
|
+
id!: string;
|
|
30
|
+
appUserId!: string;
|
|
31
|
+
platformId!: number;
|
|
32
|
+
externalPlaylistId!: string;
|
|
33
|
+
name!: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
public?: boolean;
|
|
36
|
+
snapshotId!: string;
|
|
37
|
+
collaborative!: boolean;
|
|
38
|
+
createDate!: Date;
|
|
39
|
+
updateDate!: Date;
|
|
40
|
+
stateId!: number;
|
|
41
|
+
|
|
42
|
+
// PlatformUserPlaylist belongsTo AppUser via appUserId
|
|
43
|
+
appUser!: AppUser;
|
|
44
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
45
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
46
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
47
|
+
// PlatformUserPlaylist belongsTo Platform via platformId
|
|
48
|
+
platform!: Platform;
|
|
49
|
+
getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
|
|
50
|
+
setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
|
|
51
|
+
createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
|
|
52
|
+
// PlatformUserPlaylist hasMany PlatformUserPlaylistTrack via platformUserPlaylistId
|
|
53
|
+
platformUserPlaylistTracks!: PlatformUserPlaylistTrack[];
|
|
54
|
+
getPlatformUserPlaylistTracks!: Sequelize.HasManyGetAssociationsMixin<PlatformUserPlaylistTrack>;
|
|
55
|
+
setPlatformUserPlaylistTracks!: Sequelize.HasManySetAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
56
|
+
addPlatformUserPlaylistTrack!: Sequelize.HasManyAddAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
57
|
+
addPlatformUserPlaylistTracks!: Sequelize.HasManyAddAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
58
|
+
createPlatformUserPlaylistTrack!: Sequelize.HasManyCreateAssociationMixin<PlatformUserPlaylistTrack>;
|
|
59
|
+
removePlatformUserPlaylistTrack!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
60
|
+
removePlatformUserPlaylistTracks!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
61
|
+
hasPlatformUserPlaylistTrack!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
62
|
+
hasPlatformUserPlaylistTracks!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
|
|
63
|
+
countPlatformUserPlaylistTracks!: Sequelize.HasManyCountAssociationsMixin;
|
|
64
|
+
// PlatformUserPlaylist belongsTo State via stateId
|
|
65
|
+
state!: State;
|
|
66
|
+
getState!: Sequelize.BelongsToGetAssociationMixin<State>;
|
|
67
|
+
setState!: Sequelize.BelongsToSetAssociationMixin<State, StateId>;
|
|
68
|
+
createState!: Sequelize.BelongsToCreateAssociationMixin<State>;
|
|
69
|
+
|
|
70
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserPlaylist {
|
|
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
|
+
appUserId: {
|
|
79
|
+
type: DataTypes.UUID,
|
|
80
|
+
allowNull: false,
|
|
81
|
+
references: {
|
|
82
|
+
model: 'app_user',
|
|
83
|
+
key: 'id'
|
|
84
|
+
},
|
|
85
|
+
unique: "uk_app_user_platform_playlist",
|
|
86
|
+
field: 'app_user_id'
|
|
87
|
+
},
|
|
88
|
+
platformId: {
|
|
89
|
+
type: DataTypes.SMALLINT,
|
|
90
|
+
allowNull: false,
|
|
91
|
+
references: {
|
|
92
|
+
model: 'platform',
|
|
93
|
+
key: 'id'
|
|
94
|
+
},
|
|
95
|
+
unique: "uk_app_user_platform_playlist",
|
|
96
|
+
field: 'platform_id'
|
|
97
|
+
},
|
|
98
|
+
externalPlaylistId: {
|
|
99
|
+
type: DataTypes.TEXT,
|
|
100
|
+
allowNull: false,
|
|
101
|
+
unique: "uk_app_user_platform_playlist",
|
|
102
|
+
field: 'external_playlist_id'
|
|
103
|
+
},
|
|
104
|
+
name: {
|
|
105
|
+
type: DataTypes.TEXT,
|
|
106
|
+
allowNull: false
|
|
107
|
+
},
|
|
108
|
+
description: {
|
|
109
|
+
type: DataTypes.TEXT,
|
|
110
|
+
allowNull: true
|
|
111
|
+
},
|
|
112
|
+
public: {
|
|
113
|
+
type: DataTypes.BOOLEAN,
|
|
114
|
+
allowNull: true,
|
|
115
|
+
defaultValue: false
|
|
116
|
+
},
|
|
117
|
+
snapshotId: {
|
|
118
|
+
type: DataTypes.TEXT,
|
|
119
|
+
allowNull: false,
|
|
120
|
+
field: 'snapshot_id'
|
|
121
|
+
},
|
|
122
|
+
collaborative: {
|
|
123
|
+
type: DataTypes.BOOLEAN,
|
|
124
|
+
allowNull: false,
|
|
125
|
+
defaultValue: false
|
|
126
|
+
},
|
|
127
|
+
createDate: {
|
|
128
|
+
type: DataTypes.DATE,
|
|
129
|
+
allowNull: false,
|
|
130
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
131
|
+
field: 'create_date'
|
|
132
|
+
},
|
|
133
|
+
updateDate: {
|
|
134
|
+
type: DataTypes.DATE,
|
|
135
|
+
allowNull: false,
|
|
136
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
137
|
+
field: 'update_date'
|
|
138
|
+
},
|
|
139
|
+
stateId: {
|
|
140
|
+
type: DataTypes.SMALLINT,
|
|
141
|
+
allowNull: false,
|
|
142
|
+
defaultValue: 0,
|
|
143
|
+
references: {
|
|
144
|
+
model: 'state',
|
|
145
|
+
key: 'id'
|
|
146
|
+
},
|
|
147
|
+
field: 'state_id'
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
sequelize,
|
|
151
|
+
tableName: 'platform_user_playlist',
|
|
152
|
+
schema: 'eb',
|
|
153
|
+
timestamps: false,
|
|
154
|
+
indexes: [
|
|
155
|
+
{
|
|
156
|
+
name: "playlist_pkey",
|
|
157
|
+
unique: true,
|
|
158
|
+
fields: [
|
|
159
|
+
{ name: "id" },
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "uk_app_user_platform_playlist",
|
|
164
|
+
unique: true,
|
|
165
|
+
fields: [
|
|
166
|
+
{ name: "app_user_id" },
|
|
167
|
+
{ name: "platform_id" },
|
|
168
|
+
{ name: "external_playlist_id" },
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
]
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
4
|
+
import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
|
|
5
|
+
import type { State, StateId } from './State';
|
|
6
|
+
|
|
7
|
+
export interface PlatformUserPlaylistTrackAttributes {
|
|
8
|
+
id: string;
|
|
9
|
+
platformTrackId: string;
|
|
10
|
+
platformUserPlaylistId: string;
|
|
11
|
+
trackPosition: number;
|
|
12
|
+
addedDate?: Date;
|
|
13
|
+
addedByPlatformUserId?: string;
|
|
14
|
+
isLocal: boolean;
|
|
15
|
+
createDate: Date;
|
|
16
|
+
updateDate: Date;
|
|
17
|
+
stateId: number;
|
|
18
|
+
externalPlaylistTrackId: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PlatformUserPlaylistTrackPk = "id";
|
|
22
|
+
export type PlatformUserPlaylistTrackId = PlatformUserPlaylistTrack[PlatformUserPlaylistTrackPk];
|
|
23
|
+
export type PlatformUserPlaylistTrackOptionalAttributes = "id" | "trackPosition" | "addedDate" | "addedByPlatformUserId" | "createDate" | "updateDate" | "stateId";
|
|
24
|
+
export type PlatformUserPlaylistTrackCreationAttributes = Optional<PlatformUserPlaylistTrackAttributes, PlatformUserPlaylistTrackOptionalAttributes>;
|
|
25
|
+
|
|
26
|
+
export class PlatformUserPlaylistTrack extends Model<PlatformUserPlaylistTrackAttributes, PlatformUserPlaylistTrackCreationAttributes> implements PlatformUserPlaylistTrackAttributes {
|
|
27
|
+
id!: string;
|
|
28
|
+
platformTrackId!: string;
|
|
29
|
+
platformUserPlaylistId!: string;
|
|
30
|
+
trackPosition!: number;
|
|
31
|
+
addedDate?: Date;
|
|
32
|
+
addedByPlatformUserId?: string;
|
|
33
|
+
isLocal!: boolean;
|
|
34
|
+
createDate!: Date;
|
|
35
|
+
updateDate!: Date;
|
|
36
|
+
stateId!: number;
|
|
37
|
+
externalPlaylistTrackId!: string;
|
|
38
|
+
|
|
39
|
+
// PlatformUserPlaylistTrack belongsTo PlatformTrack via platformTrackId
|
|
40
|
+
platformTrack!: PlatformTrack;
|
|
41
|
+
getPlatformTrack!: Sequelize.BelongsToGetAssociationMixin<PlatformTrack>;
|
|
42
|
+
setPlatformTrack!: Sequelize.BelongsToSetAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
43
|
+
createPlatformTrack!: Sequelize.BelongsToCreateAssociationMixin<PlatformTrack>;
|
|
44
|
+
// PlatformUserPlaylistTrack belongsTo PlatformUserPlaylist via platformUserPlaylistId
|
|
45
|
+
platformUserPlaylist!: PlatformUserPlaylist;
|
|
46
|
+
getPlatformUserPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
|
|
47
|
+
setPlatformUserPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
48
|
+
createPlatformUserPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
|
|
49
|
+
// PlatformUserPlaylistTrack belongsTo State via stateId
|
|
50
|
+
state!: State;
|
|
51
|
+
getState!: Sequelize.BelongsToGetAssociationMixin<State>;
|
|
52
|
+
setState!: Sequelize.BelongsToSetAssociationMixin<State, StateId>;
|
|
53
|
+
createState!: Sequelize.BelongsToCreateAssociationMixin<State>;
|
|
54
|
+
|
|
55
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserPlaylistTrack {
|
|
56
|
+
return PlatformUserPlaylistTrack.init({
|
|
57
|
+
id: {
|
|
58
|
+
type: DataTypes.UUID,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
61
|
+
primaryKey: true
|
|
62
|
+
},
|
|
63
|
+
platformTrackId: {
|
|
64
|
+
type: DataTypes.UUID,
|
|
65
|
+
allowNull: false,
|
|
66
|
+
references: {
|
|
67
|
+
model: 'platform_track',
|
|
68
|
+
key: 'id'
|
|
69
|
+
},
|
|
70
|
+
unique: "uk_playlist_id_track_id",
|
|
71
|
+
field: 'platform_track_id'
|
|
72
|
+
},
|
|
73
|
+
platformUserPlaylistId: {
|
|
74
|
+
type: DataTypes.UUID,
|
|
75
|
+
allowNull: false,
|
|
76
|
+
references: {
|
|
77
|
+
model: 'platform_user_playlist',
|
|
78
|
+
key: 'id'
|
|
79
|
+
},
|
|
80
|
+
unique: "uk_playlist_id_track_id",
|
|
81
|
+
field: 'platform_user_playlist_id'
|
|
82
|
+
},
|
|
83
|
+
trackPosition: {
|
|
84
|
+
type: DataTypes.INTEGER,
|
|
85
|
+
allowNull: false,
|
|
86
|
+
defaultValue: 0,
|
|
87
|
+
field: 'track_position'
|
|
88
|
+
},
|
|
89
|
+
addedDate: {
|
|
90
|
+
type: DataTypes.DATE,
|
|
91
|
+
allowNull: true,
|
|
92
|
+
field: 'added_date'
|
|
93
|
+
},
|
|
94
|
+
addedByPlatformUserId: {
|
|
95
|
+
type: DataTypes.TEXT,
|
|
96
|
+
allowNull: true,
|
|
97
|
+
field: 'added_by_platform_user_id'
|
|
98
|
+
},
|
|
99
|
+
isLocal: {
|
|
100
|
+
type: DataTypes.BOOLEAN,
|
|
101
|
+
allowNull: false,
|
|
102
|
+
defaultValue: false,
|
|
103
|
+
field: 'is_local'
|
|
104
|
+
},
|
|
105
|
+
createDate: {
|
|
106
|
+
type: DataTypes.DATE,
|
|
107
|
+
allowNull: false,
|
|
108
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
109
|
+
field: 'create_date'
|
|
110
|
+
},
|
|
111
|
+
updateDate: {
|
|
112
|
+
type: DataTypes.DATE,
|
|
113
|
+
allowNull: false,
|
|
114
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
115
|
+
field: 'update_date'
|
|
116
|
+
},
|
|
117
|
+
stateId: {
|
|
118
|
+
type: DataTypes.SMALLINT,
|
|
119
|
+
allowNull: false,
|
|
120
|
+
defaultValue: 0,
|
|
121
|
+
references: {
|
|
122
|
+
model: 'state',
|
|
123
|
+
key: 'id'
|
|
124
|
+
},
|
|
125
|
+
field: 'state_id'
|
|
126
|
+
},
|
|
127
|
+
externalPlaylistTrackId: {
|
|
128
|
+
type: DataTypes.STRING(255),
|
|
129
|
+
allowNull: false,
|
|
130
|
+
field: 'external_playlist_track_id'
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
sequelize,
|
|
134
|
+
tableName: 'platform_user_playlist_track',
|
|
135
|
+
schema: 'eb',
|
|
136
|
+
timestamps: false,
|
|
137
|
+
indexes: [
|
|
138
|
+
{
|
|
139
|
+
name: "playlist_track_pkey",
|
|
140
|
+
unique: true,
|
|
141
|
+
fields: [
|
|
142
|
+
{ name: "id" },
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "uk_playlist_id_track_id",
|
|
147
|
+
unique: true,
|
|
148
|
+
fields: [
|
|
149
|
+
{ name: "platform_track_id" },
|
|
150
|
+
{ name: "platform_user_playlist_id" },
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
|
|
4
|
+
|
|
5
|
+
export interface PlaybackStatusAttributes {
|
|
6
|
+
id: number;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type PlaybackStatusPk = "id";
|
|
11
|
+
export type PlaybackStatusId = PlaybackStatus[PlaybackStatusPk];
|
|
12
|
+
export type PlaybackStatusCreationAttributes = PlaybackStatusAttributes;
|
|
13
|
+
|
|
14
|
+
export class PlaybackStatus extends Model<PlaybackStatusAttributes, PlaybackStatusCreationAttributes> implements PlaybackStatusAttributes {
|
|
15
|
+
id!: number;
|
|
16
|
+
description!: string;
|
|
17
|
+
|
|
18
|
+
// PlaybackStatus hasMany JukeboxQueueEntry via playbackStatusTypeId
|
|
19
|
+
jukeboxQueueEntries!: JukeboxQueueEntry[];
|
|
20
|
+
getJukeboxQueueEntries!: Sequelize.HasManyGetAssociationsMixin<JukeboxQueueEntry>;
|
|
21
|
+
setJukeboxQueueEntries!: Sequelize.HasManySetAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
22
|
+
addJukeboxQueueEntry!: Sequelize.HasManyAddAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
23
|
+
addJukeboxQueueEntries!: Sequelize.HasManyAddAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
24
|
+
createJukeboxQueueEntry!: Sequelize.HasManyCreateAssociationMixin<JukeboxQueueEntry>;
|
|
25
|
+
removeJukeboxQueueEntry!: Sequelize.HasManyRemoveAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
26
|
+
removeJukeboxQueueEntries!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
27
|
+
hasJukeboxQueueEntry!: Sequelize.HasManyHasAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
28
|
+
hasJukeboxQueueEntries!: Sequelize.HasManyHasAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
29
|
+
countJukeboxQueueEntries!: Sequelize.HasManyCountAssociationsMixin;
|
|
30
|
+
|
|
31
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof PlaybackStatus {
|
|
32
|
+
return PlaybackStatus.init({
|
|
33
|
+
id: {
|
|
34
|
+
autoIncrement: true,
|
|
35
|
+
autoIncrementIdentity: true,
|
|
36
|
+
type: DataTypes.SMALLINT,
|
|
37
|
+
allowNull: false,
|
|
38
|
+
primaryKey: true
|
|
39
|
+
},
|
|
40
|
+
description: {
|
|
41
|
+
type: DataTypes.TEXT,
|
|
42
|
+
allowNull: false
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
sequelize,
|
|
46
|
+
tableName: 'playback_status',
|
|
47
|
+
schema: 'eb',
|
|
48
|
+
timestamps: false,
|
|
49
|
+
indexes: [
|
|
50
|
+
{
|
|
51
|
+
name: "playback_status_pkey",
|
|
52
|
+
unique: true,
|
|
53
|
+
fields: [
|
|
54
|
+
{ name: "id" },
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|