tempest.games 0.1.45 → 0.2.0

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.
@@ -0,0 +1,17 @@
1
+ CREATE TYPE "public"."accountAction" AS ENUM('emailConfirm', 'passwordReset', 'emailChange');--> statement-breakpoint
2
+ CREATE TABLE "userTokens" (
3
+ "userId" uuid PRIMARY KEY NOT NULL,
4
+ "action" "accountAction" NOT NULL,
5
+ "token" varchar(255) NOT NULL,
6
+ "expiresAt" timestamp with time zone NOT NULL
7
+ );
8
+ --> statement-breakpoint
9
+ ALTER TABLE "userChanges" DISABLE ROW LEVEL SECURITY;--> statement-breakpoint
10
+ DROP TABLE "userChanges" CASCADE;--> statement-breakpoint
11
+ ALTER TABLE "users" RENAME COLUMN "email" TO "emailOffered";--> statement-breakpoint
12
+ DROP INDEX "emailUniqueIndex";--> statement-breakpoint
13
+ ALTER TABLE "users" ADD COLUMN "emailVerified" varchar(254);--> statement-breakpoint
14
+ ALTER TABLE "userTokens" ADD CONSTRAINT "userTokens_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
15
+ CREATE UNIQUE INDEX "emailVerifiedUniqueIndex" ON "users" USING btree (lower("emailVerified"));--> statement-breakpoint
16
+ DROP TYPE "public"."trackedUserColumnName";--> statement-breakpoint
17
+ CREATE TYPE "public"."trackedUserColumnName" AS ENUM('username', 'emailOffered', 'emailVerified', 'password', 'userRole');
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "userTokens" ALTER COLUMN "token" SET DATA TYPE varchar(7);--> statement-breakpoint
2
+ ALTER TABLE "userTokens" ADD COLUMN "wrongTokenCount" integer DEFAULT 0 NOT NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE "userTokens" ALTER COLUMN "token" SET DATA TYPE varchar(9);
@@ -0,0 +1,2 @@
1
+ ALTER TYPE "public"."accountAction" ADD VALUE 'cooldown';--> statement-breakpoint
2
+ ALTER TABLE "userTokens" ALTER COLUMN "token" SET DATA TYPE varchar(254);
@@ -0,0 +1,7 @@
1
+ ALTER TABLE "userTokens" RENAME COLUMN "token" TO "code";--> statement-breakpoint
2
+ ALTER TABLE "userTokens" RENAME COLUMN "wrongTokenCount" TO "wrongCodeCount";--> statement-breakpoint
3
+ ALTER TABLE "userTokens" ALTER COLUMN "action" SET DATA TYPE text;--> statement-breakpoint
4
+ DROP TYPE "public"."accountAction";--> statement-breakpoint
5
+ CREATE TYPE "public"."accountAction" AS ENUM('cooldown', 'confirmEmail', 'login', 'resetPassword');--> statement-breakpoint
6
+ ALTER TABLE "userTokens" ALTER COLUMN "action" SET DATA TYPE "public"."accountAction" USING "action"::"public"."accountAction";--> statement-breakpoint
7
+ ALTER TABLE "users" ALTER COLUMN "password" DROP NOT NULL;
@@ -0,0 +1,4 @@
1
+ ALTER TABLE "userTokens" RENAME TO "accountActions";--> statement-breakpoint
2
+ ALTER TABLE "accountActions" DROP CONSTRAINT "userTokens_userId_users_id_fk";
3
+ --> statement-breakpoint
4
+ ALTER TABLE "accountActions" ADD CONSTRAINT "accountActions_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
@@ -0,0 +1,9 @@
1
+ ALTER TABLE "loginHistory" RENAME TO "signInHistory";--> statement-breakpoint
2
+ ALTER TABLE "signInHistory" RENAME COLUMN "loginTime" TO "signInTime";--> statement-breakpoint
3
+ ALTER TABLE "signInHistory" DROP CONSTRAINT "loginHistory_userId_users_id_fk";
4
+ --> statement-breakpoint
5
+ ALTER TABLE "accountActions" ALTER COLUMN "action" SET DATA TYPE text;--> statement-breakpoint
6
+ DROP TYPE "public"."accountAction";--> statement-breakpoint
7
+ CREATE TYPE "public"."accountAction" AS ENUM('cooldown', 'confirmEmail', 'signIn', 'resetPassword');--> statement-breakpoint
8
+ ALTER TABLE "accountActions" ALTER COLUMN "action" SET DATA TYPE "public"."accountAction" USING "action"::"public"."accountAction";--> statement-breakpoint
9
+ ALTER TABLE "signInHistory" ADD CONSTRAINT "signInHistory_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
@@ -0,0 +1,479 @@
1
+ {
2
+ "id": "de3f720d-34b1-4d8b-816d-1778d35f8f8a",
3
+ "prevId": "95d65a25-90fa-4a68-bba8-1a6906b20aee",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.userTokens": {
8
+ "name": "userTokens",
9
+ "schema": "",
10
+ "columns": {
11
+ "userId": {
12
+ "name": "userId",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "action": {
18
+ "name": "action",
19
+ "type": "accountAction",
20
+ "typeSchema": "public",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "token": {
25
+ "name": "token",
26
+ "type": "varchar(255)",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "expiresAt": {
31
+ "name": "expiresAt",
32
+ "type": "timestamp with time zone",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ }
36
+ },
37
+ "indexes": {},
38
+ "foreignKeys": {
39
+ "userTokens_userId_users_id_fk": {
40
+ "name": "userTokens_userId_users_id_fk",
41
+ "tableFrom": "userTokens",
42
+ "tableTo": "users",
43
+ "columnsFrom": [
44
+ "userId"
45
+ ],
46
+ "columnsTo": [
47
+ "id"
48
+ ],
49
+ "onDelete": "no action",
50
+ "onUpdate": "no action"
51
+ }
52
+ },
53
+ "compositePrimaryKeys": {},
54
+ "uniqueConstraints": {},
55
+ "policies": {},
56
+ "checkConstraints": {},
57
+ "isRLSEnabled": false
58
+ },
59
+ "public.banishedIps": {
60
+ "name": "banishedIps",
61
+ "schema": "",
62
+ "columns": {
63
+ "ip": {
64
+ "name": "ip",
65
+ "type": "varchar(45)",
66
+ "primaryKey": true,
67
+ "notNull": true
68
+ },
69
+ "reason": {
70
+ "name": "reason",
71
+ "type": "varchar(2048)",
72
+ "primaryKey": false,
73
+ "notNull": true
74
+ },
75
+ "banishedAt": {
76
+ "name": "banishedAt",
77
+ "type": "timestamp with time zone",
78
+ "primaryKey": false,
79
+ "notNull": true,
80
+ "default": "now()"
81
+ },
82
+ "banishedUntil": {
83
+ "name": "banishedUntil",
84
+ "type": "timestamp with time zone",
85
+ "primaryKey": false,
86
+ "notNull": false
87
+ }
88
+ },
89
+ "indexes": {},
90
+ "foreignKeys": {},
91
+ "compositePrimaryKeys": {},
92
+ "uniqueConstraints": {},
93
+ "policies": {},
94
+ "checkConstraints": {},
95
+ "isRLSEnabled": false
96
+ },
97
+ "public.games": {
98
+ "name": "games",
99
+ "schema": "",
100
+ "columns": {
101
+ "id": {
102
+ "name": "id",
103
+ "type": "uuid",
104
+ "primaryKey": true,
105
+ "notNull": true,
106
+ "default": "gen_random_uuid()"
107
+ }
108
+ },
109
+ "indexes": {},
110
+ "foreignKeys": {},
111
+ "compositePrimaryKeys": {},
112
+ "uniqueConstraints": {},
113
+ "policies": {},
114
+ "checkConstraints": {},
115
+ "isRLSEnabled": false
116
+ },
117
+ "public.loginHistory": {
118
+ "name": "loginHistory",
119
+ "schema": "",
120
+ "columns": {
121
+ "id": {
122
+ "name": "id",
123
+ "type": "uuid",
124
+ "primaryKey": true,
125
+ "notNull": true,
126
+ "default": "gen_random_uuid()"
127
+ },
128
+ "userId": {
129
+ "name": "userId",
130
+ "type": "uuid",
131
+ "primaryKey": false,
132
+ "notNull": false
133
+ },
134
+ "loginTime": {
135
+ "name": "loginTime",
136
+ "type": "timestamp with time zone",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "default": "now()"
140
+ },
141
+ "ipAddress": {
142
+ "name": "ipAddress",
143
+ "type": "varchar(45)",
144
+ "primaryKey": false,
145
+ "notNull": true
146
+ },
147
+ "userAgent": {
148
+ "name": "userAgent",
149
+ "type": "varchar(1024)",
150
+ "primaryKey": false,
151
+ "notNull": false
152
+ },
153
+ "successful": {
154
+ "name": "successful",
155
+ "type": "boolean",
156
+ "primaryKey": false,
157
+ "notNull": true,
158
+ "default": false
159
+ }
160
+ },
161
+ "indexes": {},
162
+ "foreignKeys": {
163
+ "loginHistory_userId_users_id_fk": {
164
+ "name": "loginHistory_userId_users_id_fk",
165
+ "tableFrom": "loginHistory",
166
+ "tableTo": "users",
167
+ "columnsFrom": [
168
+ "userId"
169
+ ],
170
+ "columnsTo": [
171
+ "id"
172
+ ],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {},
179
+ "policies": {},
180
+ "checkConstraints": {},
181
+ "isRLSEnabled": false
182
+ },
183
+ "public.passwordResetAttempts": {
184
+ "name": "passwordResetAttempts",
185
+ "schema": "",
186
+ "columns": {
187
+ "id": {
188
+ "name": "id",
189
+ "type": "uuid",
190
+ "primaryKey": true,
191
+ "notNull": true,
192
+ "default": "gen_random_uuid()"
193
+ },
194
+ "userId": {
195
+ "name": "userId",
196
+ "type": "uuid",
197
+ "primaryKey": false,
198
+ "notNull": true
199
+ },
200
+ "requestedIp": {
201
+ "name": "requestedIp",
202
+ "type": "varchar(45)",
203
+ "primaryKey": false,
204
+ "notNull": true
205
+ },
206
+ "requestedAt": {
207
+ "name": "requestedAt",
208
+ "type": "timestamp with time zone",
209
+ "primaryKey": false,
210
+ "notNull": true,
211
+ "default": "now()"
212
+ },
213
+ "succeededIp": {
214
+ "name": "succeededIp",
215
+ "type": "varchar(45)",
216
+ "primaryKey": false,
217
+ "notNull": false
218
+ },
219
+ "succeededAt": {
220
+ "name": "succeededAt",
221
+ "type": "timestamp with time zone",
222
+ "primaryKey": false,
223
+ "notNull": false
224
+ },
225
+ "verificationMethod": {
226
+ "name": "verificationMethod",
227
+ "type": "twoFactorMethod",
228
+ "typeSchema": "public",
229
+ "primaryKey": false,
230
+ "notNull": true
231
+ }
232
+ },
233
+ "indexes": {},
234
+ "foreignKeys": {
235
+ "passwordResetAttempts_userId_users_id_fk": {
236
+ "name": "passwordResetAttempts_userId_users_id_fk",
237
+ "tableFrom": "passwordResetAttempts",
238
+ "tableTo": "users",
239
+ "columnsFrom": [
240
+ "userId"
241
+ ],
242
+ "columnsTo": [
243
+ "id"
244
+ ],
245
+ "onDelete": "cascade",
246
+ "onUpdate": "no action"
247
+ }
248
+ },
249
+ "compositePrimaryKeys": {},
250
+ "uniqueConstraints": {},
251
+ "policies": {},
252
+ "checkConstraints": {},
253
+ "isRLSEnabled": false
254
+ },
255
+ "public.players": {
256
+ "name": "players",
257
+ "schema": "",
258
+ "columns": {
259
+ "userId": {
260
+ "name": "userId",
261
+ "type": "uuid",
262
+ "primaryKey": false,
263
+ "notNull": true
264
+ },
265
+ "gameId": {
266
+ "name": "gameId",
267
+ "type": "uuid",
268
+ "primaryKey": false,
269
+ "notNull": true
270
+ },
271
+ "score": {
272
+ "name": "score",
273
+ "type": "integer",
274
+ "primaryKey": false,
275
+ "notNull": true
276
+ }
277
+ },
278
+ "indexes": {},
279
+ "foreignKeys": {
280
+ "players_userId_users_id_fk": {
281
+ "name": "players_userId_users_id_fk",
282
+ "tableFrom": "players",
283
+ "tableTo": "users",
284
+ "columnsFrom": [
285
+ "userId"
286
+ ],
287
+ "columnsTo": [
288
+ "id"
289
+ ],
290
+ "onDelete": "cascade",
291
+ "onUpdate": "no action"
292
+ },
293
+ "players_gameId_games_id_fk": {
294
+ "name": "players_gameId_games_id_fk",
295
+ "tableFrom": "players",
296
+ "tableTo": "games",
297
+ "columnsFrom": [
298
+ "gameId"
299
+ ],
300
+ "columnsTo": [
301
+ "id"
302
+ ],
303
+ "onDelete": "cascade",
304
+ "onUpdate": "no action"
305
+ }
306
+ },
307
+ "compositePrimaryKeys": {
308
+ "players_userId_gameId_pk": {
309
+ "name": "players_userId_gameId_pk",
310
+ "columns": [
311
+ "userId",
312
+ "gameId"
313
+ ]
314
+ }
315
+ },
316
+ "uniqueConstraints": {},
317
+ "policies": {},
318
+ "checkConstraints": {},
319
+ "isRLSEnabled": false
320
+ },
321
+ "public.users": {
322
+ "name": "users",
323
+ "schema": "",
324
+ "columns": {
325
+ "id": {
326
+ "name": "id",
327
+ "type": "uuid",
328
+ "primaryKey": true,
329
+ "notNull": true,
330
+ "default": "gen_random_uuid()"
331
+ },
332
+ "username": {
333
+ "name": "username",
334
+ "type": "varchar(16)",
335
+ "primaryKey": false,
336
+ "notNull": true
337
+ },
338
+ "emailOffered": {
339
+ "name": "emailOffered",
340
+ "type": "varchar(254)",
341
+ "primaryKey": false,
342
+ "notNull": true
343
+ },
344
+ "emailVerified": {
345
+ "name": "emailVerified",
346
+ "type": "varchar(254)",
347
+ "primaryKey": false,
348
+ "notNull": false
349
+ },
350
+ "password": {
351
+ "name": "password",
352
+ "type": "varchar(254)",
353
+ "primaryKey": false,
354
+ "notNull": true
355
+ },
356
+ "createdAt": {
357
+ "name": "createdAt",
358
+ "type": "timestamp with time zone",
359
+ "primaryKey": false,
360
+ "notNull": true,
361
+ "default": "now()"
362
+ },
363
+ "createdIp": {
364
+ "name": "createdIp",
365
+ "type": "varchar(45)",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "isActive": {
370
+ "name": "isActive",
371
+ "type": "boolean",
372
+ "primaryKey": false,
373
+ "notNull": true,
374
+ "default": false
375
+ },
376
+ "verifiedAt": {
377
+ "name": "verifiedAt",
378
+ "type": "timestamp with time zone",
379
+ "primaryKey": false,
380
+ "notNull": false
381
+ },
382
+ "userRole": {
383
+ "name": "userRole",
384
+ "type": "role",
385
+ "typeSchema": "public",
386
+ "primaryKey": false,
387
+ "notNull": false,
388
+ "default": "'user'"
389
+ }
390
+ },
391
+ "indexes": {
392
+ "usernameUniqueIndex": {
393
+ "name": "usernameUniqueIndex",
394
+ "columns": [
395
+ {
396
+ "expression": "lower(\"username\")",
397
+ "asc": true,
398
+ "isExpression": true,
399
+ "nulls": "last"
400
+ }
401
+ ],
402
+ "isUnique": true,
403
+ "concurrently": false,
404
+ "method": "btree",
405
+ "with": {}
406
+ },
407
+ "emailVerifiedUniqueIndex": {
408
+ "name": "emailVerifiedUniqueIndex",
409
+ "columns": [
410
+ {
411
+ "expression": "lower(\"emailVerified\")",
412
+ "asc": true,
413
+ "isExpression": true,
414
+ "nulls": "last"
415
+ }
416
+ ],
417
+ "isUnique": true,
418
+ "concurrently": false,
419
+ "method": "btree",
420
+ "with": {}
421
+ }
422
+ },
423
+ "foreignKeys": {},
424
+ "compositePrimaryKeys": {},
425
+ "uniqueConstraints": {},
426
+ "policies": {},
427
+ "checkConstraints": {},
428
+ "isRLSEnabled": false
429
+ }
430
+ },
431
+ "enums": {
432
+ "public.accountAction": {
433
+ "name": "accountAction",
434
+ "schema": "public",
435
+ "values": [
436
+ "emailConfirm",
437
+ "passwordReset",
438
+ "emailChange"
439
+ ]
440
+ },
441
+ "public.role": {
442
+ "name": "role",
443
+ "schema": "public",
444
+ "values": [
445
+ "admin",
446
+ "user"
447
+ ]
448
+ },
449
+ "public.trackedUserColumnName": {
450
+ "name": "trackedUserColumnName",
451
+ "schema": "public",
452
+ "values": [
453
+ "username",
454
+ "emailOffered",
455
+ "emailVerified",
456
+ "password",
457
+ "userRole"
458
+ ]
459
+ },
460
+ "public.twoFactorMethod": {
461
+ "name": "twoFactorMethod",
462
+ "schema": "public",
463
+ "values": [
464
+ "email",
465
+ "phone"
466
+ ]
467
+ }
468
+ },
469
+ "schemas": {},
470
+ "sequences": {},
471
+ "roles": {},
472
+ "policies": {},
473
+ "views": {},
474
+ "_meta": {
475
+ "columns": {},
476
+ "schemas": {},
477
+ "tables": {}
478
+ }
479
+ }