@earbug/db-models 0.0.60 → 0.0.62
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/AffinityRelationshipType.d.ts +2 -2
- package/dist/AffinityRelationshipType.js +6 -6
- package/dist/AppUser.d.ts +5 -5
- package/dist/AppUser.js +7 -7
- package/dist/AppUserDevice.d.ts +2 -2
- package/dist/AppUserDevice.js +6 -6
- package/dist/AppUserDeviceClassicBackup20260906.d.ts +23 -0
- package/dist/AppUserDeviceClassicBackup20260906.js +46 -0
- package/dist/AppUserFollowRelation.d.ts +3 -3
- package/dist/AppUserFollowRelation.js +6 -6
- package/dist/AppUserPlatformRelation.d.ts +13 -13
- package/dist/AppUserPlatformRelation.js +25 -25
- package/dist/CanonAlbum.d.ts +5 -5
- package/dist/CanonAlbum.js +10 -10
- package/dist/CanonArtist.d.ts +5 -5
- package/dist/CanonArtist.js +11 -11
- 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/FeedContentType.d.ts +2 -2
- package/dist/FeedContentType.js +4 -4
- package/dist/GuestUser.d.ts +5 -5
- package/dist/GuestUser.js +13 -13
- 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 +9 -9
- package/dist/JukeboxQueueEntry.js +25 -25
- package/dist/JukeboxQueueMode.d.ts +2 -2
- package/dist/JukeboxQueueMode.js +4 -4
- package/dist/JukeboxSession.d.ts +9 -9
- package/dist/JukeboxSession.js +20 -20
- package/dist/JukeboxSessionArtistAffinity.d.ts +2 -2
- package/dist/JukeboxSessionArtistAffinity.js +6 -6
- package/dist/JukeboxSessionGenreAffinity.d.ts +2 -2
- package/dist/JukeboxSessionGenreAffinity.js +6 -6
- 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/MerchItem.d.ts +3 -3
- package/dist/MerchItem.js +6 -6
- package/dist/MerchOrchestration.d.ts +3 -3
- package/dist/MerchOrchestration.js +6 -6
- package/dist/MerchPlatform.d.ts +2 -2
- package/dist/MerchPlatform.js +6 -6
- package/dist/MerchType.d.ts +2 -2
- package/dist/MerchType.js +4 -4
- 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 +13 -13
- package/dist/Notification.js +33 -33
- 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/PlatformUserPlaylistArtistAffinity.d.ts +4 -4
- package/dist/PlatformUserPlaylistArtistAffinity.js +12 -12
- package/dist/PlatformUserPlaylistGenreAffinity.d.ts +2 -2
- package/dist/PlatformUserPlaylistGenreAffinity.js +6 -6
- package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
- package/dist/PlatformUserPlaylistTrack.js +17 -17
- package/dist/PlaybackStatus.d.ts +2 -2
- package/dist/PlaybackStatus.js +4 -4
- package/dist/RadioShow.d.ts +3 -3
- package/dist/RadioShow.js +6 -6
- package/dist/RadioShowMedia.d.ts +3 -3
- package/dist/RadioShowMedia.js +6 -6
- package/dist/RadioShowPlacement.d.ts +3 -3
- package/dist/RadioShowPlacement.js +6 -6
- package/dist/RadioShowPublishRequests.d.ts +3 -3
- package/dist/RadioShowPublishRequests.js +6 -6
- 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/UserAbuseReports.d.ts +7 -7
- package/dist/UserAbuseReports.js +18 -18
- package/dist/UserAffinity.d.ts +2 -2
- package/dist/UserAffinity.js +6 -6
- package/dist/UserArtistAffinity.d.ts +2 -2
- package/dist/UserArtistAffinity.js +6 -6
- package/dist/UserBookmarks.d.ts +3 -3
- package/dist/UserBookmarks.js +6 -6
- package/dist/UserComments.d.ts +5 -5
- package/dist/UserComments.js +12 -12
- package/dist/UserContacts.d.ts +3 -3
- package/dist/UserContacts.js +7 -7
- package/dist/UserEngagementFactor.d.ts +2 -2
- package/dist/UserEngagementFactor.js +6 -6
- package/dist/UserGenreAffinity.d.ts +2 -2
- package/dist/UserGenreAffinity.js +6 -6
- package/dist/UserLikes.d.ts +3 -3
- package/dist/UserLikes.js +6 -6
- package/dist/UserMessages.d.ts +5 -5
- package/dist/UserMessages.js +15 -15
- package/dist/Versus.d.ts +5 -5
- package/dist/Versus.js +11 -11
- package/dist/VersusCoCreator.d.ts +4 -4
- package/dist/VersusCoCreator.js +12 -12
- package/dist/VersusOption.d.ts +3 -3
- package/dist/VersusOption.js +6 -6
- package/dist/VersusPublishIssue.d.ts +3 -3
- package/dist/VersusPublishIssue.js +6 -6
- package/dist/VersusQuestion.d.ts +2 -2
- package/dist/VersusQuestion.js +6 -6
- package/dist/VersusVote.d.ts +2 -2
- package/dist/VersusVote.js +6 -6
- package/dist/init-models.d.ts +349 -3
- package/dist/init-models.js +905 -1
- package/package.json +5 -2
- package/.github/workflows/publish.yaml +0 -56
- package/.nvmrc +0 -1
- package/dist/CanonAlbumImageHarvested.d.ts +0 -30
- package/dist/CanonAlbumImageHarvested.js +0 -70
- package/dist/CanonArtistImageHarvested.d.ts +0 -30
- package/dist/CanonArtistImageHarvested.js +0 -70
- package/model_options.json +0 -3
- package/models/AccessControlPreference.ts +0 -53
- package/models/AffinityRelationshipType.ts +0 -96
- package/models/AffinityTier.ts +0 -131
- package/models/AppUser.ts +0 -577
- package/models/AppUserDevice.ts +0 -101
- package/models/AppUserFollowRelation.ts +0 -128
- package/models/AppUserPlatformRelation.ts +0 -150
- package/models/CanonAlbum.ts +0 -229
- package/models/CanonAlbumExternalReferenceRelation.ts +0 -92
- package/models/CanonAlbumGenreRelation.ts +0 -86
- package/models/CanonAlbumImageHarvested.ts +0 -98
- package/models/CanonAlbumLabelRelation.ts +0 -86
- package/models/CanonAlbumTrackRelation.ts +0 -92
- package/models/CanonArtist.ts +0 -356
- package/models/CanonArtistAlbumRelation.ts +0 -92
- package/models/CanonArtistExternalReferenceRelation.ts +0 -92
- package/models/CanonArtistGenreRelation.ts +0 -86
- package/models/CanonArtistImageHarvested.ts +0 -98
- package/models/CanonArtistMemberRelation.ts +0 -86
- package/models/CanonArtistTrackRelation.ts +0 -92
- package/models/CanonGenre.ts +0 -273
- package/models/CanonGenreExternalReferenceRelation.ts +0 -92
- package/models/CanonLabel.ts +0 -129
- package/models/CanonLabelExternalReferenceRelation.ts +0 -92
- package/models/CanonMember.ts +0 -130
- package/models/CanonMemberExternalReferenceRelation.ts +0 -99
- package/models/CanonToPlatformAlbumRelation.ts +0 -92
- package/models/CanonToPlatformArtistRelation.ts +0 -92
- package/models/CanonToPlatformGenreRelation.ts +0 -86
- package/models/CanonToPlatformTrackRelation.ts +0 -92
- package/models/CanonTrack.ts +0 -232
- package/models/ConfigParam.ts +0 -62
- package/models/ExternalReference.ts +0 -201
- package/models/FeedConfig.ts +0 -65
- package/models/FeedContentType.ts +0 -124
- package/models/GuestUser.ts +0 -137
- package/models/JukeboxAccessType.ts +0 -60
- package/models/JukeboxCanonGenreRelation.ts +0 -108
- package/models/JukeboxInvite.ts +0 -125
- package/models/JukeboxQueueEntry.ts +0 -247
- package/models/JukeboxQueueMode.ts +0 -60
- package/models/JukeboxSession.ts +0 -334
- package/models/JukeboxSessionArtistAffinity.ts +0 -136
- package/models/JukeboxSessionGenreAffinity.ts +0 -136
- package/models/JukeboxStatus.ts +0 -58
- package/models/JukeboxTerminationCondition.ts +0 -60
- package/models/JukeboxType.ts +0 -60
- package/models/JukeboxUser.ts +0 -182
- package/models/JukeboxUserType.ts +0 -58
- package/models/KnexMigrations.ts +0 -60
- package/models/KnexMigrationsLock.ts +0 -48
- package/models/MerchItem.ts +0 -198
- package/models/MerchOrchestration.ts +0 -130
- package/models/MerchPlatform.ts +0 -95
- package/models/MerchType.ts +0 -89
- package/models/MetricsDaily.ts +0 -79
- package/models/MetricsEvent.ts +0 -124
- package/models/NewsArticle.ts +0 -177
- package/models/NewsPlatform.ts +0 -76
- package/models/NewsSite.ts +0 -75
- package/models/Notification.ts +0 -214
- package/models/NotificationType.ts +0 -66
- package/models/PauseStatusType.ts +0 -58
- package/models/Platform.ts +0 -189
- package/models/PlatformAlbum.ts +0 -398
- package/models/PlatformAlbumGenreRelation.ts +0 -86
- package/models/PlatformAlbumTrackRelation.ts +0 -92
- package/models/PlatformArtist.ts +0 -358
- package/models/PlatformArtistAlbumRelation.ts +0 -92
- package/models/PlatformArtistGenreRelation.ts +0 -86
- package/models/PlatformArtistTrackRelation.ts +0 -92
- package/models/PlatformGenre.ts +0 -194
- package/models/PlatformTrack.ts +0 -339
- package/models/PlatformTrackGenreRelation.ts +0 -86
- package/models/PlatformUserAlbum.ts +0 -152
- package/models/PlatformUserAlbumTrack.ts +0 -138
- package/models/PlatformUserPlaylist.ts +0 -260
- package/models/PlatformUserPlaylistArtistAffinity.ts +0 -136
- package/models/PlatformUserPlaylistGenreAffinity.ts +0 -136
- package/models/PlatformUserPlaylistTrack.ts +0 -162
- package/models/PlaybackStatus.ts +0 -47
- package/models/PlaybackStatusType.ts +0 -58
- package/models/RadioShow.ts +0 -209
- package/models/RadioShowGenres.ts +0 -107
- package/models/RadioShowMedia.ts +0 -181
- package/models/RadioShowPlacement.ts +0 -115
- package/models/RadioShowPublishRequests.ts +0 -86
- package/models/State.ts +0 -86
- package/models/TrackDeletionReason.ts +0 -58
- package/models/UnmatchedAlbum.ts +0 -66
- package/models/UnmatchedArtist.ts +0 -81
- package/models/UserAbuseReports.ts +0 -232
- package/models/UserAffinity.ts +0 -117
- package/models/UserArtistAffinity.ts +0 -136
- package/models/UserBookmarks.ts +0 -235
- package/models/UserComments.ts +0 -271
- package/models/UserContacts.ts +0 -155
- package/models/UserEngagementFactor.ts +0 -109
- package/models/UserGenreAffinity.ts +0 -136
- package/models/UserLikes.ts +0 -235
- package/models/UserMessages.ts +0 -189
- package/models/Versus.ts +0 -438
- package/models/VersusAccessType.ts +0 -66
- package/models/VersusCoCreator.ts +0 -111
- package/models/VersusCreatorScope.ts +0 -66
- package/models/VersusEndMode.ts +0 -66
- package/models/VersusEndTimerDuration.ts +0 -81
- package/models/VersusEndVoteThreshold.ts +0 -67
- package/models/VersusEntityKind.ts +0 -79
- package/models/VersusOption.ts +0 -258
- package/models/VersusPublishIssue.ts +0 -146
- package/models/VersusQuestion.ts +0 -123
- package/models/VersusQuestionVariableType.ts +0 -66
- package/models/VersusVote.ts +0 -99
- package/models/VersusVotingListType.ts +0 -66
- package/models/VersusVotingMode.ts +0 -66
- package/models/index.ts +0 -3
- package/models/init-models.ts +0 -14
- package/models/initDb.ts +0 -72
- package/models/rdsCaBundle.ts +0 -5
- package/scripts/update-rds-ca-bundle.mjs +0 -44
- package/tsconfig.json +0 -52
package/models/VersusQuestion.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import * as Sequelize from 'sequelize';
|
|
2
|
-
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { Versus, VersusId } from './Versus';
|
|
4
|
-
import type { VersusQuestionVariableType, VersusQuestionVariableTypeId } from './VersusQuestionVariableType';
|
|
5
|
-
import type { VersusVotingListType, VersusVotingListTypeId } from './VersusVotingListType';
|
|
6
|
-
|
|
7
|
-
export interface VersusQuestionAttributes {
|
|
8
|
-
questionTemplate: string;
|
|
9
|
-
questionVariableTypeId: number;
|
|
10
|
-
votingListTypeId: number;
|
|
11
|
-
id: string;
|
|
12
|
-
createdAt: Date;
|
|
13
|
-
updatedAt: Date;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type VersusQuestionPk = "id";
|
|
17
|
-
export type VersusQuestionId = VersusQuestion[VersusQuestionPk];
|
|
18
|
-
export type VersusQuestionOptionalAttributes = "id" | "createdAt" | "updatedAt";
|
|
19
|
-
export type VersusQuestionCreationAttributes = Optional<VersusQuestionAttributes, VersusQuestionOptionalAttributes>;
|
|
20
|
-
|
|
21
|
-
export class VersusQuestion extends Model<VersusQuestionAttributes, VersusQuestionCreationAttributes> implements VersusQuestionAttributes {
|
|
22
|
-
questionTemplate!: string;
|
|
23
|
-
questionVariableTypeId!: number;
|
|
24
|
-
votingListTypeId!: number;
|
|
25
|
-
id!: string;
|
|
26
|
-
createdAt!: Date;
|
|
27
|
-
updatedAt!: Date;
|
|
28
|
-
|
|
29
|
-
// VersusQuestion hasMany Versus via versusQuestionId
|
|
30
|
-
versus!: Versus[];
|
|
31
|
-
getVersus!: Sequelize.HasManyGetAssociationsMixin<Versus>;
|
|
32
|
-
setVersus!: Sequelize.HasManySetAssociationsMixin<Versus, VersusId>;
|
|
33
|
-
addVersu!: Sequelize.HasManyAddAssociationMixin<Versus, VersusId>;
|
|
34
|
-
addVersus!: Sequelize.HasManyAddAssociationsMixin<Versus, VersusId>;
|
|
35
|
-
createVersu!: Sequelize.HasManyCreateAssociationMixin<Versus>;
|
|
36
|
-
removeVersu!: Sequelize.HasManyRemoveAssociationMixin<Versus, VersusId>;
|
|
37
|
-
removeVersus!: Sequelize.HasManyRemoveAssociationsMixin<Versus, VersusId>;
|
|
38
|
-
hasVersu!: Sequelize.HasManyHasAssociationMixin<Versus, VersusId>;
|
|
39
|
-
hasVersus!: Sequelize.HasManyHasAssociationsMixin<Versus, VersusId>;
|
|
40
|
-
countVersus!: Sequelize.HasManyCountAssociationsMixin;
|
|
41
|
-
// VersusQuestion belongsTo VersusQuestionVariableType via questionVariableTypeId
|
|
42
|
-
questionVariableType!: VersusQuestionVariableType;
|
|
43
|
-
getQuestionVariableType!: Sequelize.BelongsToGetAssociationMixin<VersusQuestionVariableType>;
|
|
44
|
-
setQuestionVariableType!: Sequelize.BelongsToSetAssociationMixin<VersusQuestionVariableType, VersusQuestionVariableTypeId>;
|
|
45
|
-
createQuestionVariableType!: Sequelize.BelongsToCreateAssociationMixin<VersusQuestionVariableType>;
|
|
46
|
-
// VersusQuestion belongsTo VersusVotingListType via votingListTypeId
|
|
47
|
-
votingListType!: VersusVotingListType;
|
|
48
|
-
getVotingListType!: Sequelize.BelongsToGetAssociationMixin<VersusVotingListType>;
|
|
49
|
-
setVotingListType!: Sequelize.BelongsToSetAssociationMixin<VersusVotingListType, VersusVotingListTypeId>;
|
|
50
|
-
createVotingListType!: Sequelize.BelongsToCreateAssociationMixin<VersusVotingListType>;
|
|
51
|
-
|
|
52
|
-
static initModel(sequelize: Sequelize.Sequelize): typeof VersusQuestion {
|
|
53
|
-
return VersusQuestion.init({
|
|
54
|
-
questionTemplate: {
|
|
55
|
-
type: DataTypes.TEXT,
|
|
56
|
-
allowNull: false,
|
|
57
|
-
field: 'question_template'
|
|
58
|
-
},
|
|
59
|
-
questionVariableTypeId: {
|
|
60
|
-
type: DataTypes.SMALLINT,
|
|
61
|
-
allowNull: false,
|
|
62
|
-
references: {
|
|
63
|
-
model: 'versus_question_variable_type',
|
|
64
|
-
key: 'id'
|
|
65
|
-
},
|
|
66
|
-
field: 'question_variable_type_id'
|
|
67
|
-
},
|
|
68
|
-
votingListTypeId: {
|
|
69
|
-
type: DataTypes.SMALLINT,
|
|
70
|
-
allowNull: false,
|
|
71
|
-
references: {
|
|
72
|
-
model: 'versus_voting_list_type',
|
|
73
|
-
key: 'id'
|
|
74
|
-
},
|
|
75
|
-
field: 'voting_list_type_id'
|
|
76
|
-
},
|
|
77
|
-
id: {
|
|
78
|
-
type: DataTypes.UUID,
|
|
79
|
-
allowNull: false,
|
|
80
|
-
defaultValue: DataTypes.UUIDV4,
|
|
81
|
-
primaryKey: true
|
|
82
|
-
},
|
|
83
|
-
createdAt: {
|
|
84
|
-
type: DataTypes.DATE,
|
|
85
|
-
allowNull: false,
|
|
86
|
-
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
87
|
-
field: 'created_at'
|
|
88
|
-
},
|
|
89
|
-
updatedAt: {
|
|
90
|
-
type: DataTypes.DATE,
|
|
91
|
-
allowNull: false,
|
|
92
|
-
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
93
|
-
field: 'updated_at'
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
sequelize,
|
|
97
|
-
tableName: 'versus_question',
|
|
98
|
-
schema: 'eb',
|
|
99
|
-
timestamps: false,
|
|
100
|
-
indexes: [
|
|
101
|
-
{
|
|
102
|
-
name: "idx_versus_question_variable_type",
|
|
103
|
-
fields: [
|
|
104
|
-
{ name: "question_variable_type_id" },
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "idx_versus_question_voting_list",
|
|
109
|
-
fields: [
|
|
110
|
-
{ name: "voting_list_type_id" },
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: "versus_question_pkey",
|
|
115
|
-
unique: true,
|
|
116
|
-
fields: [
|
|
117
|
-
{ name: "id" },
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
]
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as Sequelize from 'sequelize';
|
|
2
|
-
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { VersusQuestion, VersusQuestionId } from './VersusQuestion';
|
|
4
|
-
|
|
5
|
-
export interface VersusQuestionVariableTypeAttributes {
|
|
6
|
-
id: number;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type VersusQuestionVariableTypePk = "id";
|
|
11
|
-
export type VersusQuestionVariableTypeId = VersusQuestionVariableType[VersusQuestionVariableTypePk];
|
|
12
|
-
export type VersusQuestionVariableTypeCreationAttributes = VersusQuestionVariableTypeAttributes;
|
|
13
|
-
|
|
14
|
-
export class VersusQuestionVariableType extends Model<VersusQuestionVariableTypeAttributes, VersusQuestionVariableTypeCreationAttributes> implements VersusQuestionVariableTypeAttributes {
|
|
15
|
-
id!: number;
|
|
16
|
-
description!: string;
|
|
17
|
-
|
|
18
|
-
// VersusQuestionVariableType hasMany VersusQuestion via questionVariableTypeId
|
|
19
|
-
versusQuestions!: VersusQuestion[];
|
|
20
|
-
getVersusQuestions!: Sequelize.HasManyGetAssociationsMixin<VersusQuestion>;
|
|
21
|
-
setVersusQuestions!: Sequelize.HasManySetAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
22
|
-
addVersusQuestion!: Sequelize.HasManyAddAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
23
|
-
addVersusQuestions!: Sequelize.HasManyAddAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
24
|
-
createVersusQuestion!: Sequelize.HasManyCreateAssociationMixin<VersusQuestion>;
|
|
25
|
-
removeVersusQuestion!: Sequelize.HasManyRemoveAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
26
|
-
removeVersusQuestions!: Sequelize.HasManyRemoveAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
27
|
-
hasVersusQuestion!: Sequelize.HasManyHasAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
28
|
-
hasVersusQuestions!: Sequelize.HasManyHasAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
29
|
-
countVersusQuestions!: Sequelize.HasManyCountAssociationsMixin;
|
|
30
|
-
|
|
31
|
-
static initModel(sequelize: Sequelize.Sequelize): typeof VersusQuestionVariableType {
|
|
32
|
-
return VersusQuestionVariableType.init({
|
|
33
|
-
id: {
|
|
34
|
-
type: DataTypes.SMALLINT,
|
|
35
|
-
allowNull: false,
|
|
36
|
-
primaryKey: true
|
|
37
|
-
},
|
|
38
|
-
description: {
|
|
39
|
-
type: DataTypes.STRING(64),
|
|
40
|
-
allowNull: false,
|
|
41
|
-
unique: "versus_question_variable_type_description_unique"
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
sequelize,
|
|
45
|
-
tableName: 'versus_question_variable_type',
|
|
46
|
-
schema: 'eb',
|
|
47
|
-
timestamps: false,
|
|
48
|
-
indexes: [
|
|
49
|
-
{
|
|
50
|
-
name: "versus_question_variable_type_description_unique",
|
|
51
|
-
unique: true,
|
|
52
|
-
fields: [
|
|
53
|
-
{ name: "description" },
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "versus_question_variable_type_pkey",
|
|
58
|
-
unique: true,
|
|
59
|
-
fields: [
|
|
60
|
-
{ name: "id" },
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
]
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
package/models/VersusVote.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as Sequelize from 'sequelize';
|
|
2
|
-
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { AppUser, AppUserId } from './AppUser';
|
|
4
|
-
import type { Versus, VersusId } from './Versus';
|
|
5
|
-
|
|
6
|
-
export interface VersusVoteAttributes {
|
|
7
|
-
versusId: string;
|
|
8
|
-
appUserId: string;
|
|
9
|
-
id: string;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type VersusVotePk = "id";
|
|
14
|
-
export type VersusVoteId = VersusVote[VersusVotePk];
|
|
15
|
-
export type VersusVoteOptionalAttributes = "id" | "createdAt";
|
|
16
|
-
export type VersusVoteCreationAttributes = Optional<VersusVoteAttributes, VersusVoteOptionalAttributes>;
|
|
17
|
-
|
|
18
|
-
export class VersusVote extends Model<VersusVoteAttributes, VersusVoteCreationAttributes> implements VersusVoteAttributes {
|
|
19
|
-
versusId!: string;
|
|
20
|
-
appUserId!: string;
|
|
21
|
-
id!: string;
|
|
22
|
-
createdAt!: Date;
|
|
23
|
-
|
|
24
|
-
// VersusVote belongsTo AppUser via appUserId
|
|
25
|
-
appUser!: AppUser;
|
|
26
|
-
getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
|
|
27
|
-
setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
|
|
28
|
-
createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
|
|
29
|
-
// VersusVote belongsTo Versus via versusId
|
|
30
|
-
versu!: Versus;
|
|
31
|
-
getVersu!: Sequelize.BelongsToGetAssociationMixin<Versus>;
|
|
32
|
-
setVersu!: Sequelize.BelongsToSetAssociationMixin<Versus, VersusId>;
|
|
33
|
-
createVersu!: Sequelize.BelongsToCreateAssociationMixin<Versus>;
|
|
34
|
-
|
|
35
|
-
static initModel(sequelize: Sequelize.Sequelize): typeof VersusVote {
|
|
36
|
-
return VersusVote.init({
|
|
37
|
-
versusId: {
|
|
38
|
-
type: DataTypes.UUID,
|
|
39
|
-
allowNull: false,
|
|
40
|
-
references: {
|
|
41
|
-
model: 'versus',
|
|
42
|
-
key: 'id'
|
|
43
|
-
},
|
|
44
|
-
unique: "uq_versus_vote_versus_app_user",
|
|
45
|
-
field: 'versus_id'
|
|
46
|
-
},
|
|
47
|
-
appUserId: {
|
|
48
|
-
type: DataTypes.UUID,
|
|
49
|
-
allowNull: false,
|
|
50
|
-
references: {
|
|
51
|
-
model: 'app_user',
|
|
52
|
-
key: 'id'
|
|
53
|
-
},
|
|
54
|
-
unique: "uq_versus_vote_versus_app_user",
|
|
55
|
-
field: 'app_user_id'
|
|
56
|
-
},
|
|
57
|
-
id: {
|
|
58
|
-
type: DataTypes.UUID,
|
|
59
|
-
allowNull: false,
|
|
60
|
-
defaultValue: DataTypes.UUIDV4,
|
|
61
|
-
primaryKey: true
|
|
62
|
-
},
|
|
63
|
-
createdAt: {
|
|
64
|
-
type: DataTypes.DATE,
|
|
65
|
-
allowNull: false,
|
|
66
|
-
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
67
|
-
field: 'created_at'
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
sequelize,
|
|
71
|
-
tableName: 'versus_vote',
|
|
72
|
-
schema: 'eb',
|
|
73
|
-
timestamps: false,
|
|
74
|
-
indexes: [
|
|
75
|
-
{
|
|
76
|
-
name: "idx_versus_vote_versus",
|
|
77
|
-
fields: [
|
|
78
|
-
{ name: "versus_id" },
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "uq_versus_vote_versus_app_user",
|
|
83
|
-
unique: true,
|
|
84
|
-
fields: [
|
|
85
|
-
{ name: "versus_id" },
|
|
86
|
-
{ name: "app_user_id" },
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "versus_vote_pkey",
|
|
91
|
-
unique: true,
|
|
92
|
-
fields: [
|
|
93
|
-
{ name: "id" },
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as Sequelize from 'sequelize';
|
|
2
|
-
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { VersusQuestion, VersusQuestionId } from './VersusQuestion';
|
|
4
|
-
|
|
5
|
-
export interface VersusVotingListTypeAttributes {
|
|
6
|
-
id: number;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type VersusVotingListTypePk = "id";
|
|
11
|
-
export type VersusVotingListTypeId = VersusVotingListType[VersusVotingListTypePk];
|
|
12
|
-
export type VersusVotingListTypeCreationAttributes = VersusVotingListTypeAttributes;
|
|
13
|
-
|
|
14
|
-
export class VersusVotingListType extends Model<VersusVotingListTypeAttributes, VersusVotingListTypeCreationAttributes> implements VersusVotingListTypeAttributes {
|
|
15
|
-
id!: number;
|
|
16
|
-
description!: string;
|
|
17
|
-
|
|
18
|
-
// VersusVotingListType hasMany VersusQuestion via votingListTypeId
|
|
19
|
-
versusQuestions!: VersusQuestion[];
|
|
20
|
-
getVersusQuestions!: Sequelize.HasManyGetAssociationsMixin<VersusQuestion>;
|
|
21
|
-
setVersusQuestions!: Sequelize.HasManySetAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
22
|
-
addVersusQuestion!: Sequelize.HasManyAddAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
23
|
-
addVersusQuestions!: Sequelize.HasManyAddAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
24
|
-
createVersusQuestion!: Sequelize.HasManyCreateAssociationMixin<VersusQuestion>;
|
|
25
|
-
removeVersusQuestion!: Sequelize.HasManyRemoveAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
26
|
-
removeVersusQuestions!: Sequelize.HasManyRemoveAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
27
|
-
hasVersusQuestion!: Sequelize.HasManyHasAssociationMixin<VersusQuestion, VersusQuestionId>;
|
|
28
|
-
hasVersusQuestions!: Sequelize.HasManyHasAssociationsMixin<VersusQuestion, VersusQuestionId>;
|
|
29
|
-
countVersusQuestions!: Sequelize.HasManyCountAssociationsMixin;
|
|
30
|
-
|
|
31
|
-
static initModel(sequelize: Sequelize.Sequelize): typeof VersusVotingListType {
|
|
32
|
-
return VersusVotingListType.init({
|
|
33
|
-
id: {
|
|
34
|
-
type: DataTypes.SMALLINT,
|
|
35
|
-
allowNull: false,
|
|
36
|
-
primaryKey: true
|
|
37
|
-
},
|
|
38
|
-
description: {
|
|
39
|
-
type: DataTypes.STRING(64),
|
|
40
|
-
allowNull: false,
|
|
41
|
-
unique: "versus_voting_list_type_description_unique"
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
sequelize,
|
|
45
|
-
tableName: 'versus_voting_list_type',
|
|
46
|
-
schema: 'eb',
|
|
47
|
-
timestamps: false,
|
|
48
|
-
indexes: [
|
|
49
|
-
{
|
|
50
|
-
name: "versus_voting_list_type_description_unique",
|
|
51
|
-
unique: true,
|
|
52
|
-
fields: [
|
|
53
|
-
{ name: "description" },
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "versus_voting_list_type_pkey",
|
|
58
|
-
unique: true,
|
|
59
|
-
fields: [
|
|
60
|
-
{ name: "id" },
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
]
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as Sequelize from 'sequelize';
|
|
2
|
-
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
-
import type { Versus, VersusId } from './Versus';
|
|
4
|
-
|
|
5
|
-
export interface VersusVotingModeAttributes {
|
|
6
|
-
id: number;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type VersusVotingModePk = "id";
|
|
11
|
-
export type VersusVotingModeId = VersusVotingMode[VersusVotingModePk];
|
|
12
|
-
export type VersusVotingModeCreationAttributes = VersusVotingModeAttributes;
|
|
13
|
-
|
|
14
|
-
export class VersusVotingMode extends Model<VersusVotingModeAttributes, VersusVotingModeCreationAttributes> implements VersusVotingModeAttributes {
|
|
15
|
-
id!: number;
|
|
16
|
-
description!: string;
|
|
17
|
-
|
|
18
|
-
// VersusVotingMode hasMany Versus via versusVotingModeId
|
|
19
|
-
versus!: Versus[];
|
|
20
|
-
getVersus!: Sequelize.HasManyGetAssociationsMixin<Versus>;
|
|
21
|
-
setVersus!: Sequelize.HasManySetAssociationsMixin<Versus, VersusId>;
|
|
22
|
-
addVersu!: Sequelize.HasManyAddAssociationMixin<Versus, VersusId>;
|
|
23
|
-
addVersus!: Sequelize.HasManyAddAssociationsMixin<Versus, VersusId>;
|
|
24
|
-
createVersu!: Sequelize.HasManyCreateAssociationMixin<Versus>;
|
|
25
|
-
removeVersu!: Sequelize.HasManyRemoveAssociationMixin<Versus, VersusId>;
|
|
26
|
-
removeVersus!: Sequelize.HasManyRemoveAssociationsMixin<Versus, VersusId>;
|
|
27
|
-
hasVersu!: Sequelize.HasManyHasAssociationMixin<Versus, VersusId>;
|
|
28
|
-
hasVersus!: Sequelize.HasManyHasAssociationsMixin<Versus, VersusId>;
|
|
29
|
-
countVersus!: Sequelize.HasManyCountAssociationsMixin;
|
|
30
|
-
|
|
31
|
-
static initModel(sequelize: Sequelize.Sequelize): typeof VersusVotingMode {
|
|
32
|
-
return VersusVotingMode.init({
|
|
33
|
-
id: {
|
|
34
|
-
type: DataTypes.SMALLINT,
|
|
35
|
-
allowNull: false,
|
|
36
|
-
primaryKey: true
|
|
37
|
-
},
|
|
38
|
-
description: {
|
|
39
|
-
type: DataTypes.STRING(64),
|
|
40
|
-
allowNull: false,
|
|
41
|
-
unique: "versus_voting_mode_description_unique"
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
sequelize,
|
|
45
|
-
tableName: 'versus_voting_mode',
|
|
46
|
-
schema: 'eb',
|
|
47
|
-
timestamps: false,
|
|
48
|
-
indexes: [
|
|
49
|
-
{
|
|
50
|
-
name: "versus_voting_mode_description_unique",
|
|
51
|
-
unique: true,
|
|
52
|
-
fields: [
|
|
53
|
-
{ name: "description" },
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "versus_voting_mode_pkey",
|
|
58
|
-
unique: true,
|
|
59
|
-
fields: [
|
|
60
|
-
{ name: "id" },
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
]
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
package/models/index.ts
DELETED
package/models/init-models.ts
DELETED
package/models/initDb.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Sequelize, Options } from "sequelize";
|
|
2
|
-
import { initModels } from "./init-models";
|
|
3
|
-
import { RDS_GLOBAL_CA_BUNDLE } from "./rdsCaBundle";
|
|
4
|
-
|
|
5
|
-
const REQUIRED_ENV_VARS = ["PG_DATABASE", "PG_USER", "PG_HOST"] as const;
|
|
6
|
-
|
|
7
|
-
export interface InitDbOptions {
|
|
8
|
-
pool?: Options["pool"];
|
|
9
|
-
retry?: Options["retry"];
|
|
10
|
-
logging?: Options["logging"];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* TLS settings that validate an RDS endpoint against the bundled AWS RDS CA
|
|
15
|
-
* bundle. Exported for services that construct their own Sequelize/pg client.
|
|
16
|
-
*/
|
|
17
|
-
export const RDS_SSL_CONFIG = Object.freeze({
|
|
18
|
-
ca: RDS_GLOBAL_CA_BUNDLE,
|
|
19
|
-
rejectUnauthorized: true,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export function initDb(options: InitDbOptions = {}): Sequelize {
|
|
23
|
-
const missing = REQUIRED_ENV_VARS.filter((v) => !process.env[v]);
|
|
24
|
-
if (missing.length > 0) {
|
|
25
|
-
throw new Error(
|
|
26
|
-
`Missing required environment variables: ${missing.join(", ")}`,
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.log(
|
|
32
|
-
`Initializing DB connection to ${process.env.PG_HOST}:${process.env.PG_PORT || "5432"}/${process.env.PG_DATABASE}${process.env.PG_SSL === "true" ? " (TLS)" : ""}...`,
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const sequelize = new Sequelize(
|
|
36
|
-
process.env.PG_DATABASE!,
|
|
37
|
-
process.env.PG_USER!,
|
|
38
|
-
process.env.PG_PASSWORD,
|
|
39
|
-
{
|
|
40
|
-
host: process.env.PG_HOST,
|
|
41
|
-
port: parseInt(process.env.PG_PORT || "5432"),
|
|
42
|
-
dialect: "postgres",
|
|
43
|
-
schema: "eb",
|
|
44
|
-
minifyAliases: true,
|
|
45
|
-
logging: options.logging ?? false,
|
|
46
|
-
dialectOptions: process.env.PG_SSL === "true" ? { ssl: RDS_SSL_CONFIG } : undefined,
|
|
47
|
-
pool: options.pool ?? {
|
|
48
|
-
max: 10,
|
|
49
|
-
min: 1,
|
|
50
|
-
acquire: 30000,
|
|
51
|
-
idle: 10000,
|
|
52
|
-
evict: 1000,
|
|
53
|
-
},
|
|
54
|
-
retry: options.retry ?? {
|
|
55
|
-
max: 2,
|
|
56
|
-
match: [
|
|
57
|
-
/ConnectionError/,
|
|
58
|
-
/ConnectionRefused/,
|
|
59
|
-
/ConnectionAcquireTimeout/,
|
|
60
|
-
/ECONNRESET/,
|
|
61
|
-
/ETIMEDOUT/,
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
initModels(sequelize);
|
|
68
|
-
|
|
69
|
-
console.log("DB connection initialized.");
|
|
70
|
-
|
|
71
|
-
return sequelize;
|
|
72
|
-
}
|