@earbug/db-models 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/AppUser.d.ts +5 -5
  2. package/dist/AppUser.js +13 -13
  3. package/dist/AppUserDevice.d.ts +4 -4
  4. package/dist/AppUserDevice.js +8 -8
  5. package/dist/AppUserFollowRelation.d.ts +3 -3
  6. package/dist/AppUserFollowRelation.js +6 -6
  7. package/dist/AppUserPlatformRelation.d.ts +7 -7
  8. package/dist/AppUserPlatformRelation.js +18 -18
  9. package/dist/CanonAlbum.d.ts +5 -5
  10. package/dist/CanonAlbum.js +10 -10
  11. package/dist/CanonAlbumImageHarvested.d.ts +9 -9
  12. package/dist/CanonAlbumImageHarvested.js +24 -32
  13. package/dist/CanonArtist.d.ts +3 -3
  14. package/dist/CanonArtist.js +6 -6
  15. package/dist/CanonArtistImageHarvested.d.ts +9 -9
  16. package/dist/CanonArtistImageHarvested.js +24 -24
  17. package/dist/CanonGenre.d.ts +3 -3
  18. package/dist/CanonGenre.js +6 -6
  19. package/dist/CanonLabel.d.ts +2 -2
  20. package/dist/CanonLabel.js +6 -6
  21. package/dist/CanonMember.d.ts +3 -3
  22. package/dist/CanonMember.js +6 -6
  23. package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
  24. package/dist/CanonMemberExternalReferenceRelation.js +5 -5
  25. package/dist/CanonTrack.d.ts +5 -5
  26. package/dist/CanonTrack.js +11 -11
  27. package/dist/ConfigParam.d.ts +2 -2
  28. package/dist/ConfigParam.js +5 -5
  29. package/dist/ExternalReference.d.ts +2 -2
  30. package/dist/ExternalReference.js +5 -5
  31. package/dist/JukeboxAccessType.d.ts +2 -2
  32. package/dist/JukeboxAccessType.js +4 -4
  33. package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
  34. package/dist/JukeboxCanonGenreRelation.js +6 -6
  35. package/dist/JukeboxInvite.d.ts +3 -3
  36. package/dist/JukeboxInvite.js +6 -6
  37. package/dist/JukeboxQueueEntry.d.ts +10 -10
  38. package/dist/JukeboxQueueEntry.js +12 -12
  39. package/dist/JukeboxQueueMode.d.ts +2 -2
  40. package/dist/JukeboxQueueMode.js +4 -4
  41. package/dist/JukeboxSession.d.ts +9 -9
  42. package/dist/JukeboxSession.js +20 -20
  43. package/dist/JukeboxTerminationCondition.d.ts +2 -2
  44. package/dist/JukeboxTerminationCondition.js +4 -4
  45. package/dist/JukeboxType.d.ts +2 -2
  46. package/dist/JukeboxType.js +4 -4
  47. package/dist/JukeboxUser.d.ts +7 -7
  48. package/dist/JukeboxUser.js +20 -20
  49. package/dist/KnexMigrations.d.ts +3 -3
  50. package/dist/KnexMigrations.js +6 -6
  51. package/dist/KnexMigrationsLock.d.ts +3 -3
  52. package/dist/KnexMigrationsLock.js +5 -5
  53. package/dist/MetricsDaily.d.ts +3 -3
  54. package/dist/MetricsDaily.js +4 -4
  55. package/dist/NewsSite.d.ts +3 -3
  56. package/dist/NewsSite.js +6 -6
  57. package/dist/Platform.d.ts +2 -2
  58. package/dist/Platform.js +7 -7
  59. package/dist/PlatformAlbum.d.ts +5 -5
  60. package/dist/PlatformAlbum.js +10 -10
  61. package/dist/PlatformArtist.d.ts +5 -5
  62. package/dist/PlatformArtist.js +10 -10
  63. package/dist/PlatformGenre.d.ts +2 -2
  64. package/dist/PlatformGenre.js +6 -6
  65. package/dist/PlatformTrack.d.ts +3 -3
  66. package/dist/PlatformTrack.js +6 -6
  67. package/dist/PlatformUserAlbum.d.ts +2 -2
  68. package/dist/PlatformUserAlbum.js +6 -6
  69. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  70. package/dist/PlatformUserAlbumTrack.js +11 -11
  71. package/dist/PlatformUserPlaylist.d.ts +5 -5
  72. package/dist/PlatformUserPlaylist.js +11 -11
  73. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  74. package/dist/PlatformUserPlaylistTrack.js +17 -17
  75. package/dist/PlaybackStatus.d.ts +2 -14
  76. package/dist/PlaybackStatus.js +4 -4
  77. package/dist/PlaybackStatusType.d.ts +12 -0
  78. package/dist/State.d.ts +2 -2
  79. package/dist/State.js +4 -4
  80. package/dist/UnmatchedAlbum.d.ts +2 -2
  81. package/dist/UnmatchedAlbum.js +6 -6
  82. package/dist/UnmatchedArtist.d.ts +2 -2
  83. package/dist/UnmatchedArtist.js +6 -6
  84. package/dist/UserContacts.d.ts +3 -3
  85. package/dist/UserContacts.js +7 -7
  86. package/dist/init-models.js +2 -2
  87. package/models/AppUser.ts +18 -18
  88. package/models/AppUserDevice.ts +12 -12
  89. package/models/AppUserFollowRelation.ts +9 -9
  90. package/models/AppUserPlatformRelation.ts +25 -25
  91. package/models/CanonAlbum.ts +15 -15
  92. package/models/CanonAlbumImageHarvested.ts +33 -41
  93. package/models/CanonArtist.ts +9 -9
  94. package/models/CanonArtistImageHarvested.ts +33 -33
  95. package/models/CanonGenre.ts +9 -9
  96. package/models/CanonLabel.ts +8 -8
  97. package/models/CanonMember.ts +9 -9
  98. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  99. package/models/CanonTrack.ts +16 -16
  100. package/models/ConfigParam.ts +7 -7
  101. package/models/ExternalReference.ts +7 -7
  102. package/models/JukeboxAccessType.ts +6 -6
  103. package/models/JukeboxCanonGenreRelation.ts +8 -8
  104. package/models/JukeboxInvite.ts +9 -9
  105. package/models/JukeboxQueueEntry.ts +23 -23
  106. package/models/JukeboxQueueMode.ts +6 -6
  107. package/models/JukeboxSession.ts +29 -29
  108. package/models/JukeboxTerminationCondition.ts +6 -6
  109. package/models/JukeboxType.ts +6 -6
  110. package/models/JukeboxUser.ts +27 -27
  111. package/models/KnexMigrations.ts +9 -9
  112. package/models/KnexMigrationsLock.ts +8 -8
  113. package/models/MetricsDaily.ts +7 -7
  114. package/models/NewsSite.ts +9 -9
  115. package/models/Platform.ts +9 -9
  116. package/models/PlatformAlbum.ts +15 -15
  117. package/models/PlatformArtist.ts +15 -15
  118. package/models/PlatformGenre.ts +8 -8
  119. package/models/PlatformTrack.ts +9 -9
  120. package/models/PlatformUserAlbum.ts +8 -8
  121. package/models/PlatformUserAlbumTrack.ts +15 -15
  122. package/models/PlatformUserPlaylist.ts +16 -16
  123. package/models/PlatformUserPlaylistTrack.ts +24 -24
  124. package/models/PlaybackStatus.ts +6 -19
  125. package/models/PlaybackStatusType.ts +13 -0
  126. package/models/State.ts +6 -6
  127. package/models/UnmatchedAlbum.ts +8 -8
  128. package/models/UnmatchedArtist.ts +8 -8
  129. package/models/UserContacts.ts +10 -10
  130. package/models/init-models.ts +2 -2
  131. package/package.json +1 -1
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class UnmatchedAlbum extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return UnmatchedAlbum.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  platformAlbumId: {
39
33
  type: sequelize_1.DataTypes.UUID,
40
34
  allowNull: false,
@@ -44,6 +38,12 @@ class UnmatchedAlbum extends sequelize_1.Model {
44
38
  },
45
39
  field: 'platform_album_id'
46
40
  },
