@chaos-overlords/storage 0.1.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.
Files changed (46) hide show
  1. package/LICENSE +674 -0
  2. package/NOTICE +21 -0
  3. package/README.md +35 -0
  4. package/dist/node/index.d.ts +29 -0
  5. package/dist/node/index.d.ts.map +1 -0
  6. package/dist/node/index.js +60 -0
  7. package/dist/node/index.js.map +1 -0
  8. package/dist/postgres/index.d.ts +3 -0
  9. package/dist/postgres/index.d.ts.map +1 -0
  10. package/dist/postgres/index.js +3 -0
  11. package/dist/postgres/index.js.map +1 -0
  12. package/dist/postgres/repositories.d.ts +11 -0
  13. package/dist/postgres/repositories.d.ts.map +1 -0
  14. package/dist/postgres/repositories.js +396 -0
  15. package/dist/postgres/repositories.js.map +1 -0
  16. package/dist/postgres/schema.d.ts +1002 -0
  17. package/dist/postgres/schema.d.ts.map +1 -0
  18. package/dist/postgres/schema.js +103 -0
  19. package/dist/postgres/schema.js.map +1 -0
  20. package/dist/shared/constraints.d.ts +6 -0
  21. package/dist/shared/constraints.d.ts.map +1 -0
  22. package/dist/shared/constraints.js +49 -0
  23. package/dist/shared/constraints.js.map +1 -0
  24. package/dist/shared/mappers.d.ts +105 -0
  25. package/dist/shared/mappers.d.ts.map +1 -0
  26. package/dist/shared/mappers.js +55 -0
  27. package/dist/shared/mappers.js.map +1 -0
  28. package/dist/sqlite/index.d.ts +3 -0
  29. package/dist/sqlite/index.d.ts.map +1 -0
  30. package/dist/sqlite/index.js +3 -0
  31. package/dist/sqlite/index.js.map +1 -0
  32. package/dist/sqlite/repositories.d.ts +11 -0
  33. package/dist/sqlite/repositories.d.ts.map +1 -0
  34. package/dist/sqlite/repositories.js +392 -0
  35. package/dist/sqlite/repositories.js.map +1 -0
  36. package/dist/sqlite/schema.d.ts +1063 -0
  37. package/dist/sqlite/schema.d.ts.map +1 -0
  38. package/dist/sqlite/schema.js +103 -0
  39. package/dist/sqlite/schema.js.map +1 -0
  40. package/migrations/postgres/0000_glorious_zaladane.sql +94 -0
  41. package/migrations/postgres/meta/0000_snapshot.json +637 -0
  42. package/migrations/postgres/meta/_journal.json +13 -0
  43. package/migrations/sqlite/0000_exotic_warbird.sql +94 -0
  44. package/migrations/sqlite/meta/0000_snapshot.json +605 -0
  45. package/migrations/sqlite/meta/_journal.json +13 -0
  46. package/package.json +94 -0
