@chaos-overlords/storage 0.9.6 → 0.9.7

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 (41) hide show
  1. package/LICENSE +21 -674
  2. package/NOTICE +9 -12
  3. package/README.md +1 -1
  4. package/dist/postgres/events.d.ts.map +1 -1
  5. package/dist/postgres/events.js +34 -1
  6. package/dist/postgres/events.js.map +1 -1
  7. package/dist/postgres/repositories.js +44 -5
  8. package/dist/postgres/repositories.js.map +1 -1
  9. package/dist/postgres/schema.d.ts +51 -0
  10. package/dist/postgres/schema.d.ts.map +1 -1
  11. package/dist/postgres/schema.js +24 -2
  12. package/dist/postgres/schema.js.map +1 -1
  13. package/dist/postgres/takeovers.d.ts.map +1 -1
  14. package/dist/postgres/takeovers.js +24 -1
  15. package/dist/postgres/takeovers.js.map +1 -1
  16. package/dist/shared/constraints.d.ts +9 -3
  17. package/dist/shared/constraints.d.ts.map +1 -1
  18. package/dist/shared/constraints.js +9 -3
  19. package/dist/shared/constraints.js.map +1 -1
  20. package/dist/shared/mappers.d.ts +1 -0
  21. package/dist/shared/mappers.d.ts.map +1 -1
  22. package/dist/shared/mappers.js.map +1 -1
  23. package/dist/sqlite/events.d.ts.map +1 -1
  24. package/dist/sqlite/events.js +34 -1
  25. package/dist/sqlite/events.js.map +1 -1
  26. package/dist/sqlite/repositories.js +46 -6
  27. package/dist/sqlite/repositories.js.map +1 -1
  28. package/dist/sqlite/schema.d.ts +53 -0
  29. package/dist/sqlite/schema.d.ts.map +1 -1
  30. package/dist/sqlite/schema.js +24 -2
  31. package/dist/sqlite/schema.js.map +1 -1
  32. package/dist/sqlite/takeovers.d.ts.map +1 -1
  33. package/dist/sqlite/takeovers.js +24 -1
  34. package/dist/sqlite/takeovers.js.map +1 -1
  35. package/migrations/postgres/0006_stiff_newton_destine.sql +22 -0
  36. package/migrations/postgres/meta/0006_snapshot.json +942 -0
  37. package/migrations/postgres/meta/_journal.json +7 -0
  38. package/migrations/sqlite/0006_flawless_bedlam.sql +22 -0
  39. package/migrations/sqlite/meta/0006_snapshot.json +891 -0
  40. package/migrations/sqlite/meta/_journal.json +7 -0
  41. package/package.json +5 -5