41
+ id: {
42
+ type: sequelize_1.DataTypes.UUID,
43
+ allowNull: false,
44
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
45
+ primaryKey: true
46
+ },
47
47
  createDate: {
48
48
  type: sequelize_1.DataTypes.DATE,
49
49
  allowNull: false,
@@ -2,9 +2,9 @@ import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
3
  import type { Platform, PlatformId } from './Platform';
4
4
  export interface UnmatchedArtistAttributes {
5
- id: string;
6
5
  platformId: number;
7
6
  externalArtistId: number;
7
+ id: string;
8
8
  createDate: Date;
9
9
  updateDate: Date;
10
10
  }
@@ -13,9 +13,9 @@ export type UnmatchedArtistId = UnmatchedArtist[UnmatchedArtistPk];
13
13
  export type UnmatchedArtistOptionalAttributes = "id" | "createDate" | "updateDate";
14
14
  export type UnmatchedArtistCreationAttributes = Optional<UnmatchedArtistAttributes, UnmatchedArtistOptionalAttributes>;
15
15
  export declare class UnmatchedArtist extends Model<UnmatchedArtistAttributes, UnmatchedArtistCreationAttributes> implements UnmatchedArtistAttributes {
16
- id: string;
17
16
  platformId: number;
18
17
  externalArtistId: number;
18
+ id: string;
19
19
  createDate: Date;
20
20
  updateDate: Date;
21
21
  platform: Platform;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class UnmatchedArtist extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return UnmatchedArtist.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  platformId: {
39
33
  type: sequelize_1.DataTypes.SMALLINT,
40
34
  allowNull: false,
@@ -49,6 +43,12 @@ class UnmatchedArtist extends sequelize_1.Model {
49
43
  allowNull: false,
50
44
  field: 'external_artist_id'
51
45
  },
46
+ id: {
47
+ type: sequelize_1.DataTypes.UUID,
48
+ allowNull: false,
49
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
50
+ primaryKey: true
51
+ },
52
52
  createDate: {
53
53
  type: sequelize_1.DataTypes.DATE,
54
54
  allowNull: false,
@@ -3,7 +3,6 @@ import { Model, Optional } from 'sequelize';
3
3
  import type { AppUser, AppUserId } from './AppUser';
4
4
  export interface UserContactsAttributes {
5
5
  appUserId: string;
6
- contactId: string;
7
6
  contactAppUserId?: string;
8
7
  firstName?: string;
9
8
  lastName?: string;
@@ -17,14 +16,14 @@ export interface UserContactsAttributes {
17
16
  contactPhone3?: string;
18
17
  contactPhone3Type?: "mobile" | "work" | "home" | "main";
19
18
  active?: boolean;
19
+ contactId: string;
20
20
  }
21
21
  export type UserContactsPk = "contactId";
22
22
  export type UserContactsId = UserContacts[UserContactsPk];
23
- export type UserContactsOptionalAttributes = "contactId" | "contactAppUserId" | "firstName" | "lastName" | "contactEmail1" | "contactEmail2" | "contactEmail3" | "contactPhone1" | "contactPhone1Type" | "contactPhone2" | "contactPhone2Type" | "contactPhone3" | "contactPhone3Type" | "active";
23
+ export type UserContactsOptionalAttributes = "contactAppUserId" | "firstName" | "lastName" | "contactEmail1" | "contactEmail2" | "contactEmail3" | "contactPhone1" | "contactPhone1Type" | "contactPhone2" | "contactPhone2Type" | "contactPhone3" | "contactPhone3Type" | "active" | "contactId";
24
24
  export type UserContactsCreationAttributes = Optional<UserContactsAttributes, UserContactsOptionalAttributes>;
25
25
  export declare class UserContacts extends Model<UserContactsAttributes, UserContactsCreationAttributes> implements UserContactsAttributes {
26
26
  appUserId: string;
27
- contactId: string;
28
27
  contactAppUserId?: string;
29
28
  firstName?: string;
30
29
  lastName?: string;
@@ -38,6 +37,7 @@ export declare class UserContacts extends Model<UserContactsAttributes, UserCont
38
37
  contactPhone3?: string;
39
38
  contactPhone3Type?: "mobile" | "work" | "home" | "main";
40
39
  active?: boolean;
40
+ contactId: string;
41
41
  appUser: AppUser;
42
42
  getAppUser: Sequelize.BelongsToGetAssociationMixin<AppUser>;
43
43
  setAppUser: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
@@ -14,13 +14,6 @@ class UserContacts extends sequelize_1.Model {
14
14
  },
15
15
  field: 'app_user_id'
16
16
  },
17
- contactId: {
18
- type: sequelize_1.DataTypes.UUID,
19
- allowNull: false,
20
- defaultValue: sequelize_1.DataTypes.UUIDV4,
21
- primaryKey: true,
22
- field: 'contact_id'
23
- },
24
17
  contactAppUserId: {
25
18
  type: sequelize_1.DataTypes.UUID,
26
19
  allowNull: true,
@@ -84,6 +77,13 @@ class UserContacts extends sequelize_1.Model {
84
77
  active: {
85
78
  type: sequelize_1.DataTypes.BOOLEAN,
86
79
  allowNull: true
80
+ },
81
+ contactId: {
82
+ type: sequelize_1.DataTypes.UUID,
83
+ allowNull: false,
84
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
85
+ primaryKey: true,
86
+ field: 'contact_id'
87
87
  }
88
88
  }, {
89
89
  sequelize,
@@ -427,8 +427,8 @@ function initModels(sequelize) {
427
427
  PlatformUserAlbum.hasMany(PlatformUserAlbumTrack, { as: "platformUserAlbumTracks", foreignKey: "platformUserAlbumId" });
428
428
  PlatformUserPlaylistTrack.belongsTo(PlatformUserPlaylist, { as: "platformUserPlaylist", foreignKey: "platformUserPlaylistId" });
429
429
  PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId" });
430
- JukeboxQueueEntry.belongsTo(PlaybackStatus, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId" });
431
- PlaybackStatus.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId" });
430
+ JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId" });
431
+ PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId" });
432
432
  AppUser.belongsTo(State, { as: "state", foreignKey: "stateId" });
433
433
  State.hasMany(AppUser, { as: "appUsers", foreignKey: "stateId" });
434
434
  PlatformUserPlaylist.belongsTo(State, { as: "state", foreignKey: "stateId" });
package/models/AppUser.ts CHANGED
@@ -12,13 +12,13 @@ import type { State, StateId } from './State';
12
12
  import type { UserContacts, UserContactsId } from './UserContacts';
13
13
 
14
14
  export interface AppUserAttributes {
15
- id: string;
16
15
  email: string;
17
16
  firstName: string;
17
+ id: string;
18
18
  createDate: Date;
19
19
  updateDate: Date;
20
- stateId: number;
21
20
  syncContacts?: boolean;
21
+ stateId?: number;
22
22
  lastName?: string;
23
23
  autoApproveFollowers: boolean;
24
24
  lastHarvested?: Date;
@@ -27,17 +27,17 @@ export interface AppUserAttributes {
27
27
 
28
28
  export type AppUserPk = "id";
29
29
  export type AppUserId = AppUser[AppUserPk];
30
- export type AppUserOptionalAttributes = "id" | "createDate" | "updateDate" | "stateId" | "syncContacts" | "lastName" | "autoApproveFollowers" | "lastHarvested" | "lastHarvestedError";
30
+ export type AppUserOptionalAttributes = "id" | "createDate" | "updateDate" | "syncContacts" | "stateId" | "lastName" | "autoApproveFollowers" | "lastHarvested" | "lastHarvestedError";
31
31
  export type AppUserCreationAttributes = Optional<AppUserAttributes, AppUserOptionalAttributes>;
32
32
 
33
33
  export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes> implements AppUserAttributes {
34
- id!: string;
35
34
  email!: string;
36
35
  firstName!: string;
36
+ id!: string;
37
37
  createDate!: Date;
38
38
  updateDate!: Date;
39
- stateId!: number;
40
39
  syncContacts?: boolean;
40
+ stateId?: number;
41
41
  lastName?: string;
42
42
  autoApproveFollowers!: boolean;
43
43
  lastHarvested?: Date;
@@ -176,12 +176,6 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
176
176
 
177
177
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUser {
178
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
179
  email: {
186
180
  type: DataTypes.TEXT,
187
181
  allowNull: false,
@@ -192,6 +186,12 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
192
186
  allowNull: false,
193
187
  field: 'first_name'
194
188
  },
189
+ id: {
190
+ type: DataTypes.UUID,
191
+ allowNull: false,
192
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
193
+ primaryKey: true
194
+ },
195
195
  createDate: {
196
196
  type: DataTypes.DATE,
197
197
  allowNull: false,
@@ -204,9 +204,15 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
204
204
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
205
205
  field: 'update_date'
206
206
  },
207
+ syncContacts: {
208
+ type: DataTypes.BOOLEAN,
209
+ allowNull: true,
210
+ defaultValue: false,
211
+ field: 'sync_contacts'
212
+ },
207
213
  stateId: {
208
214
  type: DataTypes.SMALLINT,
209
- allowNull: false,
215
+ allowNull: true,
210
216
  defaultValue: 0,
211
217
  references: {
212
218
  model: 'state',
@@ -214,12 +220,6 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
214
220
  },
215
221
  field: 'state_id'
216
222
  },
217
- syncContacts: {
218
- type: DataTypes.BOOLEAN,
219
- allowNull: true,
220
- defaultValue: false,
221
- field: 'sync_contacts'
222
- },
223
223
  lastName: {
224
224
  type: DataTypes.TEXT,
225
225
  allowNull: true,
@@ -4,10 +4,10 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
 
5
5
  export interface AppUserDeviceAttributes {
6
6
  id: string;
7
+ createdAt: Date;
7
8
  appUserId: string;
8
- platformId: number;
9
+ devicePlatformId: number;
9
10
  endpointArn: string;
10
- createdAt: Date;
11
11
  }
12
12
 
13
13
  export type AppUserDevicePk = "id";
@@ -17,10 +17,10 @@ export type AppUserDeviceCreationAttributes = Optional<AppUserDeviceAttributes,
17
17
 
18
18
  export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceCreationAttributes> implements AppUserDeviceAttributes {
19
19
  id!: string;
20
+ createdAt!: Date;
20
21
  appUserId!: string;
21
- platformId!: number;
22
+ devicePlatformId!: number;
22
23
  endpointArn!: string;
23
- createdAt!: Date;
24
24
 
25
25
  // AppUserDevice belongsTo AppUser via appUserId
26
26
  appUser!: AppUser;
@@ -36,6 +36,12 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
36
36
  defaultValue: DataTypes.UUIDV4,
37
37
  primaryKey: true
38
38
  },
39
+ createdAt: {
40
+ type: DataTypes.DATE,
41
+ allowNull: false,
42
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
43
+ field: 'created_at'
44
+ },
39
45
  appUserId: {
40
46
  type: DataTypes.UUID,
41
47
  allowNull: false,
@@ -45,22 +51,16 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
45
51
  },
46
52
  field: 'app_user_id'
47
53
  },
48
- platformId: {
54
+ devicePlatformId: {
49
55
  type: DataTypes.SMALLINT,
50
56
  allowNull: false,
51
- field: 'platform_id'
57
+ field: 'device_platform_id'
52
58
  },
53
59
  endpointArn: {
54
60
  type: DataTypes.TEXT,
55
61
  allowNull: false,
56
62
  unique: "unique_app_user_device_endpoint_arn",
57
63
  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
64
  }
65
65
  }, {
66
66
  sequelize,
@@ -3,28 +3,28 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { AppUser, AppUserId } from './AppUser';
4
4
 
5
5
  export interface AppUserFollowRelationAttributes {
6
- id: string;
7
6
  appUserId: string;
8
7
  followingAppUserId: string;
9
8
  stateId: number;
10
9
  isBlocked: boolean;
11
10
  createdAt: Date;
12
11
  updatedAt: Date;
12
+ id: string;
13
13
  }
14
14
 
15
15
  export type AppUserFollowRelationPk = "id";
16
16
  export type AppUserFollowRelationId = AppUserFollowRelation[AppUserFollowRelationPk];
17
- export type AppUserFollowRelationOptionalAttributes = "id" | "stateId" | "createdAt" | "updatedAt";
17
+ export type AppUserFollowRelationOptionalAttributes = "stateId" | "createdAt" | "updatedAt" | "id";
18
18
  export type AppUserFollowRelationCreationAttributes = Optional<AppUserFollowRelationAttributes, AppUserFollowRelationOptionalAttributes>;
19
19
 
20
20
  export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes, AppUserFollowRelationCreationAttributes> implements AppUserFollowRelationAttributes {
21
- id!: string;
22
21
  appUserId!: string;
23
22
  followingAppUserId!: string;
24
23
  stateId!: number;
25
24
  isBlocked!: boolean;
26
25
  createdAt!: Date;
27
26
  updatedAt!: Date;
27
+ id!: string;
28
28
 
29
29
  // AppUserFollowRelation belongsTo AppUser via appUserId
30
30
  appUser!: AppUser;
@@ -39,12 +39,6 @@ export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes
39
39
 
40
40
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUserFollowRelation {
41
41
  return AppUserFollowRelation.init({
42
- id: {
43
- type: DataTypes.UUID,
44
- allowNull: false,
45
- defaultValue: DataTypes.UUIDV4,
46
- primaryKey: true
47
- },
48
42
  appUserId: {
49
43
  type: DataTypes.UUID,
50
44
  allowNull: false,
@@ -88,6 +82,12 @@ export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes
88
82
  allowNull: false,
89
83
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
90
84
  field: 'updated_at'
85
+ },
86
+ id: {
87
+ type: DataTypes.UUID,
88
+ allowNull: false,
89
+ defaultValue: DataTypes.UUIDV4,
90
+ primaryKey: true
91
91
  }
92
92
  }, {
93
93
  sequelize,
@@ -4,35 +4,35 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
  import type { Platform, PlatformId } from './Platform';
5
5
 
6
6
  export interface AppUserPlatformRelationAttributes {
7
- id: string;
8
7
  appUserId: string;
9
8
  platformId: number;
10
9
  externalUserId: string;
11
- createDate: Date;
12
- updateDate: Date;
13
10
  accessToken: string;
14
11
  refreshToken?: string;
15
12
  expirationDate: Date;
16
13
  countryCode: string;
14
+ id: string;
15
+ createDate: Date;
16
+ updateDate: Date;
17
17
  stateId: number;
18
18
  }
19
19
 
20
20
  export type AppUserPlatformRelationPk = "id";
21
21
  export type AppUserPlatformRelationId = AppUserPlatformRelation[AppUserPlatformRelationPk];
22
- export type AppUserPlatformRelationOptionalAttributes = "id" | "createDate" | "updateDate" | "refreshToken" | "stateId";
22
+ export type AppUserPlatformRelationOptionalAttributes = "refreshToken" | "id" | "createDate" | "updateDate" | "stateId";
23
23
  export type AppUserPlatformRelationCreationAttributes = Optional<AppUserPlatformRelationAttributes, AppUserPlatformRelationOptionalAttributes>;
24
24
 
25
25
  export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttributes, AppUserPlatformRelationCreationAttributes> implements AppUserPlatformRelationAttributes {
26
- id!: string;
27
26
  appUserId!: string;
28
27
  platformId!: number;
29
28
  externalUserId!: string;
30
- createDate!: Date;
31
- updateDate!: Date;
32
29
  accessToken!: string;
33
30
  refreshToken?: string;
34
31
  expirationDate!: Date;
35
32
  countryCode!: string;
33
+ id!: string;
34
+ createDate!: Date;
35
+ updateDate!: Date;
36
36
  stateId!: number;
37
37
 
38
38
  // AppUserPlatformRelation belongsTo AppUser via appUserId
@@ -48,12 +48,6 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
48
48
 
49
49
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUserPlatformRelation {
50
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
51
  appUserId: {
58
52
  type: DataTypes.UUID,
59
53
  allowNull: false,
@@ -78,18 +72,6 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
78
72
  allowNull: false,
79
73
  field: 'external_user_id'
80
74
  },
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
75
  accessToken: {
94
76
  type: DataTypes.STRING,
95
77
  allowNull: false,
@@ -110,6 +92,24 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
110
92
  allowNull: false,
111
93
  field: 'country_code'
112
94
  },
95
+ id: {
96
+ type: DataTypes.UUID,
97
+ allowNull: false,
98
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
99
+ primaryKey: true
100
+ },
101
+ createDate: {
102
+ type: DataTypes.DATE,
103
+ allowNull: false,
104
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
105
+ field: 'create_date'
106
+ },
107
+ updateDate: {
108
+ type: DataTypes.DATE,
109
+ allowNull: false,
110
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
111
+ field: 'update_date'
112
+ },
113
113
  stateId: {
114
114
  type: DataTypes.SMALLINT,
115
115
  allowNull: false,
@@ -9,36 +9,36 @@ import type { ExternalReference, ExternalReferenceId } from './ExternalReference
9
9
  import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
10
10
 
11
11
  export interface CanonAlbumAttributes {
12
- id: string;
13
12
  name: string;
14
13
  asciiName: string;
15
14
  releaseDate?: string;
16
15
  noOfDisc?: number;
16
+ description?: string;
17
+ id: string;
17
18
  createDate: Date;
18
19
  updateDate: Date;
19
20
  hasPhoto?: boolean;
20
21
  hasThumbnailPhoto?: boolean;
21
- description?: string;
22
22
  images?: object;
23
23
  lastImageHarvestAttempt?: Date;
24
24
  }
25
25
 
26
26
  export type CanonAlbumPk = "id";
27
27
  export type CanonAlbumId = CanonAlbum[CanonAlbumPk];
28
- export type CanonAlbumOptionalAttributes = "id" | "releaseDate" | "noOfDisc" | "createDate" | "updateDate" | "hasPhoto" | "hasThumbnailPhoto" | "description" | "images" | "lastImageHarvestAttempt";
28
+ export type CanonAlbumOptionalAttributes = "releaseDate" | "noOfDisc" | "description" | "id" | "createDate" | "updateDate" | "hasPhoto" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt";
29
29
  export type CanonAlbumCreationAttributes = Optional<CanonAlbumAttributes, CanonAlbumOptionalAttributes>;
30
30
 
31
31
  export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAttributes> implements CanonAlbumAttributes {
32
- id!: string;
33
32
  name!: string;
34
33
  asciiName!: string;
35
34
  releaseDate?: string;
36
35
  noOfDisc?: number;
36
+ description?: string;
37
+ id!: string;
37
38
  createDate!: Date;
38
39
  updateDate!: Date;
39
40
  hasPhoto?: boolean;
40
41
  hasThumbnailPhoto?: boolean;
41
- description?: string;
42
42
  images?: object;
43
43
  lastImageHarvestAttempt?: Date;
44
44
 
@@ -129,12 +129,6 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
129
129
 
130
130
  static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbum {
131
131
  return CanonAlbum.init({
132
- id: {
133
- type: DataTypes.UUID,
134
- allowNull: false,
135
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
136
- primaryKey: true
137
- },
138
132
  name: {
139
133
  type: DataTypes.TEXT,
140
134
  allowNull: false
@@ -154,6 +148,16 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
154
148
  allowNull: true,
155
149
  field: 'no_of_disc'
156
150
  },
151
+ description: {
152
+ type: DataTypes.TEXT,
153
+ allowNull: true
154
+ },
155
+ id: {
156
+ type: DataTypes.UUID,
157
+ allowNull: false,
158
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
159
+ primaryKey: true
160
+ },
157
161
  createDate: {
158
162
  type: DataTypes.DATE,
159
163
  allowNull: false,
@@ -178,10 +182,6 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
178
182
  defaultValue: false,
179
183
  field: 'has_thumbnail_photo'
180
184
  },
181
- description: {
182
- type: DataTypes.TEXT,
183
- allowNull: true
184
- },
185
185
  images: {
186
186
  type: DataTypes.JSONB,
187
187
  allowNull: true
@@ -3,28 +3,28 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
4
4
 
5
5
  export interface CanonAlbumImageHarvestedAttributes {
6
- id: string;
7
- canonAlbumId: string;
8
- priority?: number;
9
- url?: string;
10
6
  dateHarvested: Date;
11
7
  storageKey: string;
12
8
  harvestMethod?: string;
9
+ priority?: number;
10
+ id: string;
11
+ url?: string;
12
+ canonAlbumId: string;
13
13
  }
14
14
 
15
15
  export type CanonAlbumImageHarvestedPk = "id";
16
16
  export type CanonAlbumImageHarvestedId = CanonAlbumImageHarvested[CanonAlbumImageHarvestedPk];
17
- export type CanonAlbumImageHarvestedOptionalAttributes = "id" | "priority" | "url" | "harvestMethod";
17
+ export type CanonAlbumImageHarvestedOptionalAttributes = "harvestMethod" | "priority" | "id" | "url";
18
18
  export type CanonAlbumImageHarvestedCreationAttributes = Optional<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedOptionalAttributes>;
19
19
 
20
20
  export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedCreationAttributes> implements CanonAlbumImageHarvestedAttributes {
21
- id!: string;
22
- canonAlbumId!: string;
23
- priority?: number;
24
- url?: string;
25
21
  dateHarvested!: Date;
26
22
  storageKey!: string;
27
23
  harvestMethod?: string;
24
+ priority?: number;
25
+ id!: string;
26
+ url?: string;
27
+ canonAlbumId!: string;
28
28
 
29
29
  // CanonAlbumImageHarvested belongsTo CanonAlbum via canonAlbumId
30
30
  canonAlbum!: CanonAlbum;
@@ -34,31 +34,6 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
34
34
 
35
35
  static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbumImageHarvested {
36
36
  return CanonAlbumImageHarvested.init({
37
- id: {
38
- type: DataTypes.UUID,
39
- allowNull: false,
40
- defaultValue: DataTypes.UUIDV4,
41
- primaryKey: true
42
- },
43
- canonAlbumId: {
44
- type: DataTypes.UUID,
45
- allowNull: false,
46
- references: {
47
- model: 'canon_album',
48
- key: 'id'
49
- },
50
- field: 'canon_album_id'
51
- },
52
- priority: {
53
- type: DataTypes.DECIMAL,
54
- allowNull: true,
55
- defaultValue: 0
56
- },
57
- url: {
58
- type: DataTypes.TEXT,
59
- allowNull: true,
60
- unique: "canon_album_image_harvested_url_unique"
61
- },
62
37
  dateHarvested: {
63
38
  type: DataTypes.DATE,
64
39
  allowNull: false,
@@ -73,6 +48,30 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
73
48
  type: DataTypes.STRING(255),
74
49
  allowNull: true,
75
50
  field: 'harvest_method'
51
+ },
52
+ priority: {
53
+ type: DataTypes.DECIMAL,
54
+ allowNull: true,
55
+ defaultValue: 0
56
+ },
57
+ id: {
58
+ type: DataTypes.UUID,
59
+ allowNull: false,
60
+ defaultValue: DataTypes.UUIDV4,
61
+ primaryKey: true
62
+ },
63
+ url: {
64
+ type: DataTypes.TEXT,
65
+ allowNull: true
66
+ },
67
+ canonAlbumId: {
68
+ type: DataTypes.UUID,
69
+ allowNull: false,
70
+ references: {
71
+ model: 'canon_album',
72
+ key: 'id'
73
+ },
74
+ field: 'canon_album_id'
76
75
  }
77
76
  }, {
78
77
  sequelize,
@@ -93,13 +92,6 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
93
92
  { name: "id" },
94
93
  ]
95
94
  },
96
- {
97
- name: "canon_album_image_harvested_url_unique",
98
- unique: true,
99
- fields: [
100
- { name: "url" },
101
- ]
102
- },
103
95
  ]
104
96
  });
105
97
  }