@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,267 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUserDevice, AppUserDeviceId } from './AppUserDevice';
|
|
4
|
+
import type { AppUserFollowRelation, AppUserFollowRelationId } from './AppUserFollowRelation';
|
|
5
|
+
import type { AppUserPlatformRelation, AppUserPlatformRelationCreationAttributes, AppUserPlatformRelationId } from './AppUserPlatformRelation';
|
|
6
|
+
import type { JukeboxInvite, JukeboxInviteId } from './JukeboxInvite';
|
|
7
|
+
import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
|
|
8
|
+
import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
|
|
9
|
+
import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
|
|
10
|
+
import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
|
|
11
|
+
import type { State, StateId } from './State';
|
|
12
|
+
import type { UserContacts, UserContactsId } from './UserContacts';
|
|
13
|
+
|
|
14
|
+
export interface AppUserAttributes {
|
|
15
|
+
id: string;
|
|
16
|
+
email: string;
|
|
17
|
+
firstName: string;
|
|
18
|
+
createDate: Date;
|
|
19
|
+
updateDate: Date;
|
|
20
|
+
stateId: number;
|
|
21
|
+
syncContacts?: boolean;
|
|
22
|
+
lastName?: string;
|
|
23
|
+
autoApproveFollowers: boolean;
|
|
24
|
+
lastHarvested?: Date;
|
|
25
|
+
lastHarvestedError?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type AppUserPk = "id";
|
|
29
|
+
export type AppUserId = AppUser[AppUserPk];
|
|
30
|
+
export type AppUserOptionalAttributes = "id" | "createDate" | "updateDate" | "stateId" | "syncContacts" | "lastName" | "autoApproveFollowers" | "lastHarvested" | "lastHarvestedError";
|
|
31
|
+
export type AppUserCreationAttributes = Optional<AppUserAttributes, AppUserOptionalAttributes>;
|
|
32
|
+
|
|
33
|
+
export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes> implements AppUserAttributes {
|
|
34
|
+
id!: string;
|
|
35
|
+
email!: string;
|
|
36
|
+
firstName!: string;
|
|
37
|
+
createDate!: Date;
|
|
38
|
+
updateDate!: Date;
|
|
39
|
+
stateId!: number;
|
|
40
|
+
syncContacts?: boolean;
|
|
41
|
+
lastName?: string;
|
|
42
|
+
autoApproveFollowers!: boolean;
|
|
43
|
+
lastHarvested?: Date;
|
|
44
|
+
lastHarvestedError?: string;
|
|
45
|
+
|
|
46
|
+
// AppUser hasMany AppUserDevice via appUserId
|
|
47
|
+
appUserDevices!: AppUserDevice[];
|
|
48
|
+
getAppUserDevices!: Sequelize.HasManyGetAssociationsMixin<AppUserDevice>;
|
|
49
|
+
setAppUserDevices!: Sequelize.HasManySetAssociationsMixin<AppUserDevice, AppUserDeviceId>;
|
|
50
|
+
addAppUserDevice!: Sequelize.HasManyAddAssociationMixin<AppUserDevice, AppUserDeviceId>;
|
|
51
|
+
addAppUserDevices!: Sequelize.HasManyAddAssociationsMixin<AppUserDevice, AppUserDeviceId>;
|
|
52
|
+
createAppUserDevice!: Sequelize.HasManyCreateAssociationMixin<AppUserDevice>;
|
|
53
|
+
removeAppUserDevice!: Sequelize.HasManyRemoveAssociationMixin<AppUserDevice, AppUserDeviceId>;
|
|
54
|
+
removeAppUserDevices!: Sequelize.HasManyRemoveAssociationsMixin<AppUserDevice, AppUserDeviceId>;
|
|
55
|
+
hasAppUserDevice!: Sequelize.HasManyHasAssociationMixin<AppUserDevice, AppUserDeviceId>;
|
|
56
|
+
hasAppUserDevices!: Sequelize.HasManyHasAssociationsMixin<AppUserDevice, AppUserDeviceId>;
|
|
57
|
+
countAppUserDevices!: Sequelize.HasManyCountAssociationsMixin;
|
|
58
|
+
// AppUser hasMany AppUserFollowRelation via appUserId
|
|
59
|
+
appUserFollowRelations!: AppUserFollowRelation[];
|
|
60
|
+
getAppUserFollowRelations!: Sequelize.HasManyGetAssociationsMixin<AppUserFollowRelation>;
|
|
61
|
+
setAppUserFollowRelations!: Sequelize.HasManySetAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
62
|
+
addAppUserFollowRelation!: Sequelize.HasManyAddAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
63
|
+
addAppUserFollowRelations!: Sequelize.HasManyAddAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
64
|
+
createAppUserFollowRelation!: Sequelize.HasManyCreateAssociationMixin<AppUserFollowRelation>;
|
|
65
|
+
removeAppUserFollowRelation!: Sequelize.HasManyRemoveAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
66
|
+
removeAppUserFollowRelations!: Sequelize.HasManyRemoveAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
67
|
+
hasAppUserFollowRelation!: Sequelize.HasManyHasAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
68
|
+
hasAppUserFollowRelations!: Sequelize.HasManyHasAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
69
|
+
countAppUserFollowRelations!: Sequelize.HasManyCountAssociationsMixin;
|
|
70
|
+
// AppUser hasMany AppUserFollowRelation via followingAppUserId
|
|
71
|
+
followingAppUserAppUserFollowRelations!: AppUserFollowRelation[];
|
|
72
|
+
getFollowingAppUserAppUserFollowRelations!: Sequelize.HasManyGetAssociationsMixin<AppUserFollowRelation>;
|
|
73
|
+
setFollowingAppUserAppUserFollowRelations!: Sequelize.HasManySetAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
74
|
+
addFollowingAppUserAppUserFollowRelation!: Sequelize.HasManyAddAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
75
|
+
addFollowingAppUserAppUserFollowRelations!: Sequelize.HasManyAddAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
76
|
+
createFollowingAppUserAppUserFollowRelation!: Sequelize.HasManyCreateAssociationMixin<AppUserFollowRelation>;
|
|
77
|
+
removeFollowingAppUserAppUserFollowRelation!: Sequelize.HasManyRemoveAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
78
|
+
removeFollowingAppUserAppUserFollowRelations!: Sequelize.HasManyRemoveAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
79
|
+
hasFollowingAppUserAppUserFollowRelation!: Sequelize.HasManyHasAssociationMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
80
|
+
hasFollowingAppUserAppUserFollowRelations!: Sequelize.HasManyHasAssociationsMixin<AppUserFollowRelation, AppUserFollowRelationId>;
|
|
81
|
+
countFollowingAppUserAppUserFollowRelations!: Sequelize.HasManyCountAssociationsMixin;
|
|
82
|
+
// AppUser hasOne AppUserPlatformRelation via appUserId
|
|
83
|
+
appUserPlatformRelation!: AppUserPlatformRelation;
|
|
84
|
+
getAppUserPlatformRelation!: Sequelize.HasOneGetAssociationMixin<AppUserPlatformRelation>;
|
|
85
|
+
setAppUserPlatformRelation!: Sequelize.HasOneSetAssociationMixin<AppUserPlatformRelation, AppUserPlatformRelationId>;
|
|
86
|
+
createAppUserPlatformRelation!: Sequelize.HasOneCreateAssociationMixin<AppUserPlatformRelation>;
|
|
87
|
+
// AppUser hasMany JukeboxInvite via invitedUserId
|
|
88
|
+
jukeboxInvites!: JukeboxInvite[];
|
|
89
|
+
getJukeboxInvites!: Sequelize.HasManyGetAssociationsMixin<JukeboxInvite>;
|
|
90
|
+
setJukeboxInvites!: Sequelize.HasManySetAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
91
|
+
addJukeboxInvite!: Sequelize.HasManyAddAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
92
|
+
addJukeboxInvites!: Sequelize.HasManyAddAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
93
|
+
createJukeboxInvite!: Sequelize.HasManyCreateAssociationMixin<JukeboxInvite>;
|
|
94
|
+
removeJukeboxInvite!: Sequelize.HasManyRemoveAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
95
|
+
removeJukeboxInvites!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
96
|
+
hasJukeboxInvite!: Sequelize.HasManyHasAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
97
|
+
hasJukeboxInvites!: Sequelize.HasManyHasAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
98
|
+
countJukeboxInvites!: Sequelize.HasManyCountAssociationsMixin;
|
|
99
|
+
// AppUser hasMany JukeboxInvite via inviterUserId
|
|
100
|
+
inviterUserJukeboxInvites!: JukeboxInvite[];
|
|
101
|
+
getInviterUserJukeboxInvites!: Sequelize.HasManyGetAssociationsMixin<JukeboxInvite>;
|
|
102
|
+
setInviterUserJukeboxInvites!: Sequelize.HasManySetAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
103
|
+
addInviterUserJukeboxInvite!: Sequelize.HasManyAddAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
104
|
+
addInviterUserJukeboxInvites!: Sequelize.HasManyAddAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
105
|
+
createInviterUserJukeboxInvite!: Sequelize.HasManyCreateAssociationMixin<JukeboxInvite>;
|
|
106
|
+
removeInviterUserJukeboxInvite!: Sequelize.HasManyRemoveAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
107
|
+
removeInviterUserJukeboxInvites!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
108
|
+
hasInviterUserJukeboxInvite!: Sequelize.HasManyHasAssociationMixin<JukeboxInvite, JukeboxInviteId>;
|
|
109
|
+
hasInviterUserJukeboxInvites!: Sequelize.HasManyHasAssociationsMixin<JukeboxInvite, JukeboxInviteId>;
|
|
110
|
+
countInviterUserJukeboxInvites!: Sequelize.HasManyCountAssociationsMixin;
|
|
111
|
+
// AppUser hasMany JukeboxQueueEntry via trackAddedUserId
|
|
112
|
+
jukeboxQueueEntries!: JukeboxQueueEntry[];
|
|
113
|
+
getJukeboxQueueEntries!: Sequelize.HasManyGetAssociationsMixin<JukeboxQueueEntry>;
|
|
114
|
+
setJukeboxQueueEntries!: Sequelize.HasManySetAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
115
|
+
addJukeboxQueueEntry!: Sequelize.HasManyAddAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
116
|
+
addJukeboxQueueEntries!: Sequelize.HasManyAddAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
117
|
+
createJukeboxQueueEntry!: Sequelize.HasManyCreateAssociationMixin<JukeboxQueueEntry>;
|
|
118
|
+
removeJukeboxQueueEntry!: Sequelize.HasManyRemoveAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
119
|
+
removeJukeboxQueueEntries!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
120
|
+
hasJukeboxQueueEntry!: Sequelize.HasManyHasAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
121
|
+
hasJukeboxQueueEntries!: Sequelize.HasManyHasAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
122
|
+
countJukeboxQueueEntries!: Sequelize.HasManyCountAssociationsMixin;
|
|
123
|
+
// AppUser hasMany JukeboxUser via appUserId
|
|
124
|
+
jukeboxUsers!: JukeboxUser[];
|
|
125
|
+
getJukeboxUsers!: Sequelize.HasManyGetAssociationsMixin<JukeboxUser>;
|
|
126
|
+
setJukeboxUsers!: Sequelize.HasManySetAssociationsMixin<JukeboxUser, JukeboxUserId>;
|
|
127
|
+
addJukeboxUser!: Sequelize.HasManyAddAssociationMixin<JukeboxUser, JukeboxUserId>;
|
|
128
|
+
addJukeboxUsers!: Sequelize.HasManyAddAssociationsMixin<JukeboxUser, JukeboxUserId>;
|
|
129
|
+
createJukeboxUser!: Sequelize.HasManyCreateAssociationMixin<JukeboxUser>;
|
|
130
|
+
removeJukeboxUser!: Sequelize.HasManyRemoveAssociationMixin<JukeboxUser, JukeboxUserId>;
|
|
131
|
+
removeJukeboxUsers!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxUser, JukeboxUserId>;
|
|
132
|
+
hasJukeboxUser!: Sequelize.HasManyHasAssociationMixin<JukeboxUser, JukeboxUserId>;
|
|
133
|
+
hasJukeboxUsers!: Sequelize.HasManyHasAssociationsMixin<JukeboxUser, JukeboxUserId>;
|
|
134
|
+
countJukeboxUsers!: Sequelize.HasManyCountAssociationsMixin;
|
|
135
|
+
// AppUser hasMany PlatformUserAlbum via appUserId
|
|
136
|
+
platformUserAlbums!: PlatformUserAlbum[];
|
|
137
|
+
getPlatformUserAlbums!: Sequelize.HasManyGetAssociationsMixin<PlatformUserAlbum>;
|
|
138
|
+
setPlatformUserAlbums!: Sequelize.HasManySetAssociationsMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
139
|
+
addPlatformUserAlbum!: Sequelize.HasManyAddAssociationMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
140
|
+
addPlatformUserAlbums!: Sequelize.HasManyAddAssociationsMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
141
|
+
createPlatformUserAlbum!: Sequelize.HasManyCreateAssociationMixin<PlatformUserAlbum>;
|
|
142
|
+
removePlatformUserAlbum!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
143
|
+
removePlatformUserAlbums!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
144
|
+
hasPlatformUserAlbum!: Sequelize.HasManyHasAssociationMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
145
|
+
hasPlatformUserAlbums!: Sequelize.HasManyHasAssociationsMixin<PlatformUserAlbum, PlatformUserAlbumId>;
|
|
146
|
+
countPlatformUserAlbums!: Sequelize.HasManyCountAssociationsMixin;
|
|
147
|
+
// AppUser hasMany PlatformUserPlaylist via appUserId
|
|
148
|
+
platformUserPlaylists!: PlatformUserPlaylist[];
|
|
149
|
+
getPlatformUserPlaylists!: Sequelize.HasManyGetAssociationsMixin<PlatformUserPlaylist>;
|
|
150
|
+
setPlatformUserPlaylists!: Sequelize.HasManySetAssociationsMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
151
|
+
addPlatformUserPlaylist!: Sequelize.HasManyAddAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
152
|
+
addPlatformUserPlaylists!: Sequelize.HasManyAddAssociationsMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
153
|
+
createPlatformUserPlaylist!: Sequelize.HasManyCreateAssociationMixin<PlatformUserPlaylist>;
|
|
154
|
+
removePlatformUserPlaylist!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
155
|
+
removePlatformUserPlaylists!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
156
|
+
hasPlatformUserPlaylist!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
157
|
+
hasPlatformUserPlaylists!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
|
|
158
|
+
countPlatformUserPlaylists!: Sequelize.HasManyCountAssociationsMixin;
|
|
159
|
+
// AppUser hasMany UserContacts via appUserId
|
|
160
|
+
userContacts!: UserContacts[];
|
|
161
|
+
getUserContacts!: Sequelize.HasManyGetAssociationsMixin<UserContacts>;
|
|
162
|
+
setUserContacts!: Sequelize.HasManySetAssociationsMixin<UserContacts, UserContactsId>;
|
|
163
|
+
addUserContact!: Sequelize.HasManyAddAssociationMixin<UserContacts, UserContactsId>;
|
|
164
|
+
addUserContacts!: Sequelize.HasManyAddAssociationsMixin<UserContacts, UserContactsId>;
|
|
165
|
+
createUserContact!: Sequelize.HasManyCreateAssociationMixin<UserContacts>;
|
|
166
|
+
removeUserContact!: Sequelize.HasManyRemoveAssociationMixin<UserContacts, UserContactsId>;
|
|
167
|
+
removeUserContacts!: Sequelize.HasManyRemoveAssociationsMixin<UserContacts, UserContactsId>;
|
|
168
|
+
hasUserContact!: Sequelize.HasManyHasAssociationMixin<UserContacts, UserContactsId>;
|
|
169
|
+
hasUserContacts!: Sequelize.HasManyHasAssociationsMixin<UserContacts, UserContactsId>;
|
|
170
|
+
countUserContacts!: Sequelize.HasManyCountAssociationsMixin;
|
|
171
|
+
// AppUser belongsTo State via stateId
|
|
172
|
+
state!: State;
|
|
173
|
+
getState!: Sequelize.BelongsToGetAssociationMixin<State>;
|
|
174
|
+
setState!: Sequelize.BelongsToSetAssociationMixin<State, StateId>;
|
|
175
|
+
createState!: Sequelize.BelongsToCreateAssociationMixin<State>;
|
|
176
|
+
|
|
177
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof AppUser {
|
|
178
|
+
return AppUser.init({
|
|
179
|
+
id: {
|
|
180
|
+
type: DataTypes.UUID,
|
|
181
|
+
allowNull: false,
|
|
182
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
183
|
+
primaryKey: true
|
|
184
|
+
},
|
|
185
|
+
email: {
|
|
186
|
+
type: DataTypes.TEXT,
|
|
187
|
+
allowNull: false,
|
|
188
|
+
unique: "uk_app_user_email"
|
|
189
|
+
},
|
|
190
|
+
firstName: {
|
|
191
|
+
type: DataTypes.TEXT,
|
|
192
|
+
allowNull: false,
|
|
193
|
+
field: 'first_name'
|
|
194
|
+
},
|
|
195
|
+
createDate: {
|
|
196
|
+
type: DataTypes.DATE,
|
|
197
|
+
allowNull: false,
|
|
198
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
199
|
+
field: 'create_date'
|
|
200
|
+
},
|
|
201
|
+
updateDate: {
|
|
202
|
+
type: DataTypes.DATE,
|
|
203
|
+
allowNull: false,
|
|
204
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
205
|
+
field: 'update_date'
|
|
206
|
+
},
|
|
207
|
+
stateId: {
|
|
208
|
+
type: DataTypes.SMALLINT,
|
|
209
|
+
allowNull: false,
|
|
210
|
+
defaultValue: 0,
|
|
211
|
+
references: {
|
|
212
|
+
model: 'state',
|
|
213
|
+
key: 'id'
|
|
214
|
+
},
|
|
215
|
+
field: 'state_id'
|
|
216
|
+
},
|
|
217
|
+
syncContacts: {
|
|
218
|
+
type: DataTypes.BOOLEAN,
|
|
219
|
+
allowNull: true,
|
|
220
|
+
defaultValue: false,
|
|
221
|
+
field: 'sync_contacts'
|
|
222
|
+
},
|
|
223
|
+
lastName: {
|
|
224
|
+
type: DataTypes.TEXT,
|
|
225
|
+
allowNull: true,
|
|
226
|
+
field: 'last_name'
|
|
227
|
+
},
|
|
228
|
+
autoApproveFollowers: {
|
|
229
|
+
type: DataTypes.BOOLEAN,
|
|
230
|
+
allowNull: false,
|
|
231
|
+
defaultValue: true,
|
|
232
|
+
field: 'auto_approve_followers'
|
|
233
|
+
},
|
|
234
|
+
lastHarvested: {
|
|
235
|
+
type: DataTypes.DATE,
|
|
236
|
+
allowNull: true,
|
|
237
|
+
field: 'last_harvested'
|
|
238
|
+
},
|
|
239
|
+
lastHarvestedError: {
|
|
240
|
+
type: DataTypes.STRING(512),
|
|
241
|
+
allowNull: true,
|
|
242
|
+
field: 'last_harvested_error'
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
sequelize,
|
|
246
|
+
tableName: 'app_user',
|
|
247
|
+
schema: 'eb',
|
|
248
|
+
timestamps: false,
|
|
249
|
+
indexes: [
|
|
250
|
+
{
|
|
251
|
+
name: "app_user_pkey",
|
|
252
|
+
unique: true,
|
|
253
|
+
fields: [
|
|
254
|
+
{ name: "id" },
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "uk_app_user_email",
|
|
259
|
+
unique: true,
|
|
260
|
+
fields: [
|
|
261
|
+
{ name: "email" },
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
]
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
|
|
5
|
+
export interface AppUserDeviceAttributes {
|
|
6
|
+
id: string;
|
|
7
|
+
appUserId: string;
|
|
8
|
+
devicePlatformId: number;
|
|
9
|
+
endpointArn: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AppUserDevicePk = "id";
|
|
14
|
+
export type AppUserDeviceId = AppUserDevice[AppUserDevicePk];
|
|
15
|
+
export type AppUserDeviceOptionalAttributes = "id" | "createdAt";
|
|
16
|
+
export type AppUserDeviceCreationAttributes = Optional<AppUserDeviceAttributes, AppUserDeviceOptionalAttributes>;
|
|
17
|
+
|
|
18
|
+
export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceCreationAttributes> implements AppUserDeviceAttributes {
|
|
19
|
+
id!: string;
|
|
20
|
+
appUserId!: string;
|
|
21
|
+
devicePlatformId!: number;
|
|
22
|
+
endpointArn!: string;
|
|
23
|
+
createdAt!: Date;
|
|
24
|
+
|
|
25
|
+
// AppUserDevice belongsTo AppUser via appUserId
|
|
26
|
+
appUser!: AppUser;
|
|
27
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
28
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
29
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
30
|
+
|
|
31
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof AppUserDevice {
|
|
32
|
+
return AppUserDevice.init({
|
|
33
|
+
id: {
|
|
34
|
+
type: DataTypes.UUID,
|
|
35
|
+
allowNull: false,
|
|
36
|
+
defaultValue: DataTypes.UUIDV4,
|
|
37
|
+
primaryKey: true
|
|
38
|
+
},
|
|
39
|
+
appUserId: {
|
|
40
|
+
type: DataTypes.UUID,
|
|
41
|
+
allowNull: false,
|
|
42
|
+
references: {
|
|
43
|
+
model: 'app_user',
|
|
44
|
+
key: 'id'
|
|
45
|
+
},
|
|
46
|
+
field: 'app_user_id'
|
|
47
|
+
},
|
|
48
|
+
devicePlatformId: {
|
|
49
|
+
type: DataTypes.SMALLINT,
|
|
50
|
+
allowNull: false,
|
|
51
|
+
field: 'device_platform_id'
|
|
52
|
+
},
|
|
53
|
+
endpointArn: {
|
|
54
|
+
type: DataTypes.TEXT,
|
|
55
|
+
allowNull: false,
|
|
56
|
+
unique: "unique_app_user_device_endpoint_arn",
|
|
57
|
+
field: 'endpoint_arn'
|
|
58
|
+
},
|
|
59
|
+
createdAt: {
|
|
60
|
+
type: DataTypes.DATE,
|
|
61
|
+
allowNull: false,
|
|
62
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
63
|
+
field: 'created_at'
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
sequelize,
|
|
67
|
+
tableName: 'app_user_device',
|
|
68
|
+
schema: 'eb',
|
|
69
|
+
timestamps: false,
|
|
70
|
+
indexes: [
|
|
71
|
+
{
|
|
72
|
+
name: "app_user_device_pkey",
|
|
73
|
+
unique: true,
|
|
74
|
+
fields: [
|
|
75
|
+
{ name: "id" },
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "unique_app_user_device_endpoint_arn",
|
|
80
|
+
unique: true,
|
|
81
|
+
fields: [
|
|
82
|
+
{ name: "endpoint_arn" },
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
+
|
|
5
|
+
export interface AppUserFollowRelationAttributes {
|
|
6
|
+
id: string;
|
|
7
|
+
appUserId: string;
|
|
8
|
+
followingAppUserId: string;
|
|
9
|
+
stateId: number;
|
|
10
|
+
isBlocked: boolean;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type AppUserFollowRelationPk = "id";
|
|
16
|
+
export type AppUserFollowRelationId = AppUserFollowRelation[AppUserFollowRelationPk];
|
|
17
|
+
export type AppUserFollowRelationOptionalAttributes = "id" | "stateId" | "createdAt" | "updatedAt";
|
|
18
|
+
export type AppUserFollowRelationCreationAttributes = Optional<AppUserFollowRelationAttributes, AppUserFollowRelationOptionalAttributes>;
|
|
19
|
+
|
|
20
|
+
export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes, AppUserFollowRelationCreationAttributes> implements AppUserFollowRelationAttributes {
|
|
21
|
+
id!: string;
|
|
22
|
+
appUserId!: string;
|
|
23
|
+
followingAppUserId!: string;
|
|
24
|
+
stateId!: number;
|
|
25
|
+
isBlocked!: boolean;
|
|
26
|
+
createdAt!: Date;
|
|
27
|
+
updatedAt!: Date;
|
|
28
|
+
|
|
29
|
+
// AppUserFollowRelation belongsTo AppUser via appUserId
|
|
30
|
+
appUser!: AppUser;
|
|
31
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
32
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
33
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
34
|
+
// AppUserFollowRelation belongsTo AppUser via followingAppUserId
|
|
35
|
+
followingAppUser!: AppUser;
|
|
36
|
+
getFollowingAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
37
|
+
setFollowingAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
38
|
+
createFollowingAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
39
|
+
|
|
40
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof AppUserFollowRelation {
|
|
41
|
+
return AppUserFollowRelation.init({
|
|
42
|
+
id: {
|
|
43
|
+
type: DataTypes.UUID,
|
|
44
|
+
allowNull: false,
|
|
45
|
+
defaultValue: DataTypes.UUIDV4,
|
|
46
|
+
primaryKey: true
|
|
47
|
+
},
|
|
48
|
+
appUserId: {
|
|
49
|
+
type: DataTypes.UUID,
|
|
50
|
+
allowNull: false,
|
|
51
|
+
references: {
|
|
52
|
+
model: 'app_user',
|
|
53
|
+
key: 'id'
|
|
54
|
+
},
|
|
55
|
+
unique: "unique_app_user_followers",
|
|
56
|
+
field: 'app_user_id'
|
|
57
|
+
},
|
|
58
|
+
followingAppUserId: {
|
|
59
|
+
type: DataTypes.UUID,
|
|
60
|
+
allowNull: false,
|
|
61
|
+
references: {
|
|
62
|
+
model: 'app_user',
|
|
63
|
+
key: 'id'
|
|
64
|
+
},
|
|
65
|
+
unique: "unique_app_user_followers",
|
|
66
|
+
field: 'following_app_user_id'
|
|
67
|
+
},
|
|
68
|
+
stateId: {
|
|
69
|
+
type: DataTypes.SMALLINT,
|
|
70
|
+
allowNull: false,
|
|
71
|
+
defaultValue: 0,
|
|
72
|
+
field: 'state_id'
|
|
73
|
+
},
|
|
74
|
+
isBlocked: {
|
|
75
|
+
type: DataTypes.BOOLEAN,
|
|
76
|
+
allowNull: false,
|
|
77
|
+
defaultValue: false,
|
|
78
|
+
field: 'is_blocked'
|
|
79
|
+
},
|
|
80
|
+
createdAt: {
|
|
81
|
+
type: DataTypes.DATE,
|
|
82
|
+
allowNull: false,
|
|
83
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
84
|
+
field: 'created_at'
|
|
85
|
+
},
|
|
86
|
+
updatedAt: {
|
|
87
|
+
type: DataTypes.DATE,
|
|
88
|
+
allowNull: false,
|
|
89
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
90
|
+
field: 'updated_at'
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
sequelize,
|
|
94
|
+
tableName: 'app_user_follow_relation',
|
|
95
|
+
schema: 'eb',
|
|
96
|
+
timestamps: false,
|
|
97
|
+
indexes: [
|
|
98
|
+
{
|
|
99
|
+
name: "app_user_follow_relation_pkey",
|
|
100
|
+
unique: true,
|
|
101
|
+
fields: [
|
|
102
|
+
{ name: "id" },
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "app_user_id",
|
|
107
|
+
fields: [
|
|
108
|
+
{ name: "app_user_id" },
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "unique_app_user_followers",
|
|
113
|
+
unique: true,
|
|
114
|
+
fields: [
|
|
115
|
+
{ name: "app_user_id" },
|
|
116
|
+
{ name: "following_app_user_id" },
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
|
|
6
|
+
export interface AppUserPlatformRelationAttributes {
|
|
7
|
+
id: string;
|
|
8
|
+
appUserId: string;
|
|
9
|
+
platformId: number;
|
|
10
|
+
externalUserId: string;
|
|
11
|
+
createDate: Date;
|
|
12
|
+
updateDate: Date;
|
|
13
|
+
accessToken: string;
|
|
14
|
+
refreshToken?: string;
|
|
15
|
+
expirationDate: Date;
|
|
16
|
+
countryCode: string;
|
|
17
|
+
stateId: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type AppUserPlatformRelationPk = "id";
|
|
21
|
+
export type AppUserPlatformRelationId = AppUserPlatformRelation[AppUserPlatformRelationPk];
|
|
22
|
+
export type AppUserPlatformRelationOptionalAttributes = "id" | "createDate" | "updateDate" | "refreshToken" | "stateId";
|
|
23
|
+
export type AppUserPlatformRelationCreationAttributes = Optional<AppUserPlatformRelationAttributes, AppUserPlatformRelationOptionalAttributes>;
|
|
24
|
+
|
|
25
|
+
export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttributes, AppUserPlatformRelationCreationAttributes> implements AppUserPlatformRelationAttributes {
|
|
26
|
+
id!: string;
|
|
27
|
+
appUserId!: string;
|
|
28
|
+
platformId!: number;
|
|
29
|
+
externalUserId!: string;
|
|
30
|
+
createDate!: Date;
|
|
31
|
+
updateDate!: Date;
|
|
32
|
+
accessToken!: string;
|
|
33
|
+
refreshToken?: string;
|
|
34
|
+
expirationDate!: Date;
|
|
35
|
+
countryCode!: string;
|
|
36
|
+
stateId!: number;
|
|
37
|
+
|
|
38
|
+
// AppUserPlatformRelation belongsTo AppUser via appUserId
|
|
39
|
+
appUser!: AppUser;
|
|
40
|
+
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
41
|
+
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
42
|
+
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
43
|
+
// AppUserPlatformRelation belongsTo Platform via platformId
|
|
44
|
+
platform!: Platform;
|
|
45
|
+
getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
|
|
46
|
+
setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
|
|
47
|
+
createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
|
|
48
|
+
|
|
49
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof AppUserPlatformRelation {
|
|
50
|
+
return AppUserPlatformRelation.init({
|
|
51
|
+
id: {
|
|
52
|
+
type: DataTypes.UUID,
|
|
53
|
+
allowNull: false,
|
|
54
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
55
|
+
primaryKey: true
|
|
56
|
+
},
|
|
57
|
+
appUserId: {
|
|
58
|
+
type: DataTypes.UUID,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
references: {
|
|
61
|
+
model: 'app_user',
|
|
62
|
+
key: 'id'
|
|
63
|
+
},
|
|
64
|
+
unique: "uk_platform_relation_app_user_id",
|
|
65
|
+
field: 'app_user_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
|
+
externalUserId: {
|
|
77
|
+
type: DataTypes.TEXT,
|
|
78
|
+
allowNull: false,
|
|
79
|
+
field: 'external_user_id'
|
|
80
|
+
},
|
|
81
|
+
createDate: {
|
|
82
|
+
type: DataTypes.DATE,
|
|
83
|
+
allowNull: false,
|
|
84
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
85
|
+
field: 'create_date'
|
|
86
|
+
},
|
|
87
|
+
updateDate: {
|
|
88
|
+
type: DataTypes.DATE,
|
|
89
|
+
allowNull: false,
|
|
90
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
91
|
+
field: 'update_date'
|
|
92
|
+
},
|
|
93
|
+
accessToken: {
|
|
94
|
+
type: DataTypes.STRING,
|
|
95
|
+
allowNull: false,
|
|
96
|
+
field: 'access_token'
|
|
97
|
+
},
|
|
98
|
+
refreshToken: {
|
|
99
|
+
type: DataTypes.STRING,
|
|
100
|
+
allowNull: true,
|
|
101
|
+
field: 'refresh_token'
|
|
102
|
+
},
|
|
103
|
+
expirationDate: {
|
|
104
|
+
type: DataTypes.DATE,
|
|
105
|
+
allowNull: false,
|
|
106
|
+
field: 'expiration_date'
|
|
107
|
+
},
|
|
108
|
+
countryCode: {
|
|
109
|
+
type: DataTypes.STRING(2),
|
|
110
|
+
allowNull: false,
|
|
111
|
+
field: 'country_code'
|
|
112
|
+
},
|
|
113
|
+
stateId: {
|
|
114
|
+
type: DataTypes.SMALLINT,
|
|
115
|
+
allowNull: false,
|
|
116
|
+
defaultValue: 0,
|
|
117
|
+
field: 'state_id'
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
sequelize,
|
|
121
|
+
tableName: 'app_user_platform_relation',
|
|
122
|
+
schema: 'eb',
|
|
123
|
+
timestamps: false,
|
|
124
|
+
indexes: [
|
|
125
|
+
{
|
|
126
|
+
name: "app_user_platform_relation_app_user_id_platform_id_idx",
|
|
127
|
+
unique: true,
|
|
128
|
+
fields: [
|
|
129
|
+
{ name: "app_user_id" },
|
|
130
|
+
{ name: "platform_id" },
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "app_user_platform_relation_pkey",
|
|
135
|
+
unique: true,
|
|
136
|
+
fields: [
|
|
137
|
+
{ name: "id" },
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "uk_platform_relation_app_user_id",
|
|
142
|
+
unique: true,
|
|
143
|
+
fields: [
|
|
144
|
+
{ name: "app_user_id" },
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|