@@ -0,0 +1,94 @@
1
+ CREATE TABLE `match_events` (
2
+ `match_id` text NOT NULL,
3
+ `seq` integer NOT NULL,
4
+ `type` text NOT NULL,
5
+ `payload` text NOT NULL,
6
+ `created_at` integer NOT NULL,
7
+ PRIMARY KEY(`match_id`, `seq`),
8
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
9
+ );
10
+ --> statement-breakpoint
11
+ CREATE TABLE `matches` (
12
+ `id` text PRIMARY KEY NOT NULL,
13
+ `status` text NOT NULL,
14
+ `name` text NOT NULL,
15
+ `visibility` text NOT NULL,
16
+ `max_players` integer NOT NULL,
17
+ `settings` text NOT NULL,
18
+ `host_player_id` text NOT NULL,
19
+ `join_code` text NOT NULL,
20
+ `password_hash` text,
21
+ `seed` integer,
22
+ `current_turn` integer DEFAULT 0 NOT NULL,
23
+ `seat_count` integer DEFAULT 1 NOT NULL,
24
+ `join_counter` integer DEFAULT 1 NOT NULL,
25
+ `created_at` integer NOT NULL,
26
+ `updated_at` integer NOT NULL
27
+ );
28
+ --> statement-breakpoint
29
+ CREATE UNIQUE INDEX `matches_join_code_unique` ON `matches` (`join_code`);--> statement-breakpoint
30
+ CREATE INDEX `matches_status_updated_idx` ON `matches` (`status`,`updated_at`);--> statement-breakpoint
31
+ CREATE INDEX `matches_lobby_idx` ON `matches` (`status`,`visibility`,`created_at`);--> statement-breakpoint
32
+ CREATE TABLE `players` (
33
+ `id` text PRIMARY KEY NOT NULL,
34
+ `match_id` text NOT NULL,
35
+ `slot` integer DEFAULT -1 NOT NULL,
36
+ `join_order` integer DEFAULT 0 NOT NULL,
37
+ `display_name` text NOT NULL,
38
+ `token_hash` text,
39
+ `status` text NOT NULL,
40
+ `joined_at` integer NOT NULL,
41
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
42
+ );
43
+ --> statement-breakpoint
44
+ CREATE UNIQUE INDEX `players_token_hash_unique` ON `players` (`token_hash`);--> statement-breakpoint
45
+ CREATE INDEX `players_match_idx` ON `players` (`match_id`);--> statement-breakpoint
46
+ CREATE TABLE `snapshots` (
47
+ `match_id` text NOT NULL,
48
+ `turn` integer NOT NULL,
49
+ `format_version` integer NOT NULL,
50
+ `state_hash` text NOT NULL,
51
+ `uploaded_by_player_id` text NOT NULL,
52
+ `uploaded_at` integer NOT NULL,
53
+ `body` text NOT NULL,
54
+ PRIMARY KEY(`match_id`, `turn`),
55
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
56
+ );
57
+ --> statement-breakpoint
58
+ CREATE TABLE `turn_orders` (
59
+ `match_id` text NOT NULL,
60
+ `turn` integer NOT NULL,
61
+ `player_id` text NOT NULL,
62
+ `orders` text,
63
+ `orders_hash` text,
64
+ `ready` integer DEFAULT false NOT NULL,
65
+ `submitted_at` integer,
66
+ PRIMARY KEY(`match_id`, `turn`, `player_id`),
67
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
68
+ );
69
+ --> statement-breakpoint
70
+ CREATE TABLE `turn_reports` (
71
+ `match_id` text NOT NULL,
72
+ `turn` integer NOT NULL,
73
+ `player_id` text NOT NULL,
74
+ `state_hash` text NOT NULL,
75
+ `finished` integer DEFAULT false NOT NULL,
76
+ `reported_at` integer NOT NULL,
77
+ PRIMARY KEY(`match_id`, `turn`, `player_id`),
78
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
79
+ );
80
+ --> statement-breakpoint
81
+ CREATE TABLE `turns` (
82
+ `match_id` text NOT NULL,
83
+ `number` integer NOT NULL,
84
+ `status` text NOT NULL,
85
+ `opened_at` integer NOT NULL,
86
+ `deadline_at` integer,
87
+ `sealed_at` integer,
88
+ `order_set_hash` text,
89
+ `sealed_slots` text,
90
+ PRIMARY KEY(`match_id`, `number`),
91
+ FOREIGN KEY (`match_id`) REFERENCES `matches`(`id`) ON UPDATE no action ON DELETE cascade
92
+ );
93
+ --> statement-breakpoint
94
+ CREATE INDEX `turns_deadline_idx` ON `turns` (`status`,`deadline_at`);
@@ -0,0 +1,605 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "bf035090-4ece-429e-a3d1-f63b7a571494",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "match_events": {
8
+ "name": "match_events",
9
+ "columns": {
10
+ "match_id": {
11
+ "name": "match_id",
12
+ "type": "text",
13
+ "primaryKey": false,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "seq": {
18
+ "name": "seq",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "type": {
25
+ "name": "type",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "payload": {
32
+ "name": "payload",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "created_at": {
39
+ "name": "created_at",
40
+ "type": "integer",
41
+ "primaryKey": false,
42
+ "notNull": true,
43
+ "autoincrement": false
44
+ }
45
+ },
46
+ "indexes": {},
47
+ "foreignKeys": {
48
+ "match_events_match_id_matches_id_fk": {
49
+ "name": "match_events_match_id_matches_id_fk",
50
+ "tableFrom": "match_events",
51
+ "tableTo": "matches",
52
+ "columnsFrom": ["match_id"],
53
+ "columnsTo": ["id"],
54
+ "onDelete": "cascade",
55
+ "onUpdate": "no action"
56
+ }
57
+ },
58
+ "compositePrimaryKeys": {
59
+ "match_events_match_id_seq_pk": {
60
+ "columns": ["match_id", "seq"],
61
+ "name": "match_events_match_id_seq_pk"
62
+ }
63
+ },
64
+ "uniqueConstraints": {},
65
+ "checkConstraints": {}
66
+ },
67
+ "matches": {
68
+ "name": "matches",
69
+ "columns": {
70
+ "id": {
71
+ "name": "id",
72
+ "type": "text",
73
+ "primaryKey": true,
74
+ "notNull": true,
75
+ "autoincrement": false
76
+ },
77
+ "status": {
78
+ "name": "status",
79
+ "type": "text",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "autoincrement": false
83
+ },
84
+ "name": {
85
+ "name": "name",
86
+ "type": "text",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "autoincrement": false
90
+ },
91
+ "visibility": {
92
+ "name": "visibility",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": true,
96
+ "autoincrement": false
97
+ },
98
+ "max_players": {
99
+ "name": "max_players",
100
+ "type": "integer",
101
+ "primaryKey": false,
102
+ "notNull": true,
103
+ "autoincrement": false
104
+ },
105
+ "settings": {
106
+ "name": "settings",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": true,
110
+ "autoincrement": false
111
+ },
112
+ "host_player_id": {
113
+ "name": "host_player_id",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": true,
117
+ "autoincrement": false
118
+ },
119
+ "join_code": {
120
+ "name": "join_code",
121
+ "type": "text",
122
+ "primaryKey": false,
123
+ "notNull": true,
124
+ "autoincrement": false
125
+ },
126
+ "password_hash": {
127
+ "name": "password_hash",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": false,
131
+ "autoincrement": false
132
+ },
133
+ "seed": {
134
+ "name": "seed",
135
+ "type": "integer",
136
+ "primaryKey": false,
137
+ "notNull": false,
138
+ "autoincrement": false
139
+ },
140
+ "current_turn": {
141
+ "name": "current_turn",
142
+ "type": "integer",
143
+ "primaryKey": false,
144
+ "notNull": true,
145
+ "autoincrement": false,
146
+ "default": 0
147
+ },
148
+ "seat_count": {
149
+ "name": "seat_count",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": true,
153
+ "autoincrement": false,
154
+ "default": 1
155
+ },
156
+ "join_counter": {
157
+ "name": "join_counter",
158
+ "type": "integer",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "autoincrement": false,
162
+ "default": 1
163
+ },
164
+ "created_at": {
165
+ "name": "created_at",
166
+ "type": "integer",
167
+ "primaryKey": false,
168
+ "notNull": true,
169
+ "autoincrement": false
170
+ },
171
+ "updated_at": {
172
+ "name": "updated_at",
173
+ "type": "integer",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "autoincrement": false
177
+ }
178
+ },
179
+ "indexes": {
180
+ "matches_join_code_unique": {
181
+ "name": "matches_join_code_unique",
182
+ "columns": ["join_code"],
183
+ "isUnique": true
184
+ },
185
+ "matches_status_updated_idx": {
186
+ "name": "matches_status_updated_idx",
187
+ "columns": ["status", "updated_at"],
188
+ "isUnique": false
189
+ },
190
+ "matches_lobby_idx": {
191
+ "name": "matches_lobby_idx",
192
+ "columns": ["status", "visibility", "created_at"],
193
+ "isUnique": false
194
+ }
195
+ },
196
+ "foreignKeys": {},
197
+ "compositePrimaryKeys": {},
198
+ "uniqueConstraints": {},
199
+ "checkConstraints": {}
200
+ },
201
+ "players": {
202
+ "name": "players",
203
+ "columns": {
204
+ "id": {
205
+ "name": "id",
206
+ "type": "text",
207
+ "primaryKey": true,
208
+ "notNull": true,
209
+ "autoincrement": false
210
+ },
211
+ "match_id": {
212
+ "name": "match_id",
213
+ "type": "text",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "autoincrement": false
217
+ },
218
+ "slot": {
219
+ "name": "slot",
220
+ "type": "integer",
221
+ "primaryKey": false,
222
+ "notNull": true,
223
+ "autoincrement": false,
224
+ "default": -1
225
+ },
226
+ "join_order": {
227
+ "name": "join_order",
228
+ "type": "integer",
229
+ "primaryKey": false,
230
+ "notNull": true,
231
+ "autoincrement": false,
232
+ "default": 0
233
+ },
234
+ "display_name": {
235
+ "name": "display_name",
236
+ "type": "text",
237
+ "primaryKey": false,
238
+ "notNull": true,
239
+ "autoincrement": false
240
+ },
241
+ "token_hash": {
242
+ "name": "token_hash",
243
+ "type": "text",
244
+ "primaryKey": false,
245
+ "notNull": false,
246
+ "autoincrement": false
247
+ },
248
+ "status": {
249
+ "name": "status",
250
+ "type": "text",
251
+ "primaryKey": false,
252
+ "notNull": true,
253
+ "autoincrement": false
254
+ },
255
+ "joined_at": {
256
+ "name": "joined_at",
257
+ "type": "integer",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "autoincrement": false
261
+ }
262
+ },
263
+ "indexes": {
264
+ "players_token_hash_unique": {
265
+ "name": "players_token_hash_unique",
266
+ "columns": ["token_hash"],
267
+ "isUnique": true
268
+ },
269
+ "players_match_idx": {
270
+ "name": "players_match_idx",
271
+ "columns": ["match_id"],
272
+ "isUnique": false
273
+ }
274
+ },
275
+ "foreignKeys": {
276
+ "players_match_id_matches_id_fk": {
277
+ "name": "players_match_id_matches_id_fk",
278
+ "tableFrom": "players",
279
+ "tableTo": "matches",
280
+ "columnsFrom": ["match_id"],
281
+ "columnsTo": ["id"],
282
+ "onDelete": "cascade",
283
+ "onUpdate": "no action"
284
+ }
285
+ },
286
+ "compositePrimaryKeys": {},
287
+ "uniqueConstraints": {},
288
+ "checkConstraints": {}
289
+ },
290
+ "snapshots": {
291
+ "name": "snapshots",
292
+ "columns": {
293
+ "match_id": {
294
+ "name": "match_id",
295
+ "type": "text",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "autoincrement": false
299
+ },
300
+ "turn": {
301
+ "name": "turn",
302
+ "type": "integer",
303
+ "primaryKey": false,
304
+ "notNull": true,
305
+ "autoincrement": false
306
+ },
307
+ "format_version": {
308
+ "name": "format_version",
309
+ "type": "integer",
310
+ "primaryKey": false,
311
+ "notNull": true,
312
+ "autoincrement": false
313
+ },
314
+ "state_hash": {
315
+ "name": "state_hash",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true,
319
+ "autoincrement": false
320
+ },
321
+ "uploaded_by_player_id": {
322
+ "name": "uploaded_by_player_id",
323
+ "type": "text",
324
+ "primaryKey": false,
325
+ "notNull": true,
326
+ "autoincrement": false
327
+ },
328
+ "uploaded_at": {
329
+ "name": "uploaded_at",
330
+ "type": "integer",
331
+ "primaryKey": false,
332
+ "notNull": true,
333
+ "autoincrement": false
334
+ },
335
+ "body": {
336
+ "name": "body",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": true,
340
+ "autoincrement": false
341
+ }
342
+ },
343
+ "indexes": {},
344
+ "foreignKeys": {
345
+ "snapshots_match_id_matches_id_fk": {
346
+ "name": "snapshots_match_id_matches_id_fk",
347
+ "tableFrom": "snapshots",
348
+ "tableTo": "matches",
349
+ "columnsFrom": ["match_id"],
350
+ "columnsTo": ["id"],
351
+ "onDelete": "cascade",
352
+ "onUpdate": "no action"
353
+ }
354
+ },
355
+ "compositePrimaryKeys": {
356
+ "snapshots_match_id_turn_pk": {
357
+ "columns": ["match_id", "turn"],
358
+ "name": "snapshots_match_id_turn_pk"
359
+ }
360
+ },
361
+ "uniqueConstraints": {},
362
+ "checkConstraints": {}
363
+ },
364
+ "turn_orders": {
365
+ "name": "turn_orders",
366
+ "columns": {
367
+ "match_id": {
368
+ "name": "match_id",
369
+ "type": "text",
370
+ "primaryKey": false,
371
+ "notNull": true,
372
+ "autoincrement": false
373
+ },
374
+ "turn": {
375
+ "name": "turn",
376
+ "type": "integer",
377
+ "primaryKey": false,
378
+ "notNull": true,
379
+ "autoincrement": false
380
+ },
381
+ "player_id": {
382
+ "name": "player_id",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true,
386
+ "autoincrement": false
387
+ },
388
+ "orders": {
389
+ "name": "orders",
390
+ "type": "text",
391
+ "primaryKey": false,
392
+ "notNull": false,
393
+ "autoincrement": false
394
+ },
395
+ "orders_hash": {
396
+ "name": "orders_hash",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": false,
400
+ "autoincrement": false
401
+ },
402
+ "ready": {
403
+ "name": "ready",
404
+ "type": "integer",
405
+ "primaryKey": false,
406
+ "notNull": true,
407
+ "autoincrement": false,
408
+ "default": false
409
+ },
410
+ "submitted_at": {
411
+ "name": "submitted_at",
412
+ "type": "integer",
413
+ "primaryKey": false,
414
+ "notNull": false,
415
+ "autoincrement": false
416
+ }
417
+ },
418
+ "indexes": {},
419
+ "foreignKeys": {
420
+ "turn_orders_match_id_matches_id_fk": {
421
+ "name": "turn_orders_match_id_matches_id_fk",
422
+ "tableFrom": "turn_orders",
423
+ "tableTo": "matches",
424
+ "columnsFrom": ["match_id"],
425
+ "columnsTo": ["id"],
426
+ "onDelete": "cascade",
427
+ "onUpdate": "no action"
428
+ }
429
+ },
430
+ "compositePrimaryKeys": {
431
+ "turn_orders_match_id_turn_player_id_pk": {
432
+ "columns": ["match_id", "turn", "player_id"],
433
+ "name": "turn_orders_match_id_turn_player_id_pk"
434
+ }
435
+ },
436
+ "uniqueConstraints": {},
437
+ "checkConstraints": {}
438
+ },
439
+ "turn_reports": {
440
+ "name": "turn_reports",
441
+ "columns": {
442
+ "match_id": {
443
+ "name": "match_id",
444
+ "type": "text",
445
+ "primaryKey": false,
446
+ "notNull": true,
447
+ "autoincrement": false
448
+ },
449
+ "turn": {
450
+ "name": "turn",
451
+ "type": "integer",
452
+ "primaryKey": false,
453
+ "notNull": true,
454
+ "autoincrement": false
455
+ },
456
+ "player_id": {
457
+ "name": "player_id",
458
+ "type": "text",
459
+ "primaryKey": false,
460
+ "notNull": true,
461
+ "autoincrement": false
462
+ },
463
+ "state_hash": {
464
+ "name": "state_hash",
465
+ "type": "text",
466
+ "primaryKey": false,
467
+ "notNull": true,
468
+ "autoincrement": false
469
+ },
470
+ "finished": {
471
+ "name": "finished",
472
+ "type": "integer",
473
+ "primaryKey": false,
474
+ "notNull": true,
475
+ "autoincrement": false,
476
+ "default": false
477
+ },
478
+ "reported_at": {
479
+ "name": "reported_at",
480
+ "type": "integer",
481
+ "primaryKey": false,
482
+ "notNull": true,
483
+ "autoincrement": false
484
+ }
485
+ },
486
+ "indexes": {},
487
+ "foreignKeys": {
488
+ "turn_reports_match_id_matches_id_fk": {
489
+ "name": "turn_reports_match_id_matches_id_fk",
490
+ "tableFrom": "turn_reports",
491
+ "tableTo": "matches",
492
+ "columnsFrom": ["match_id"],
493
+ "columnsTo": ["id"],
494
+ "onDelete": "cascade",
495
+ "onUpdate": "no action"
496
+ }
497
+ },
498
+ "compositePrimaryKeys": {
499
+ "turn_reports_match_id_turn_player_id_pk": {
500
+ "columns": ["match_id", "turn", "player_id"],
501
+ "name": "turn_reports_match_id_turn_player_id_pk"
502
+ }
503
+ },
504
+ "uniqueConstraints": {},
505
+ "checkConstraints": {}
506
+ },
507
+ "turns": {
508
+ "name": "turns",
509
+ "columns": {
510
+ "match_id": {
511
+ "name": "match_id",
512
+ "type": "text",
513
+ "primaryKey": false,
514
+ "notNull": true,
515
+ "autoincrement": false
516
+ },
517
+ "number": {
518
+ "name": "number",
519
+ "type": "integer",
520
+ "primaryKey": false,
521
+ "notNull": true,
522
+ "autoincrement": false
523
+ },
524
+ "status": {
525
+ "name": "status",
526
+ "type": "text",
527
+ "primaryKey": false,
528
+ "notNull": true,
529
+ "autoincrement": false
530
+ },
531
+ "opened_at": {
532
+ "name": "opened_at",
533
+ "type": "integer",
534
+ "primaryKey": false,
535
+ "notNull": true,
536
+ "autoincrement": false
537
+ },
538
+ "deadline_at": {
539
+ "name": "deadline_at",
540
+ "type": "integer",
541
+ "primaryKey": false,
542
+ "notNull": false,
543
+ "autoincrement": false
544
+ },
545
+ "sealed_at": {
546
+ "name": "sealed_at",
547
+ "type": "integer",
548
+ "primaryKey": false,
549
+ "notNull": false,
550
+ "autoincrement": false
551
+ },
552
+ "order_set_hash": {
553
+ "name": "order_set_hash",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": false,
557
+ "autoincrement": false
558
+ },
559
+ "sealed_slots": {
560
+ "name": "sealed_slots",
561
+ "type": "text",
562
+ "primaryKey": false,
563
+ "notNull": false,
564
+ "autoincrement": false
565
+ }
566
+ },
567
+ "indexes": {
568
+ "turns_deadline_idx": {
569
+ "name": "turns_deadline_idx",
570
+ "columns": ["status", "deadline_at"],
571
+ "isUnique": false
572
+ }
573
+ },
574
+ "foreignKeys": {
575
+ "turns_match_id_matches_id_fk": {
576
+ "name": "turns_match_id_matches_id_fk",
577
+ "tableFrom": "turns",
578
+ "tableTo": "matches",
579
+ "columnsFrom": ["match_id"],
580
+ "columnsTo": ["id"],
581
+ "onDelete": "cascade",
582
+ "onUpdate": "no action"
583
+ }
584
+ },
585
+ "compositePrimaryKeys": {
586
+ "turns_match_id_number_pk": {
587
+ "columns": ["match_id", "number"],
588
+ "name": "turns_match_id_number_pk"
589
+ }
590
+ },
591
+ "uniqueConstraints": {},
592
+ "checkConstraints": {}
593
+ }
594
+ },
595
+ "views": {},
596
+ "enums": {},
597
+ "_meta": {
598
+ "schemas": {},
599
+ "tables": {},
600
+ "columns": {}
601
+ },
602
+ "internal": {
603
+ "indexes": {}
604
+ }
605
+ }