@@ -0,0 +1,942 @@
1
+ {
2
+ "id": "57a5f971-553d-4d2d-99f7-8a77f192ecfe",
3
+ "prevId": "47019bfd-b28e-4378-bb85-4ea547cf1d22",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.match_events": {
8
+ "name": "match_events",
9
+ "schema": "",
10
+ "columns": {
11
+ "match_id": {
12
+ "name": "match_id",
13
+ "type": "text",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "seq": {
18
+ "name": "seq",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "type": {
24
+ "name": "type",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "payload": {
30
+ "name": "payload",
31
+ "type": "jsonb",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "created_at": {
36
+ "name": "created_at",
37
+ "type": "timestamp with time zone",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "dedupe_key": {
42
+ "name": "dedupe_key",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ }
47
+ },
48
+ "indexes": {
49
+ "match_events_dedupe_idx": {
50
+ "name": "match_events_dedupe_idx",
51
+ "columns": [
52
+ {
53
+ "expression": "match_id",
54
+ "isExpression": false,
55
+ "asc": true,
56
+ "nulls": "last"
57
+ },
58
+ {
59
+ "expression": "dedupe_key",
60
+ "isExpression": false,
61
+ "asc": true,
62
+ "nulls": "last"
63
+ }
64
+ ],
65
+ "isUnique": true,
66
+ "concurrently": false,
67
+ "method": "btree",
68
+ "with": {}
69
+ },
70
+ "match_events_type_idx": {
71
+ "name": "match_events_type_idx",
72
+ "columns": [
73
+ {
74
+ "expression": "match_id",
75
+ "isExpression": false,
76
+ "asc": true,
77
+ "nulls": "last"
78
+ },
79
+ {
80
+ "expression": "type",
81
+ "isExpression": false,
82
+ "asc": true,
83
+ "nulls": "last"
84
+ },
85
+ {
86
+ "expression": "seq",
87
+ "isExpression": false,
88
+ "asc": true,
89
+ "nulls": "last"
90
+ }
91
+ ],
92
+ "isUnique": false,
93
+ "concurrently": false,
94
+ "method": "btree",
95
+ "with": {}
96
+ }
97
+ },
98
+ "foreignKeys": {
99
+ "match_events_match_id_matches_id_fk": {
100
+ "name": "match_events_match_id_matches_id_fk",
101
+ "tableFrom": "match_events",
102
+ "tableTo": "matches",
103
+ "columnsFrom": [
104
+ "match_id"
105
+ ],
106
+ "columnsTo": [
107
+ "id"
108
+ ],
109
+ "onDelete": "cascade",
110
+ "onUpdate": "no action"
111
+ }
112
+ },
113
+ "compositePrimaryKeys": {
114
+ "match_events_match_id_seq_pk": {
115
+ "name": "match_events_match_id_seq_pk",
116
+ "columns": [
117
+ "match_id",
118
+ "seq"
119
+ ]
120
+ }
121
+ },
122
+ "uniqueConstraints": {},
123
+ "policies": {},
124
+ "checkConstraints": {},
125
+ "isRLSEnabled": false
126
+ },
127
+ "public.matches": {
128
+ "name": "matches",
129
+ "schema": "",
130
+ "columns": {
131
+ "id": {
132
+ "name": "id",
133
+ "type": "text",
134
+ "primaryKey": true,
135
+ "notNull": true
136
+ },
137
+ "protocol_version": {
138
+ "name": "protocol_version",
139
+ "type": "integer",
140
+ "primaryKey": false,
141
+ "notNull": true,
142
+ "default": 1
143
+ },
144
+ "session_version": {
145
+ "name": "session_version",
146
+ "type": "integer",
147
+ "primaryKey": false,
148
+ "notNull": true,
149
+ "default": 1
150
+ },
151
+ "status": {
152
+ "name": "status",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "name": {
158
+ "name": "name",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": true
162
+ },
163
+ "visibility": {
164
+ "name": "visibility",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": true
168
+ },
169
+ "max_players": {
170
+ "name": "max_players",
171
+ "type": "integer",
172
+ "primaryKey": false,
173
+ "notNull": true
174
+ },
175
+ "settings": {
176
+ "name": "settings",
177
+ "type": "jsonb",
178
+ "primaryKey": false,
179
+ "notNull": true
180
+ },
181
+ "host_player_id": {
182
+ "name": "host_player_id",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": true
186
+ },
187
+ "join_code": {
188
+ "name": "join_code",
189
+ "type": "text",
190
+ "primaryKey": false,
191
+ "notNull": true
192
+ },
193
+ "password_hash": {
194
+ "name": "password_hash",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": false
198
+ },
199
+ "seed": {
200
+ "name": "seed",
201
+ "type": "integer",
202
+ "primaryKey": false,
203
+ "notNull": false
204
+ },
205
+ "current_turn": {
206
+ "name": "current_turn",
207
+ "type": "integer",
208
+ "primaryKey": false,
209
+ "notNull": true,
210
+ "default": 0
211
+ },
212
+ "seat_count": {
213
+ "name": "seat_count",
214
+ "type": "integer",
215
+ "primaryKey": false,
216
+ "notNull": true,
217
+ "default": 1
218
+ },
219
+ "join_counter": {
220
+ "name": "join_counter",
221
+ "type": "integer",
222
+ "primaryKey": false,
223
+ "notNull": true,
224
+ "default": 1
225
+ },
226
+ "created_at": {
227
+ "name": "created_at",
228
+ "type": "timestamp with time zone",
229
+ "primaryKey": false,
230
+ "notNull": true
231
+ },
232
+ "updated_at": {
233
+ "name": "updated_at",
234
+ "type": "timestamp with time zone",
235
+ "primaryKey": false,
236
+ "notNull": true
237
+ }
238
+ },
239
+ "indexes": {
240
+ "matches_status_updated_idx": {
241
+ "name": "matches_status_updated_idx",
242
+ "columns": [
243
+ {
244
+ "expression": "status",
245
+ "isExpression": false,
246
+ "asc": true,
247
+ "nulls": "last"
248
+ },
249
+ {
250
+ "expression": "updated_at",
251
+ "isExpression": false,
252
+ "asc": true,
253
+ "nulls": "last"
254
+ }
255
+ ],
256
+ "isUnique": false,
257
+ "concurrently": false,
258
+ "method": "btree",
259
+ "with": {}
260
+ },
261
+ "matches_lobby_idx": {
262
+ "name": "matches_lobby_idx",
263
+ "columns": [
264
+ {
265
+ "expression": "status",
266
+ "isExpression": false,
267
+ "asc": true,
268
+ "nulls": "last"
269
+ },
270
+ {
271
+ "expression": "visibility",
272
+ "isExpression": false,
273
+ "asc": true,
274
+ "nulls": "last"
275
+ },
276
+ {
277
+ "expression": "created_at",
278
+ "isExpression": false,
279
+ "asc": true,
280
+ "nulls": "last"
281
+ }
282
+ ],
283
+ "isUnique": false,
284
+ "concurrently": false,
285
+ "method": "btree",
286
+ "with": {}
287
+ }
288
+ },
289
+ "foreignKeys": {},
290
+ "compositePrimaryKeys": {},
291
+ "uniqueConstraints": {
292
+ "matches_join_code_unique": {
293
+ "name": "matches_join_code_unique",
294
+ "nullsNotDistinct": false,
295
+ "columns": [
296
+ "join_code"
297
+ ]
298
+ }
299
+ },
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.players": {
305
+ "name": "players",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "match_id": {
315
+ "name": "match_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "slot": {
321
+ "name": "slot",
322
+ "type": "integer",
323
+ "primaryKey": false,
324
+ "notNull": true,
325
+ "default": -1
326
+ },
327
+ "join_order": {
328
+ "name": "join_order",
329
+ "type": "integer",
330
+ "primaryKey": false,
331
+ "notNull": true,
332
+ "default": 0
333
+ },
334
+ "display_name": {
335
+ "name": "display_name",
336
+ "type": "text",
337
+ "primaryKey": false,
338
+ "notNull": true
339
+ },
340
+ "portrait_id": {
341
+ "name": "portrait_id",
342
+ "type": "integer",
343
+ "primaryKey": false,
344
+ "notNull": true,
345
+ "default": 0
346
+ },
347
+ "token_hash": {
348
+ "name": "token_hash",
349
+ "type": "text",
350
+ "primaryKey": false,
351
+ "notNull": false
352
+ },
353
+ "status": {
354
+ "name": "status",
355
+ "type": "text",
356
+ "primaryKey": false,
357
+ "notNull": true
358
+ },
359
+ "joined_at": {
360
+ "name": "joined_at",
361
+ "type": "timestamp with time zone",
362
+ "primaryKey": false,
363
+ "notNull": true
364
+ }
365
+ },
366
+ "indexes": {
367
+ "players_match_idx": {
368
+ "name": "players_match_idx",
369
+ "columns": [
370
+ {
371
+ "expression": "match_id",
372
+ "isExpression": false,
373
+ "asc": true,
374
+ "nulls": "last"
375
+ }
376
+ ],
377
+ "isUnique": false,
378
+ "concurrently": false,
379
+ "method": "btree",
380
+ "with": {}
381
+ }
382
+ },
383
+ "foreignKeys": {
384
+ "players_match_id_matches_id_fk": {
385
+ "name": "players_match_id_matches_id_fk",
386
+ "tableFrom": "players",
387
+ "tableTo": "matches",
388
+ "columnsFrom": [
389
+ "match_id"
390
+ ],
391
+ "columnsTo": [
392
+ "id"
393
+ ],
394
+ "onDelete": "cascade",
395
+ "onUpdate": "no action"
396
+ }
397
+ },
398
+ "compositePrimaryKeys": {},
399
+ "uniqueConstraints": {
400
+ "players_token_hash_unique": {
401
+ "name": "players_token_hash_unique",
402
+ "nullsNotDistinct": false,
403
+ "columns": [
404
+ "token_hash"
405
+ ]
406
+ }
407
+ },
408
+ "policies": {},
409
+ "checkConstraints": {},
410
+ "isRLSEnabled": false
411
+ },
412
+ "public.snapshots": {
413
+ "name": "snapshots",
414
+ "schema": "",
415
+ "columns": {
416
+ "match_id": {
417
+ "name": "match_id",
418
+ "type": "text",
419
+ "primaryKey": false,
420
+ "notNull": true
421
+ },
422
+ "turn": {
423
+ "name": "turn",
424
+ "type": "integer",
425
+ "primaryKey": false,
426
+ "notNull": true
427
+ },
428
+ "format_version": {
429
+ "name": "format_version",
430
+ "type": "integer",
431
+ "primaryKey": false,
432
+ "notNull": true
433
+ },
434
+ "protocol_version": {
435
+ "name": "protocol_version",
436
+ "type": "integer",
437
+ "primaryKey": false,
438
+ "notNull": true,
439
+ "default": 1
440
+ },
441
+ "session_version": {
442
+ "name": "session_version",
443
+ "type": "integer",
444
+ "primaryKey": false,
445
+ "notNull": true,
446
+ "default": 1
447
+ },
448
+ "state_hash": {
449
+ "name": "state_hash",
450
+ "type": "text",
451
+ "primaryKey": false,
452
+ "notNull": true
453
+ },
454
+ "uploaded_by_player_id": {
455
+ "name": "uploaded_by_player_id",
456
+ "type": "text",
457
+ "primaryKey": false,
458
+ "notNull": true
459
+ },
460
+ "uploaded_at": {
461
+ "name": "uploaded_at",
462
+ "type": "timestamp with time zone",
463
+ "primaryKey": false,
464
+ "notNull": true
465
+ },
466
+ "body": {
467
+ "name": "body",
468
+ "type": "text",
469
+ "primaryKey": false,
470
+ "notNull": true
471
+ }
472
+ },
473
+ "indexes": {},
474
+ "foreignKeys": {
475
+ "snapshots_match_id_matches_id_fk": {
476
+ "name": "snapshots_match_id_matches_id_fk",
477
+ "tableFrom": "snapshots",
478
+ "tableTo": "matches",
479
+ "columnsFrom": [
480
+ "match_id"
481
+ ],
482
+ "columnsTo": [
483
+ "id"
484
+ ],
485
+ "onDelete": "cascade",
486
+ "onUpdate": "no action"
487
+ }
488
+ },
489
+ "compositePrimaryKeys": {
490
+ "snapshots_match_id_turn_pk": {
491
+ "name": "snapshots_match_id_turn_pk",
492
+ "columns": [
493
+ "match_id",
494
+ "turn"
495
+ ]
496
+ }
497
+ },
498
+ "uniqueConstraints": {},
499
+ "policies": {},
500
+ "checkConstraints": {},
501
+ "isRLSEnabled": false
502
+ },
503
+ "public.takeover_prompts": {
504
+ "name": "takeover_prompts",
505
+ "schema": "",
506
+ "columns": {
507
+ "match_id": {
508
+ "name": "match_id",
509
+ "type": "text",
510
+ "primaryKey": false,
511
+ "notNull": true
512
+ },
513
+ "player_id": {
514
+ "name": "player_id",
515
+ "type": "text",
516
+ "primaryKey": false,
517
+ "notNull": true
518
+ },
519
+ "turn": {
520
+ "name": "turn",
521
+ "type": "integer",
522
+ "primaryKey": false,
523
+ "notNull": true
524
+ },
525
+ "opened_at": {
526
+ "name": "opened_at",
527
+ "type": "timestamp with time zone",
528
+ "primaryKey": false,
529
+ "notNull": true
530
+ },
531
+ "announced_at": {
532
+ "name": "announced_at",
533
+ "type": "timestamp with time zone",
534
+ "primaryKey": false,
535
+ "notNull": false
536
+ }
537
+ },
538
+ "indexes": {},
539
+ "foreignKeys": {
540
+ "takeover_prompts_match_id_matches_id_fk": {
541
+ "name": "takeover_prompts_match_id_matches_id_fk",
542
+ "tableFrom": "takeover_prompts",
543
+ "tableTo": "matches",
544
+ "columnsFrom": [
545
+ "match_id"
546
+ ],
547
+ "columnsTo": [
548
+ "id"
549
+ ],
550
+ "onDelete": "cascade",
551
+ "onUpdate": "no action"
552
+ }
553
+ },
554
+ "compositePrimaryKeys": {
555
+ "takeover_prompts_match_id_player_id_pk": {
556
+ "name": "takeover_prompts_match_id_player_id_pk",
557
+ "columns": [
558
+ "match_id",
559
+ "player_id"
560
+ ]
561
+ }
562
+ },
563
+ "uniqueConstraints": {},
564
+ "policies": {},
565
+ "checkConstraints": {},
566
+ "isRLSEnabled": false
567
+ },
568
+ "public.takeover_votes": {
569
+ "name": "takeover_votes",
570
+ "schema": "",
571
+ "columns": {
572
+ "match_id": {
573
+ "name": "match_id",
574
+ "type": "text",
575
+ "primaryKey": false,
576
+ "notNull": true
577
+ },
578
+ "target_player_id": {
579
+ "name": "target_player_id",
580
+ "type": "text",
581
+ "primaryKey": false,
582
+ "notNull": true
583
+ },
584
+ "voter_player_id": {
585
+ "name": "voter_player_id",
586
+ "type": "text",
587
+ "primaryKey": false,
588
+ "notNull": true
589
+ },
590
+ "decision": {
591
+ "name": "decision",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "cast_at": {
597
+ "name": "cast_at",
598
+ "type": "timestamp with time zone",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ }
602
+ },
603
+ "indexes": {},
604
+ "foreignKeys": {
605
+ "takeover_votes_match_id_matches_id_fk": {
606
+ "name": "takeover_votes_match_id_matches_id_fk",
607
+ "tableFrom": "takeover_votes",
608
+ "tableTo": "matches",
609
+ "columnsFrom": [
610
+ "match_id"
611
+ ],
612
+ "columnsTo": [
613
+ "id"
614
+ ],
615
+ "onDelete": "cascade",
616
+ "onUpdate": "no action"
617
+ }
618
+ },
619
+ "compositePrimaryKeys": {
620
+ "takeover_votes_match_id_target_player_id_voter_player_id_pk": {
621
+ "name": "takeover_votes_match_id_target_player_id_voter_player_id_pk",
622
+ "columns": [
623
+ "match_id",
624
+ "target_player_id",
625
+ "voter_player_id"
626
+ ]
627
+ }
628
+ },
629
+ "uniqueConstraints": {},
630
+ "policies": {},
631
+ "checkConstraints": {},
632
+ "isRLSEnabled": false
633
+ },
634
+ "public.turn_orders": {
635
+ "name": "turn_orders",
636
+ "schema": "",
637
+ "columns": {
638
+ "match_id": {
639
+ "name": "match_id",
640
+ "type": "text",
641
+ "primaryKey": false,
642
+ "notNull": true
643
+ },
644
+ "turn": {
645
+ "name": "turn",
646
+ "type": "integer",
647
+ "primaryKey": false,
648
+ "notNull": true
649
+ },
650
+ "player_id": {
651
+ "name": "player_id",
652
+ "type": "text",
653
+ "primaryKey": false,
654
+ "notNull": true
655
+ },
656
+ "orders": {
657
+ "name": "orders",
658
+ "type": "jsonb",
659
+ "primaryKey": false,
660
+ "notNull": false
661
+ },
662
+ "orders_hash": {
663
+ "name": "orders_hash",
664
+ "type": "text",
665
+ "primaryKey": false,
666
+ "notNull": false
667
+ },
668
+ "ready": {
669
+ "name": "ready",
670
+ "type": "boolean",
671
+ "primaryKey": false,
672
+ "notNull": true,
673
+ "default": false
674
+ },
675
+ "submitted_at": {
676
+ "name": "submitted_at",
677
+ "type": "timestamp with time zone",
678
+ "primaryKey": false,
679
+ "notNull": false
680
+ }
681
+ },
682
+ "indexes": {},
683
+ "foreignKeys": {
684
+ "turn_orders_match_id_matches_id_fk": {
685
+ "name": "turn_orders_match_id_matches_id_fk",
686
+ "tableFrom": "turn_orders",
687
+ "tableTo": "matches",
688
+ "columnsFrom": [
689
+ "match_id"
690
+ ],
691
+ "columnsTo": [
692
+ "id"
693
+ ],
694
+ "onDelete": "cascade",
695
+ "onUpdate": "no action"
696
+ }
697
+ },
698
+ "compositePrimaryKeys": {
699
+ "turn_orders_match_id_turn_player_id_pk": {
700
+ "name": "turn_orders_match_id_turn_player_id_pk",
701
+ "columns": [
702
+ "match_id",
703
+ "turn",
704
+ "player_id"
705
+ ]
706
+ }
707
+ },
708
+ "uniqueConstraints": {},
709
+ "policies": {},
710
+ "checkConstraints": {},
711
+ "isRLSEnabled": false
712
+ },
713
+ "public.turn_reports": {
714
+ "name": "turn_reports",
715
+ "schema": "",
716
+ "columns": {
717
+ "match_id": {
718
+ "name": "match_id",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": true
722
+ },
723
+ "turn": {
724
+ "name": "turn",
725
+ "type": "integer",
726
+ "primaryKey": false,
727
+ "notNull": true
728
+ },
729
+ "player_id": {
730
+ "name": "player_id",
731
+ "type": "text",
732
+ "primaryKey": false,
733
+ "notNull": true
734
+ },
735
+ "state_hash": {
736
+ "name": "state_hash",
737
+ "type": "text",
738
+ "primaryKey": false,
739
+ "notNull": true
740
+ },
741
+ "finished": {
742
+ "name": "finished",
743
+ "type": "boolean",
744
+ "primaryKey": false,
745
+ "notNull": true,
746
+ "default": false
747
+ },
748
+ "reported_at": {
749
+ "name": "reported_at",
750
+ "type": "timestamp with time zone",
751
+ "primaryKey": false,
752
+ "notNull": true
753
+ }
754
+ },
755
+ "indexes": {},
756
+ "foreignKeys": {
757
+ "turn_reports_match_id_matches_id_fk": {
758
+ "name": "turn_reports_match_id_matches_id_fk",
759
+ "tableFrom": "turn_reports",
760
+ "tableTo": "matches",
761
+ "columnsFrom": [
762
+ "match_id"
763
+ ],
764
+ "columnsTo": [
765
+ "id"
766
+ ],
767
+ "onDelete": "cascade",
768
+ "onUpdate": "no action"
769
+ }
770
+ },
771
+ "compositePrimaryKeys": {
772
+ "turn_reports_match_id_turn_player_id_pk": {
773
+ "name": "turn_reports_match_id_turn_player_id_pk",
774
+ "columns": [
775
+ "match_id",
776
+ "turn",
777
+ "player_id"
778
+ ]
779
+ }
780
+ },
781
+ "uniqueConstraints": {},
782
+ "policies": {},
783
+ "checkConstraints": {},
784
+ "isRLSEnabled": false
785
+ },
786
+ "public.turns": {
787
+ "name": "turns",
788
+ "schema": "",
789
+ "columns": {
790
+ "match_id": {
791
+ "name": "match_id",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": true
795
+ },
796
+ "number": {
797
+ "name": "number",
798
+ "type": "integer",
799
+ "primaryKey": false,
800
+ "notNull": true
801
+ },
802
+ "status": {
803
+ "name": "status",
804
+ "type": "text",
805
+ "primaryKey": false,
806
+ "notNull": true
807
+ },
808
+ "opened_at": {
809
+ "name": "opened_at",
810
+ "type": "timestamp with time zone",
811
+ "primaryKey": false,
812
+ "notNull": true
813
+ },
814
+ "deadline_at": {
815
+ "name": "deadline_at",
816
+ "type": "timestamp with time zone",
817
+ "primaryKey": false,
818
+ "notNull": false
819
+ },
820
+ "sealed_at": {
821
+ "name": "sealed_at",
822
+ "type": "timestamp with time zone",
823
+ "primaryKey": false,
824
+ "notNull": false
825
+ },
826
+ "order_set_hash": {
827
+ "name": "order_set_hash",
828
+ "type": "text",
829
+ "primaryKey": false,
830
+ "notNull": false
831
+ },
832
+ "sealed_slots": {
833
+ "name": "sealed_slots",
834
+ "type": "jsonb",
835
+ "primaryKey": false,
836
+ "notNull": false
837
+ },
838
+ "state_hash": {
839
+ "name": "state_hash",
840
+ "type": "text",
841
+ "primaryKey": false,
842
+ "notNull": false
843
+ },
844
+ "desynced_at": {
845
+ "name": "desynced_at",
846
+ "type": "timestamp with time zone",
847
+ "primaryKey": false,
848
+ "notNull": false
849
+ },
850
+ "settled_at": {
851
+ "name": "settled_at",
852
+ "type": "timestamp with time zone",
853
+ "primaryKey": false,
854
+ "notNull": false
855
+ }
856
+ },
857
+ "indexes": {
858
+ "turns_deadline_idx": {
859
+ "name": "turns_deadline_idx",
860
+ "columns": [
861
+ {
862
+ "expression": "status",
863
+ "isExpression": false,
864
+ "asc": true,
865
+ "nulls": "last"
866
+ },
867
+ {
868
+ "expression": "deadline_at",
869
+ "isExpression": false,
870
+ "asc": true,
871
+ "nulls": "last"
872
+ }
873
+ ],
874
+ "isUnique": false,
875
+ "concurrently": false,
876
+ "method": "btree",
877
+ "with": {}
878
+ },
879
+ "turns_settled_idx": {
880
+ "name": "turns_settled_idx",
881
+ "columns": [
882
+ {
883
+ "expression": "status",
884
+ "isExpression": false,
885
+ "asc": true,
886
+ "nulls": "last"
887
+ },
888
+ {
889
+ "expression": "settled_at",
890
+ "isExpression": false,
891
+ "asc": true,
892
+ "nulls": "last"
893
+ }
894
+ ],
895
+ "isUnique": false,
896
+ "concurrently": false,
897
+ "method": "btree",
898
+ "with": {}
899
+ }
900
+ },
901
+ "foreignKeys": {
902
+ "turns_match_id_matches_id_fk": {
903
+ "name": "turns_match_id_matches_id_fk",
904
+ "tableFrom": "turns",
905
+ "tableTo": "matches",
906
+ "columnsFrom": [
907
+ "match_id"
908
+ ],
909
+ "columnsTo": [
910
+ "id"
911
+ ],
912
+ "onDelete": "cascade",
913
+ "onUpdate": "no action"
914
+ }
915
+ },
916
+ "compositePrimaryKeys": {
917
+ "turns_match_id_number_pk": {
918
+ "name": "turns_match_id_number_pk",
919
+ "columns": [
920
+ "match_id",
921
+ "number"
922
+ ]
923
+ }
924
+ },
925
+ "uniqueConstraints": {},
926
+ "policies": {},
927
+ "checkConstraints": {},
928
+ "isRLSEnabled": false
929
+ }
930
+ },
931
+ "enums": {},
932
+ "schemas": {},
933
+ "sequences": {},
934
+ "roles": {},
935
+ "policies": {},
936
+ "views": {},
937
+ "_meta": {
938
+ "columns": {},
939
+ "schemas": {},
940
+ "tables": {}
941
+ }
942
+ }