tempest.games 0.1.42 → 0.1.44

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