@earbug/db-models 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppUser.d.ts +24 -0
- package/dist/CanonAlbum.d.ts +24 -0
- package/dist/CanonArtist.d.ts +24 -0
- package/dist/CanonGenre.d.ts +12 -0
- package/dist/CanonTrack.d.ts +24 -0
- package/dist/GuestUser.d.ts +22 -3
- package/dist/GuestUser.js +24 -9
- package/dist/JukeboxSession.d.ts +3 -1
- package/dist/JukeboxSession.js +5 -0
- package/dist/PlatformAlbum.d.ts +36 -0
- package/dist/PlatformArtist.d.ts +36 -0
- package/dist/PlatformTrack.d.ts +36 -0
- package/dist/Versus.d.ts +182 -0
- package/dist/Versus.js +251 -0
- package/dist/VersusAccessType.d.ts +26 -0
- package/dist/VersusAccessType.js +42 -0
- package/dist/VersusCoCreator.d.ts +40 -0
- package/dist/VersusCoCreator.js +117 -0
- package/dist/VersusCreatorScope.d.ts +26 -0
- package/dist/VersusCreatorScope.js +42 -0
- package/dist/VersusEndMode.d.ts +26 -0
- package/dist/VersusEndMode.js +42 -0
- package/dist/VersusEndTimerDuration.d.ts +28 -0
- package/dist/VersusEndTimerDuration.js +55 -0
- package/dist/VersusEndVoteThreshold.d.ts +26 -0
- package/dist/VersusEndVoteThreshold.js +43 -0
- package/dist/VersusEntityKind.d.ts +38 -0
- package/dist/VersusEntityKind.js +42 -0
- package/dist/VersusOption.d.ts +79 -0
- package/dist/VersusOption.js +167 -0
- package/dist/VersusPublishIssue.d.ts +52 -0
- package/dist/VersusPublishIssue.js +116 -0
- package/dist/VersusQuestion.d.ts +45 -0
- package/dist/VersusQuestion.js +102 -0
- package/dist/VersusQuestionVariableType.d.ts +26 -0
- package/dist/VersusQuestionVariableType.js +42 -0
- package/dist/VersusVotingListType.d.ts +26 -0
- package/dist/VersusVotingListType.js +42 -0
- package/dist/VersusVotingMode.d.ts +26 -0
- package/dist/VersusVotingMode.js +42 -0
- package/dist/init-models.d.ts +44 -2
- package/dist/init-models.js +125 -0
- package/models/AppUser.ts +26 -0
- package/models/CanonAlbum.ts +26 -0
- package/models/CanonArtist.ts +26 -0
- package/models/CanonGenre.ts +13 -0
- package/models/CanonTrack.ts +26 -0
- package/models/GuestUser.ts +48 -12
- package/models/JukeboxSession.ts +8 -1
- package/models/PlatformAlbum.ts +39 -0
- package/models/PlatformArtist.ts +39 -0
- package/models/PlatformTrack.ts +39 -0
- package/models/Versus.ts +425 -0
- package/models/VersusAccessType.ts +66 -0
- package/models/VersusCoCreator.ts +133 -0
- package/models/VersusCreatorScope.ts +66 -0
- package/models/VersusEndMode.ts +66 -0
- package/models/VersusEndTimerDuration.ts +81 -0
- package/models/VersusEndVoteThreshold.ts +67 -0
- package/models/VersusEntityKind.ts +79 -0
- package/models/VersusOption.ts +227 -0
- package/models/VersusPublishIssue.ts +146 -0
- package/models/VersusQuestion.ts +123 -0
- package/models/VersusQuestionVariableType.ts +66 -0
- package/models/VersusVotingListType.ts +66 -0
- package/models/VersusVotingMode.ts +66 -0
- package/models/init-models.ts +166 -0
- package/package.json +1 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
|
|
4
|
+
import type { CanonArtist, CanonArtistId } from './CanonArtist';
|
|
5
|
+
import type { CanonTrack, CanonTrackId } from './CanonTrack';
|
|
6
|
+
import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
|
|
7
|
+
import type { PlatformArtist, PlatformArtistId } from './PlatformArtist';
|
|
8
|
+
import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
9
|
+
import type { Versus, VersusId } from './Versus';
|
|
10
|
+
import type { VersusEntityKind, VersusEntityKindId } from './VersusEntityKind';
|
|
11
|
+
|
|
12
|
+
export interface VersusOptionAttributes {
|
|
13
|
+
versusId: string;
|
|
14
|
+
entityKindId: number;
|
|
15
|
+
sortOrder: number;
|
|
16
|
+
canonTrackId?: string;
|
|
17
|
+
platformTrackId?: string;
|
|
18
|
+
canonAlbumId?: string;
|
|
19
|
+
platformAlbumId?: string;
|
|
20
|
+
canonArtistId?: string;
|
|
21
|
+
platformArtistId?: string;
|
|
22
|
+
voteScore?: number;
|
|
23
|
+
resultsScore?: number;
|
|
24
|
+
id: string;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type VersusOptionPk = "id";
|
|
30
|
+
export type VersusOptionId = VersusOption[VersusOptionPk];
|
|
31
|
+
export type VersusOptionOptionalAttributes = "canonTrackId" | "platformTrackId" | "canonAlbumId" | "platformAlbumId" | "canonArtistId" | "platformArtistId" | "voteScore" | "resultsScore" | "id" | "createdAt" | "updatedAt";
|
|
32
|
+
export type VersusOptionCreationAttributes = Optional<VersusOptionAttributes, VersusOptionOptionalAttributes>;
|
|
33
|
+
|
|
34
|
+
export class VersusOption extends Model<VersusOptionAttributes, VersusOptionCreationAttributes> implements VersusOptionAttributes {
|
|
35
|
+
versusId!: string;
|
|
36
|
+
entityKindId!: number;
|
|
37
|
+
sortOrder!: number;
|
|
38
|
+
canonTrackId?: string;
|
|
39
|
+
platformTrackId?: string;
|
|
40
|
+
canonAlbumId?: string;
|
|
41
|
+
platformAlbumId?: string;
|
|
42
|
+
canonArtistId?: string;
|
|
43
|
+
platformArtistId?: string;
|
|
44
|
+
voteScore?: number;
|
|
45
|
+
resultsScore?: number;
|
|
46
|
+
id!: string;
|
|
47
|
+
createdAt!: Date;
|
|
48
|
+
updatedAt!: Date;
|
|
49
|
+
|
|
50
|
+
// VersusOption belongsTo CanonAlbum via canonAlbumId
|
|
51
|
+
canonAlbum!: CanonAlbum;
|
|
52
|
+
getCanonAlbum!: Sequelize.BelongsToGetAssociationMixin<CanonAlbum>;
|
|
53
|
+
setCanonAlbum!: Sequelize.BelongsToSetAssociationMixin<CanonAlbum, CanonAlbumId>;
|
|
54
|
+
createCanonAlbum!: Sequelize.BelongsToCreateAssociationMixin<CanonAlbum>;
|
|
55
|
+
// VersusOption belongsTo CanonArtist via canonArtistId
|
|
56
|
+
canonArtist!: CanonArtist;
|
|
57
|
+
getCanonArtist!: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
|
|
58
|
+
setCanonArtist!: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
|
|
59
|
+
createCanonArtist!: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
|
|
60
|
+
// VersusOption belongsTo CanonTrack via canonTrackId
|
|
61
|
+
canonTrack!: CanonTrack;
|
|
62
|
+
getCanonTrack!: Sequelize.BelongsToGetAssociationMixin<CanonTrack>;
|
|
63
|
+
setCanonTrack!: Sequelize.BelongsToSetAssociationMixin<CanonTrack, CanonTrackId>;
|
|
64
|
+
createCanonTrack!: Sequelize.BelongsToCreateAssociationMixin<CanonTrack>;
|
|
65
|
+
// VersusOption belongsTo PlatformAlbum via platformAlbumId
|
|
66
|
+
platformAlbum!: PlatformAlbum;
|
|
67
|
+
getPlatformAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformAlbum>;
|
|
68
|
+
setPlatformAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
69
|
+
createPlatformAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformAlbum>;
|
|
70
|
+
// VersusOption belongsTo PlatformArtist via platformArtistId
|
|
71
|
+
platformArtist!: PlatformArtist;
|
|
72
|
+
getPlatformArtist!: Sequelize.BelongsToGetAssociationMixin<PlatformArtist>;
|
|
73
|
+
setPlatformArtist!: Sequelize.BelongsToSetAssociationMixin<PlatformArtist, PlatformArtistId>;
|
|
74
|
+
createPlatformArtist!: Sequelize.BelongsToCreateAssociationMixin<PlatformArtist>;
|
|
75
|
+
// VersusOption belongsTo PlatformTrack via platformTrackId
|
|
76
|
+
platformTrack!: PlatformTrack;
|
|
77
|
+
getPlatformTrack!: Sequelize.BelongsToGetAssociationMixin<PlatformTrack>;
|
|
78
|
+
setPlatformTrack!: Sequelize.BelongsToSetAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
79
|
+
createPlatformTrack!: Sequelize.BelongsToCreateAssociationMixin<PlatformTrack>;
|
|
80
|
+
// VersusOption belongsTo Versus via versusId
|
|
81
|
+
versu!: Versus;
|
|
82
|
+
getVersu!: Sequelize.BelongsToGetAssociationMixin<Versus>;
|
|
83
|
+
setVersu!: Sequelize.BelongsToSetAssociationMixin<Versus, VersusId>;
|
|
84
|
+
createVersu!: Sequelize.BelongsToCreateAssociationMixin<Versus>;
|
|
85
|
+
// VersusOption belongsTo VersusEntityKind via entityKindId
|
|
86
|
+
entityKind!: VersusEntityKind;
|
|
87
|
+
getEntityKind!: Sequelize.BelongsToGetAssociationMixin<VersusEntityKind>;
|
|
88
|
+
setEntityKind!: Sequelize.BelongsToSetAssociationMixin<VersusEntityKind, VersusEntityKindId>;
|
|
89
|
+
createEntityKind!: Sequelize.BelongsToCreateAssociationMixin<VersusEntityKind>;
|
|
90
|
+
|
|
91
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof VersusOption {
|
|
92
|
+
return VersusOption.init({
|
|
93
|
+
versusId: {
|
|
94
|
+
type: DataTypes.UUID,
|
|
95
|
+
allowNull: false,
|
|
96
|
+
references: {
|
|
97
|
+
model: 'versus',
|
|
98
|
+
key: 'id'
|
|
99
|
+
},
|
|
100
|
+
field: 'versus_id'
|
|
101
|
+
},
|
|
102
|
+
entityKindId: {
|
|
103
|
+
type: DataTypes.SMALLINT,
|
|
104
|
+
allowNull: false,
|
|
105
|
+
references: {
|
|
106
|
+
model: 'versus_entity_kind',
|
|
107
|
+
key: 'id'
|
|
108
|
+
},
|
|
109
|
+
field: 'entity_kind_id'
|
|
110
|
+
},
|
|
111
|
+
sortOrder: {
|
|
112
|
+
type: DataTypes.INTEGER,
|
|
113
|
+
allowNull: false,
|
|
114
|
+
field: 'sort_order'
|
|
115
|
+
},
|
|
116
|
+
canonTrackId: {
|
|
117
|
+
type: DataTypes.UUID,
|
|
118
|
+
allowNull: true,
|
|
119
|
+
references: {
|
|
120
|
+
model: 'canon_track',
|
|
121
|
+
key: 'id'
|
|
122
|
+
},
|
|
123
|
+
field: 'canon_track_id'
|
|
124
|
+
},
|
|
125
|
+
platformTrackId: {
|
|
126
|
+
type: DataTypes.UUID,
|
|
127
|
+
allowNull: true,
|
|
128
|
+
references: {
|
|
129
|
+
model: 'platform_track',
|
|
130
|
+
key: 'id'
|
|
131
|
+
},
|
|
132
|
+
field: 'platform_track_id'
|
|
133
|
+
},
|
|
134
|
+
canonAlbumId: {
|
|
135
|
+
type: DataTypes.UUID,
|
|
136
|
+
allowNull: true,
|
|
137
|
+
references: {
|
|
138
|
+
model: 'canon_album',
|
|
139
|
+
key: 'id'
|
|
140
|
+
},
|
|
141
|
+
field: 'canon_album_id'
|
|
142
|
+
},
|
|
143
|
+
platformAlbumId: {
|
|
144
|
+
type: DataTypes.UUID,
|
|
145
|
+
allowNull: true,
|
|
146
|
+
references: {
|
|
147
|
+
model: 'platform_album',
|
|
148
|
+
key: 'id'
|
|
149
|
+
},
|
|
150
|
+
field: 'platform_album_id'
|
|
151
|
+
},
|
|
152
|
+
canonArtistId: {
|
|
153
|
+
type: DataTypes.UUID,
|
|
154
|
+
allowNull: true,
|
|
155
|
+
references: {
|
|
156
|
+
model: 'canon_artist',
|
|
157
|
+
key: 'id'
|
|
158
|
+
},
|
|
159
|
+
field: 'canon_artist_id'
|
|
160
|
+
},
|
|
161
|
+
platformArtistId: {
|
|
162
|
+
type: DataTypes.UUID,
|
|
163
|
+
allowNull: true,
|
|
164
|
+
references: {
|
|
165
|
+
model: 'platform_artist',
|
|
166
|
+
key: 'id'
|
|
167
|
+
},
|
|
168
|
+
field: 'platform_artist_id'
|
|
169
|
+
},
|
|
170
|
+
voteScore: {
|
|
171
|
+
type: DataTypes.INTEGER,
|
|
172
|
+
allowNull: true,
|
|
173
|
+
field: 'vote_score'
|
|
174
|
+
},
|
|
175
|
+
resultsScore: {
|
|
176
|
+
type: DataTypes.SMALLINT,
|
|
177
|
+
allowNull: true,
|
|
178
|
+
field: 'results_score'
|
|
179
|
+
},
|
|
180
|
+
id: {
|
|
181
|
+
type: DataTypes.UUID,
|
|
182
|
+
allowNull: false,
|
|
183
|
+
defaultValue: DataTypes.UUIDV4,
|
|
184
|
+
primaryKey: true
|
|
185
|
+
},
|
|
186
|
+
createdAt: {
|
|
187
|
+
type: DataTypes.DATE,
|
|
188
|
+
allowNull: false,
|
|
189
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
190
|
+
field: 'created_at'
|
|
191
|
+
},
|
|
192
|
+
updatedAt: {
|
|
193
|
+
type: DataTypes.DATE,
|
|
194
|
+
allowNull: false,
|
|
195
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
196
|
+
field: 'updated_at'
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
sequelize,
|
|
200
|
+
tableName: 'versus_option',
|
|
201
|
+
schema: 'eb',
|
|
202
|
+
timestamps: false,
|
|
203
|
+
indexes: [
|
|
204
|
+
{
|
|
205
|
+
name: "idx_versus_option_versus",
|
|
206
|
+
fields: [
|
|
207
|
+
{ name: "versus_id" },
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "idx_versus_option_versus_sort",
|
|
212
|
+
fields: [
|
|
213
|
+
{ name: "versus_id" },
|
|
214
|
+
{ name: "sort_order" },
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "versus_option_pkey",
|
|
219
|
+
unique: true,
|
|
220
|
+
fields: [
|
|
221
|
+
{ name: "id" },
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
|
|
4
|
+
import type { PlatformArtist, PlatformArtistId } from './PlatformArtist';
|
|
5
|
+
import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
|
|
6
|
+
import type { Versus, VersusId } from './Versus';
|
|
7
|
+
import type { VersusEntityKind, VersusEntityKindId } from './VersusEntityKind';
|
|
8
|
+
|
|
9
|
+
export interface VersusPublishIssueAttributes {
|
|
10
|
+
versusId: string;
|
|
11
|
+
entityKindId: number;
|
|
12
|
+
platformTrackId?: string;
|
|
13
|
+
platformAlbumId?: string;
|
|
14
|
+
platformArtistId?: string;
|
|
15
|
+
detail?: string;
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type VersusPublishIssuePk = "id";
|
|
21
|
+
export type VersusPublishIssueId = VersusPublishIssue[VersusPublishIssuePk];
|
|
22
|
+
export type VersusPublishIssueOptionalAttributes = "platformTrackId" | "platformAlbumId" | "platformArtistId" | "detail" | "id" | "createdAt";
|
|
23
|
+
export type VersusPublishIssueCreationAttributes = Optional<VersusPublishIssueAttributes, VersusPublishIssueOptionalAttributes>;
|
|
24
|
+
|
|
25
|
+
export class VersusPublishIssue extends Model<VersusPublishIssueAttributes, VersusPublishIssueCreationAttributes> implements VersusPublishIssueAttributes {
|
|
26
|
+
versusId!: string;
|
|
27
|
+
entityKindId!: number;
|
|
28
|
+
platformTrackId?: string;
|
|
29
|
+
platformAlbumId?: string;
|
|
30
|
+
platformArtistId?: string;
|
|
31
|
+
detail?: string;
|
|
32
|
+
id!: string;
|
|
33
|
+
createdAt!: Date;
|
|
34
|
+
|
|
35
|
+
// VersusPublishIssue belongsTo PlatformAlbum via platformAlbumId
|
|
36
|
+
platformAlbum!: PlatformAlbum;
|
|
37
|
+
getPlatformAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformAlbum>;
|
|
38
|
+
setPlatformAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformAlbum, PlatformAlbumId>;
|
|
39
|
+
createPlatformAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformAlbum>;
|
|
40
|
+
// VersusPublishIssue belongsTo PlatformArtist via platformArtistId
|
|
41
|
+
platformArtist!: PlatformArtist;
|
|
42
|
+
getPlatformArtist!: Sequelize.BelongsToGetAssociationMixin<PlatformArtist>;
|
|
43
|
+
setPlatformArtist!: Sequelize.BelongsToSetAssociationMixin<PlatformArtist, PlatformArtistId>;
|
|
44
|
+
createPlatformArtist!: Sequelize.BelongsToCreateAssociationMixin<PlatformArtist>;
|
|
45
|
+
// VersusPublishIssue belongsTo PlatformTrack via platformTrackId
|
|
46
|
+
platformTrack!: PlatformTrack;
|
|
47
|
+
getPlatformTrack!: Sequelize.BelongsToGetAssociationMixin<PlatformTrack>;
|
|
48
|
+
setPlatformTrack!: Sequelize.BelongsToSetAssociationMixin<PlatformTrack, PlatformTrackId>;
|
|
49
|
+
createPlatformTrack!: Sequelize.BelongsToCreateAssociationMixin<PlatformTrack>;
|
|
50
|
+
// VersusPublishIssue belongsTo Versus via versusId
|
|
51
|
+
versu!: Versus;
|
|
52
|
+
getVersu!: Sequelize.BelongsToGetAssociationMixin<Versus>;
|
|
53
|
+
setVersu!: Sequelize.BelongsToSetAssociationMixin<Versus, VersusId>;
|
|
54
|
+
createVersu!: Sequelize.BelongsToCreateAssociationMixin<Versus>;
|
|
55
|
+
// VersusPublishIssue belongsTo VersusEntityKind via entityKindId
|
|
56
|
+
entityKind!: VersusEntityKind;
|
|
57
|
+
getEntityKind!: Sequelize.BelongsToGetAssociationMixin<VersusEntityKind>;
|
|
58
|
+
setEntityKind!: Sequelize.BelongsToSetAssociationMixin<VersusEntityKind, VersusEntityKindId>;
|
|
59
|
+
createEntityKind!: Sequelize.BelongsToCreateAssociationMixin<VersusEntityKind>;
|
|
60
|
+
|
|
61
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof VersusPublishIssue {
|
|
62
|
+
return VersusPublishIssue.init({
|
|
63
|
+
versusId: {
|
|
64
|
+
type: DataTypes.UUID,
|
|
65
|
+
allowNull: false,
|
|
66
|
+
references: {
|
|
67
|
+
model: 'versus',
|
|
68
|
+
key: 'id'
|
|
69
|
+
},
|
|
70
|
+
field: 'versus_id'
|
|
71
|
+
},
|
|
72
|
+
entityKindId: {
|
|
73
|
+
type: DataTypes.SMALLINT,
|
|
74
|
+
allowNull: false,
|
|
75
|
+
references: {
|
|
76
|
+
model: 'versus_entity_kind',
|
|
77
|
+
key: 'id'
|
|
78
|
+
},
|
|
79
|
+
field: 'entity_kind_id'
|
|
80
|
+
},
|
|
81
|
+
platformTrackId: {
|
|
82
|
+
type: DataTypes.UUID,
|
|
83
|
+
allowNull: true,
|
|
84
|
+
references: {
|
|
85
|
+
model: 'platform_track',
|
|
86
|
+
key: 'id'
|
|
87
|
+
},
|
|
88
|
+
field: 'platform_track_id'
|
|
89
|
+
},
|
|
90
|
+
platformAlbumId: {
|
|
91
|
+
type: DataTypes.UUID,
|
|
92
|
+
allowNull: true,
|
|
93
|
+
references: {
|
|
94
|
+
model: 'platform_album',
|
|
95
|
+
key: 'id'
|
|
96
|
+
},
|
|
97
|
+
field: 'platform_album_id'
|
|
98
|
+
},
|
|
99
|
+
platformArtistId: {
|
|
100
|
+
type: DataTypes.UUID,
|
|
101
|
+
allowNull: true,
|
|
102
|
+
references: {
|
|
103
|
+
model: 'platform_artist',
|
|
104
|
+
key: 'id'
|
|
105
|
+
},
|
|
106
|
+
field: 'platform_artist_id'
|
|
107
|
+
},
|
|
108
|
+
detail: {
|
|
109
|
+
type: DataTypes.TEXT,
|
|
110
|
+
allowNull: true
|
|
111
|
+
},
|
|
112
|
+
id: {
|
|
113
|
+
type: DataTypes.UUID,
|
|
114
|
+
allowNull: false,
|
|
115
|
+
defaultValue: DataTypes.UUIDV4,
|
|
116
|
+
primaryKey: true
|
|
117
|
+
},
|
|
118
|
+
createdAt: {
|
|
119
|
+
type: DataTypes.DATE,
|
|
120
|
+
allowNull: false,
|
|
121
|
+
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
122
|
+
field: 'created_at'
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
sequelize,
|
|
126
|
+
tableName: 'versus_publish_issue',
|
|
127
|
+
schema: 'eb',
|
|
128
|
+
timestamps: false,
|
|
129
|
+
indexes: [
|
|
130
|
+
{
|
|
131
|
+
name: "idx_versus_publish_issue_versus",
|
|
132
|
+
fields: [
|
|
133
|
+
{ name: "versus_id" },
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "versus_publish_issue_pkey",
|
|
138
|
+
unique: true,
|
|
139
|
+
fields: [
|
|
140
|
+
{ name: "id" },
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
}
|