@earbug/db-models 0.0.7 → 0.0.9
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 +28 -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 +5 -5
- package/dist/CanonAlbum.js +10 -10
- package/dist/CanonAlbumImageHarvested.d.ts +9 -9
- package/dist/CanonAlbumImageHarvested.js +24 -32
- package/dist/CanonArtist.d.ts +3 -3
- 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 +5 -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 +21 -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/NewsSite.d.ts +3 -3
- package/dist/NewsSite.js +6 -6
- package/dist/Notification.d.ts +62 -0
- package/dist/Notification.js +163 -0
- package/dist/NotificationType.d.ts +26 -0
- package/dist/NotificationType.js +42 -0
- package/dist/Platform.d.ts +2 -2
- package/dist/Platform.js +7 -7
- package/dist/PlatformAlbum.d.ts +5 -5
- 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 -3
- 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.d.ts +8 -2
- package/dist/init-models.js +20 -4
- package/models/AppUser.ts +43 -18
- package/models/AppUserDevice.ts +12 -12
- package/models/AppUserFollowRelation.ts +9 -9
- package/models/AppUserPlatformRelation.ts +25 -25
- package/models/CanonAlbum.ts +15 -15
- package/models/CanonAlbumImageHarvested.ts +33 -41
- package/models/CanonArtist.ts +9 -9
- 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 +16 -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 +42 -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/NewsSite.ts +9 -9
- package/models/Notification.ts +202 -0
- package/models/NotificationType.ts +66 -0
- package/models/Platform.ts +9 -9
- package/models/PlatformAlbum.ts +15 -15
- package/models/PlatformArtist.ts +15 -15
- package/models/PlatformGenre.ts +8 -8
- package/models/PlatformTrack.ts +9 -9
- 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 +24 -2
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
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 { NotificationType, NotificationTypeId } from './NotificationType';
|
|
6
|
+
|
|
7
|
+
export interface NotificationAttributes {
|
|
8
|
+
targetUserId: string;
|
|
9
|
+
notificationTypeId: number;
|
|
10
|
+
metadata?: object;
|
|
11
|
+
readAt?: Date;
|
|
12
|
+
dismissedAt?: Date;
|
|
13
|
+
sourceUserId?: string;
|
|
14
|
+
jukeboxSessionId?: string;
|
|
15
|
+
expiresAt?: Date;
|
|
16
|
+
pushSentAt?: Date;
|
|
17
|
+
pushError?: string;
|
|
18
|
+
id: string;
|
|
19
|
+
isRead: boolean;
|
|
20
|
+
isDismissed: boolean;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
pushSent: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type NotificationPk = "id";
|
|
27
|
+
export type NotificationId = Notification[NotificationPk];
|
|
28
|
+
export type NotificationOptionalAttributes = "metadata" | "readAt" | "dismissedAt" | "sourceUserId" | "jukeboxSessionId" | "expiresAt" | "pushSentAt" | "pushError" | "id" | "createdAt" | "updatedAt";
|
|
29
|
+
export type NotificationCreationAttributes = Optional<NotificationAttributes, NotificationOptionalAttributes>;
|
|
30
|
+
|
|
31
|
+
export class Notification extends Model<NotificationAttributes, NotificationCreationAttributes> implements NotificationAttributes {
|
|
32
|
+
targetUserId!: string;
|
|
33
|
+
notificationTypeId!: number;
|
|
34
|
+
metadata?: object;
|
|
35
|
+
readAt?: Date;
|
|
36
|
+
dismissedAt?: Date;
|
|
37
|
+
sourceUserId?: string;
|
|
38
|
+
jukeboxSessionId?: string;
|
|
39
|
+
expiresAt?: Date;
|
|
40
|
+
pushSentAt?: Date;
|
|
41
|
+
pushError?: string;
|
|
42
|
+
id!: string;
|
|
43
|
+
isRead!: boolean;
|
|
44
|
+
isDismissed!: boolean;
|
|
45
|
+
createdAt!: Date;
|
|
46
|
+
updatedAt!: Date;
|
|
47
|
+
pushSent!: boolean;
|
|
48
|
+
|
|
49
|
+
// Notification belongsTo AppUser via sourceUserId
|
|
50
|
+
sourceUser!: AppUser;
|
|
51
|
+
getSourceUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
52
|
+
setSourceUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
53
|
+
createSourceUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
54
|
+
// Notification belongsTo AppUser via targetUserId
|
|
55
|
+
targetUser!: AppUser;
|
|
56
|
+
getTargetUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
57
|
+
setTargetUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
58
|
+
createTargetUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
59
|
+
// Notification belongsTo JukeboxSession via jukeboxSessionId
|
|
60
|
+
jukeboxSession!: JukeboxSession;
|
|
61
|
+
getJukeboxSession!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
|
|
62
|
+
setJukeboxSession!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
|
|
63
|
+
createJukeboxSession!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
|
|
64
|
+
// Notification belongsTo NotificationType via notificationTypeId
|
|
65
|
+
notificationType!: NotificationType;
|
|
66
|
+
getNotificationType!: Sequelize.BelongsToGetAssociationMixin<NotificationType>;
|
|
67
|
+
setNotificationType!: Sequelize.BelongsToSetAssociationMixin<NotificationType, NotificationTypeId>;
|
|
68
|
+
createNotificationType!: Sequelize.BelongsToCreateAssociationMixin<NotificationType>;
|
|
69
|
+
|
|
70
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof Notification {
|
|
71
|
+
return Notification.init({
|
|
72
|
+
targetUserId: {
|
|
73
|
+
type: DataTypes.UUID,
|
|
74
|
+
allowNull: false,
|
|
75
|
+
references: {
|
|
76
|
+
model: 'app_user',
|
|
77
|
+
key: 'id'
|
|
78
|
+
},
|
|
79
|
+
field: 'target_user_id'
|
|
80
|
+
},
|
|
81
|
+
notificationTypeId: {
|
|
82
|
+
type: DataTypes.SMALLINT,
|
|
83
|
+
allowNull: false,
|
|
84
|
+
references: {
|
|
85
|
+
model: 'notification_type',
|
|
86
|
+
key: 'id'
|
|
87
|
+
},
|
|
88
|
+
field: 'notification_type_id'
|
|
89
|
+
},
|
|
90
|
+
metadata: {
|
|
91
|
+
type: DataTypes.JSONB,
|
|
92
|
+
allowNull: true
|
|
93
|
+
},
|
|
94
|
+
readAt: {
|
|
95
|
+
type: DataTypes.DATE,
|
|
96
|
+
allowNull: true,
|
|
97
|
+
field: 'read_at'
|
|
98
|
+
},
|
|
99
|
+
dismissedAt: {
|
|
100
|
+
type: DataTypes.DATE,
|
|
101
|
+
allowNull: true,
|
|
102
|
+
field: 'dismissed_at'
|
|
103
|
+
},
|
|
104
|
+
sourceUserId: {
|
|
105
|
+
type: DataTypes.UUID,
|
|
106
|
+
allowNull: true,
|
|
107
|
+
references: {
|
|
108
|
+
model: 'app_user',
|
|
109
|
+
key: 'id'
|
|
110
|
+
},
|
|
111
|
+
field: 'source_user_id'
|
|
112
|
+
},
|
|
113
|
+
jukeboxSessionId: {
|
|
114
|
+
type: DataTypes.UUID,
|
|
115
|
+
allowNull: true,
|
|
116
|
+
references: {
|
|
117
|
+
model: 'jukebox_session',
|
|
118
|
+
key: 'id'
|
|
119
|
+
},
|
|
120
|
+
field: 'jukebox_session_id'
|
|
121
|
+
},
|
|
122
|
+
expiresAt: {
|
|
123
|
+
type: DataTypes.DATE,
|
|
124
|
+
allowNull: true,
|
|
125
|
+
field: 'expires_at'
|
|
126
|
+
},
|
|
127
|
+
pushSentAt: {
|
|
128
|
+
type: DataTypes.DATE,
|
|
129
|
+
allowNull: true,
|
|
130
|
+
field: 'push_sent_at'
|
|
131
|
+
},
|
|
132
|
+
pushError: {
|
|
133
|
+
type: DataTypes.TEXT,
|
|
134
|
+
allowNull: true,
|
|
135
|
+
field: 'push_error'
|
|
136
|
+
},
|
|
137
|
+
id: {
|
|
138
|
+
type: DataTypes.UUID,
|
|
139
|
+
allowNull: false,
|
|
140
|
+
defaultValue: DataTypes.UUIDV4,
|
|
141
|
+
primaryKey: true
|
|
142
|
+
},
|
|
143
|
+
isRead: {
|
|
144
|
+
type: DataTypes.BOOLEAN,
|
|
145
|
+
allowNull: false,
|
|
146
|
+
defaultValue: false,
|
|
147
|
+
field: 'is_read'
|
|
148
|
+
},
|
|
149
|
+
isDismissed: {
|
|
150
|
+
type: DataTypes.BOOLEAN,
|
|
151
|
+
allowNull: false,
|
|
152
|
+
defaultValue: false,
|
|
153
|
+
field: 'is_dismissed'
|
|
154
|
+
},
|
|
155
|
+
createdAt: {
|
|
156
|
+
type: DataTypes.DATE,
|
|
157
|
+
allowNull: false,
|
|
158
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
159
|
+
field: 'created_at'
|
|
160
|
+
},
|
|
161
|
+
updatedAt: {
|
|
162
|
+
type: DataTypes.DATE,
|
|
163
|
+
allowNull: false,
|
|
164
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
165
|
+
field: 'updated_at'
|
|
166
|
+
},
|
|
167
|
+
pushSent: {
|
|
168
|
+
type: DataTypes.BOOLEAN,
|
|
169
|
+
allowNull: false,
|
|
170
|
+
defaultValue: false,
|
|
171
|
+
field: 'push_sent'
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
sequelize,
|
|
175
|
+
tableName: 'notification',
|
|
176
|
+
schema: 'eb',
|
|
177
|
+
timestamps: false,
|
|
178
|
+
indexes: [
|
|
179
|
+
{
|
|
180
|
+
name: "idx_notification_expires_at",
|
|
181
|
+
fields: [
|
|
182
|
+
{ name: "expires_at" },
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "idx_notification_target_user_created_at",
|
|
187
|
+
fields: [
|
|
188
|
+
{ name: "target_user_id" },
|
|
189
|
+
{ name: "created_at", order: "DESC" },
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "notification_pkey",
|
|
194
|
+
unique: true,
|
|
195
|
+
fields: [
|
|
196
|
+
{ name: "id" },
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
]
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { Notification, NotificationId } from './Notification';
|
|
4
|
+
|
|
5
|
+
export interface NotificationTypeAttributes {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type NotificationTypePk = "id";
|
|
11
|
+
export type NotificationTypeId = NotificationType[NotificationTypePk];
|
|
12
|
+
export type NotificationTypeCreationAttributes = NotificationTypeAttributes;
|
|
13
|
+
|
|
14
|
+
export class NotificationType extends Model<NotificationTypeAttributes, NotificationTypeCreationAttributes> implements NotificationTypeAttributes {
|
|
15
|
+
id!: number;
|
|
16
|
+
name!: string;
|
|
17
|
+
|
|
18
|
+
// NotificationType hasMany Notification via notificationTypeId
|
|
19
|
+
notifications!: Notification[];
|
|
20
|
+
getNotifications!: Sequelize.HasManyGetAssociationsMixin<Notification>;
|
|
21
|
+
setNotifications!: Sequelize.HasManySetAssociationsMixin<Notification, NotificationId>;
|
|
22
|
+
addNotification!: Sequelize.HasManyAddAssociationMixin<Notification, NotificationId>;
|
|
23
|
+
addNotifications!: Sequelize.HasManyAddAssociationsMixin<Notification, NotificationId>;
|
|
24
|
+
createNotification!: Sequelize.HasManyCreateAssociationMixin<Notification>;
|
|
25
|
+
removeNotification!: Sequelize.HasManyRemoveAssociationMixin<Notification, NotificationId>;
|
|
26
|
+
removeNotifications!: Sequelize.HasManyRemoveAssociationsMixin<Notification, NotificationId>;
|
|
27
|
+
hasNotification!: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
|
|
28
|
+
hasNotifications!: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
|
|
29
|
+
countNotifications!: Sequelize.HasManyCountAssociationsMixin;
|
|
30
|
+
|
|
31
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof NotificationType {
|
|
32
|
+
return NotificationType.init({
|
|
33
|
+
id: {
|
|
34
|
+
type: DataTypes.SMALLINT,
|
|
35
|
+
allowNull: false,
|
|
36
|
+
primaryKey: true
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
type: DataTypes.TEXT,
|
|
40
|
+
allowNull: false,
|
|
41
|
+
unique: "notification_type_name_unique"
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
sequelize,
|
|
45
|
+
tableName: 'notification_type',
|
|
46
|
+
schema: 'eb',
|
|
47
|
+
timestamps: false,
|
|
48
|
+
indexes: [
|
|
49
|
+
{
|
|
50
|
+
name: "notification_type_name_unique",
|
|
51
|
+
unique: true,
|
|
52
|
+
fields: [
|
|
53
|
+
{ name: "name" },
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "notification_type_pkey",
|
|
58
|
+
unique: true,
|
|
59
|
+
fields: [
|
|
60
|
+
{ name: "id" },
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
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
|
@@ -19,7 +19,6 @@ import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum
|
|
|
19
19
|
import type { UnmatchedAlbum, UnmatchedAlbumId } from './UnmatchedAlbum';
|
|
20
20
|
|
|
21
21
|
export interface PlatformAlbumAttributes {
|
|
22
|
-
id: string;
|
|
23
22
|
platformId: number;
|
|
24
23
|
externalAlbumId: string;
|
|
25
24
|
name: string;
|
|
@@ -28,20 +27,20 @@ export interface PlatformAlbumAttributes {
|
|
|
28
27
|
releaseDate?: string;
|
|
29
28
|
popularity?: number;
|
|
30
29
|
recordLabel?: string;
|
|
30
|
+
images?: object;
|
|
31
|
+
id: string;
|
|
31
32
|
createDate: Date;
|
|
32
33
|
updateDate: Date;
|
|
33
|
-
images?: object;
|
|
34
34
|
lastHarvestDate?: Date;
|
|
35
35
|
lastHarvestLog?: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export type PlatformAlbumPk = "id";
|
|
39
39
|
export type PlatformAlbumId = PlatformAlbum[PlatformAlbumPk];
|
|
40
|
-
export type PlatformAlbumOptionalAttributes = "
|
|
40
|
+
export type PlatformAlbumOptionalAttributes = "albumType" | "releaseDate" | "popularity" | "recordLabel" | "images" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
|
|
41
41
|
export type PlatformAlbumCreationAttributes = Optional<PlatformAlbumAttributes, PlatformAlbumOptionalAttributes>;
|
|
42
42
|
|
|
43
43
|
export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumCreationAttributes> implements PlatformAlbumAttributes {
|
|
44
|
-
id!: string;
|
|
45
44
|
platformId!: number;
|
|
46
45
|
externalAlbumId!: string;
|
|
47
46
|
name!: string;
|
|
@@ -50,9 +49,10 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
50
49
|
releaseDate?: string;
|
|
51
50
|
popularity?: number;
|
|
52
51
|
recordLabel?: string;
|
|
52
|
+
images?: object;
|
|
53
|
+
id!: string;
|
|
53
54
|
createDate!: Date;
|
|
54
55
|
updateDate!: Date;
|
|
55
|
-
images?: object;
|
|
56
56
|
lastHarvestDate?: Date;
|
|
57
57
|
lastHarvestLog?: string;
|
|
58
58
|
|
|
@@ -256,12 +256,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
256
256
|
|
|
257
257
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformAlbum {
|
|
258
258
|
return PlatformAlbum.init({
|
|
259
|
-
id: {
|
|
260
|
-
type: DataTypes.UUID,
|
|
261
|
-
allowNull: false,
|
|
262
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
263
|
-
primaryKey: true
|
|
264
|
-
},
|
|
265
259
|
platformId: {
|
|
266
260
|
type: DataTypes.SMALLINT,
|
|
267
261
|
allowNull: false,
|
|
@@ -306,6 +300,16 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
306
300
|
allowNull: true,
|
|
307
301
|
field: 'record_label'
|
|
308
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
|
+
},
|
|
309
313
|
createDate: {
|
|
310
314
|
type: DataTypes.DATE,
|
|
311
315
|
allowNull: false,
|
|
@@ -318,10 +322,6 @@ export class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumC
|
|
|
318
322
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
319
323
|
field: 'update_date'
|
|
320
324
|
},
|
|
321
|
-
images: {
|
|
322
|
-
type: DataTypes.JSONB,
|
|
323
|
-
allowNull: true
|
|
324
|
-
},
|
|
325
325
|
lastHarvestDate: {
|
|
326
326
|
type: DataTypes.DATE,
|
|
327
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
|
@@ -13,7 +13,6 @@ import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './Platfor
|
|
|
13
13
|
import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
|
|
14
14
|
|
|
15
15
|
export interface PlatformTrackAttributes {
|
|
16
|
-
id: string;
|
|
17
16
|
platformId: number;
|
|
18
17
|
externalTrackId: string;
|
|
19
18
|
name: string;
|
|
@@ -23,6 +22,7 @@ export interface PlatformTrackAttributes {
|
|
|
23
22
|
popularity?: number;
|
|
24
23
|
discNumber?: number;
|
|
25
24
|
discTrackNumber?: number;
|
|
25
|
+
id: string;
|
|
26
26
|
createDate: Date;
|
|
27
27
|
updateDate: Date;
|
|
28
28
|
lastHarvestDate?: Date;
|
|
@@ -31,11 +31,10 @@ export interface PlatformTrackAttributes {
|
|
|
31
31
|
|
|
32
32
|
export type PlatformTrackPk = "id";
|
|
33
33
|
export type PlatformTrackId = PlatformTrack[PlatformTrackPk];
|
|
34
|
-
export type PlatformTrackOptionalAttributes = "
|
|
34
|
+
export type PlatformTrackOptionalAttributes = "explicit" | "popularity" | "discNumber" | "discTrackNumber" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
|
|
35
35
|
export type PlatformTrackCreationAttributes = Optional<PlatformTrackAttributes, PlatformTrackOptionalAttributes>;
|
|
36
36
|
|
|
37
37
|
export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackCreationAttributes> implements PlatformTrackAttributes {
|
|
38
|
-
id!: string;
|
|
39
38
|
platformId!: number;
|
|
40
39
|
externalTrackId!: string;
|
|
41
40
|
name!: string;
|
|
@@ -45,6 +44,7 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
45
44
|
popularity?: number;
|
|
46
45
|
discNumber?: number;
|
|
47
46
|
discTrackNumber?: number;
|
|
47
|
+
id!: string;
|
|
48
48
|
createDate!: Date;
|
|
49
49
|
updateDate!: Date;
|
|
50
50
|
lastHarvestDate?: Date;
|
|
@@ -178,12 +178,6 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
178
178
|
|
|
179
179
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlatformTrack {
|
|
180
180
|
return PlatformTrack.init({
|
|
181
|
-
id: {
|
|
182
|
-
type: DataTypes.UUID,
|
|
183
|
-
allowNull: false,
|
|
184
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
185
|
-
primaryKey: true
|
|
186
|
-
},
|
|
187
181
|
platformId: {
|
|
188
182
|
type: DataTypes.SMALLINT,
|
|
189
183
|
allowNull: false,
|
|
@@ -232,6 +226,12 @@ export class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackC
|
|
|
232
226
|
allowNull: true,
|
|
233
227
|
field: 'disc_track_number'
|
|
234
228
|
},
|
|
229
|
+
id: {
|
|
230
|
+
type: DataTypes.UUID,
|
|
231
|
+
allowNull: false,
|
|
232
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
233
|
+
primaryKey: true
|
|
234
|
+
},
|
|
235
235
|
createDate: {
|
|
236
236
|
type: DataTypes.DATE,
|
|
237
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,
|