@chaos-overlords/storage 0.5.0 → 0.7.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,2 @@
1
+ ALTER TABLE `matches` ADD `protocol_version` integer DEFAULT 1 NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE `snapshots` ADD `protocol_version` integer DEFAULT 1 NOT NULL;
@@ -0,0 +1,685 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "2bd3b34d-369c-4226-8628-c832366461be",
5
+ "prevId": "f8d9bc5d-be05-4ca9-8bd0-c8cc38b8861e",
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": [
53
+ "match_id"
54
+ ],
55
+ "columnsTo": [
56
+ "id"
57
+ ],
58
+ "onDelete": "cascade",
59
+ "onUpdate": "no action"
60
+ }
61
+ },
62
+ "compositePrimaryKeys": {
63
+ "match_events_match_id_seq_pk": {
64
+ "columns": [
65
+ "match_id",
66
+ "seq"
67
+ ],
68
+ "name": "match_events_match_id_seq_pk"
69
+ }
70
+ },
71
+ "uniqueConstraints": {},
72
+ "checkConstraints": {}
73
+ },
74
+ "matches": {
75
+ "name": "matches",
76
+ "columns": {
77
+ "id": {
78
+ "name": "id",
79
+ "type": "text",
80
+ "primaryKey": true,
81
+ "notNull": true,
82
+ "autoincrement": false
83
+ },
84
+ "protocol_version": {
85
+ "name": "protocol_version",
86
+ "type": "integer",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "autoincrement": false,
90
+ "default": 1
91
+ },
92
+ "status": {
93
+ "name": "status",
94
+ "type": "text",
95
+ "primaryKey": false,
96
+ "notNull": true,
97
+ "autoincrement": false
98
+ },
99
+ "name": {
100
+ "name": "name",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": true,
104
+ "autoincrement": false
105
+ },
106
+ "visibility": {
107
+ "name": "visibility",
108
+ "type": "text",
109
+ "primaryKey": false,
110
+ "notNull": true,
111
+ "autoincrement": false
112
+ },
113
+ "max_players": {
114
+ "name": "max_players",
115
+ "type": "integer",
116
+ "primaryKey": false,
117
+ "notNull": true,
118
+ "autoincrement": false
119
+ },
120
+ "settings": {
121
+ "name": "settings",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true,
125
+ "autoincrement": false
126
+ },
127
+ "host_player_id": {
128
+ "name": "host_player_id",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "autoincrement": false
133
+ },
134
+ "join_code": {
135
+ "name": "join_code",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "autoincrement": false
140
+ },
141
+ "password_hash": {
142
+ "name": "password_hash",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": false,
146
+ "autoincrement": false
147
+ },
148
+ "seed": {
149
+ "name": "seed",
150
+ "type": "integer",
151
+ "primaryKey": false,
152
+ "notNull": false,
153
+ "autoincrement": false
154
+ },
155
+ "current_turn": {
156
+ "name": "current_turn",
157
+ "type": "integer",
158
+ "primaryKey": false,
159
+ "notNull": true,
160
+ "autoincrement": false,
161
+ "default": 0
162
+ },
163
+ "seat_count": {
164
+ "name": "seat_count",
165
+ "type": "integer",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "autoincrement": false,
169
+ "default": 1
170
+ },
171
+ "join_counter": {
172
+ "name": "join_counter",
173
+ "type": "integer",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "autoincrement": false,
177
+ "default": 1
178
+ },
179
+ "created_at": {
180
+ "name": "created_at",
181
+ "type": "integer",
182
+ "primaryKey": false,
183
+ "notNull": true,
184
+ "autoincrement": false
185
+ },
186
+ "updated_at": {
187
+ "name": "updated_at",
188
+ "type": "integer",
189
+ "primaryKey": false,
190
+ "notNull": true,
191
+ "autoincrement": false
192
+ }
193
+ },
194
+ "indexes": {
195
+ "matches_join_code_unique": {
196
+ "name": "matches_join_code_unique",
197
+ "columns": [
198
+ "join_code"
199
+ ],
200
+ "isUnique": true
201
+ },
202
+ "matches_status_updated_idx": {
203
+ "name": "matches_status_updated_idx",
204
+ "columns": [
205
+ "status",
206
+ "updated_at"
207
+ ],
208
+ "isUnique": false
209
+ },
210
+ "matches_lobby_idx": {
211
+ "name": "matches_lobby_idx",
212
+ "columns": [
213
+ "status",
214
+ "visibility",
215
+ "created_at"
216
+ ],
217
+ "isUnique": false
218
+ }
219
+ },
220
+ "foreignKeys": {},
221
+ "compositePrimaryKeys": {},
222
+ "uniqueConstraints": {},
223
+ "checkConstraints": {}
224
+ },
225
+ "players": {
226
+ "name": "players",
227
+ "columns": {
228
+ "id": {
229
+ "name": "id",
230
+ "type": "text",
231
+ "primaryKey": true,
232
+ "notNull": true,
233
+ "autoincrement": false
234
+ },
235
+ "match_id": {
236
+ "name": "match_id",
237
+ "type": "text",
238
+ "primaryKey": false,
239
+ "notNull": true,
240
+ "autoincrement": false
241
+ },
242
+ "slot": {
243
+ "name": "slot",
244
+ "type": "integer",
245
+ "primaryKey": false,
246
+ "notNull": true,
247
+ "autoincrement": false,
248
+ "default": -1
249
+ },
250
+ "join_order": {
251
+ "name": "join_order",
252
+ "type": "integer",
253
+ "primaryKey": false,
254
+ "notNull": true,
255
+ "autoincrement": false,
256
+ "default": 0
257
+ },
258
+ "display_name": {
259
+ "name": "display_name",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": true,
263
+ "autoincrement": false
264
+ },
265
+ "token_hash": {
266
+ "name": "token_hash",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": false,
270
+ "autoincrement": false
271
+ },
272
+ "status": {
273
+ "name": "status",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ },
279
+ "joined_at": {
280
+ "name": "joined_at",
281
+ "type": "integer",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "autoincrement": false
285
+ }
286
+ },
287
+ "indexes": {
288
+ "players_token_hash_unique": {
289
+ "name": "players_token_hash_unique",
290
+ "columns": [
291
+ "token_hash"
292
+ ],
293
+ "isUnique": true
294
+ },
295
+ "players_match_idx": {
296
+ "name": "players_match_idx",
297
+ "columns": [
298
+ "match_id"
299
+ ],
300
+ "isUnique": false
301
+ }
302
+ },
303
+ "foreignKeys": {
304
+ "players_match_id_matches_id_fk": {
305
+ "name": "players_match_id_matches_id_fk",
306
+ "tableFrom": "players",
307
+ "tableTo": "matches",
308
+ "columnsFrom": [
309
+ "match_id"
310
+ ],
311
+ "columnsTo": [
312
+ "id"
313
+ ],
314
+ "onDelete": "cascade",
315
+ "onUpdate": "no action"
316
+ }
317
+ },
318
+ "compositePrimaryKeys": {},
319
+ "uniqueConstraints": {},
320
+ "checkConstraints": {}
321
+ },
322
+ "snapshots": {
323
+ "name": "snapshots",
324
+ "columns": {
325
+ "match_id": {
326
+ "name": "match_id",
327
+ "type": "text",
328
+ "primaryKey": false,
329
+ "notNull": true,
330
+ "autoincrement": false
331
+ },
332
+ "turn": {
333
+ "name": "turn",
334
+ "type": "integer",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "autoincrement": false
338
+ },
339
+ "format_version": {
340
+ "name": "format_version",
341
+ "type": "integer",
342
+ "primaryKey": false,
343
+ "notNull": true,
344
+ "autoincrement": false
345
+ },
346
+ "protocol_version": {
347
+ "name": "protocol_version",
348
+ "type": "integer",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "autoincrement": false,
352
+ "default": 1
353
+ },
354
+ "state_hash": {
355
+ "name": "state_hash",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": true,
359
+ "autoincrement": false
360
+ },
361
+ "uploaded_by_player_id": {
362
+ "name": "uploaded_by_player_id",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": true,
366
+ "autoincrement": false
367
+ },
368
+ "uploaded_at": {
369
+ "name": "uploaded_at",
370
+ "type": "integer",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "autoincrement": false
374
+ },
375
+ "body": {
376
+ "name": "body",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": true,
380
+ "autoincrement": false
381
+ }
382
+ },
383
+ "indexes": {},
384
+ "foreignKeys": {
385
+ "snapshots_match_id_matches_id_fk": {
386
+ "name": "snapshots_match_id_matches_id_fk",
387
+ "tableFrom": "snapshots",
388
+ "tableTo": "matches",
389
+ "columnsFrom": [
390
+ "match_id"
391
+ ],
392
+ "columnsTo": [
393
+ "id"
394
+ ],
395
+ "onDelete": "cascade",
396
+ "onUpdate": "no action"
397
+ }
398
+ },
399
+ "compositePrimaryKeys": {
400
+ "snapshots_match_id_turn_pk": {
401
+ "columns": [
402
+ "match_id",
403
+ "turn"
404
+ ],
405
+ "name": "snapshots_match_id_turn_pk"
406
+ }
407
+ },
408
+ "uniqueConstraints": {},
409
+ "checkConstraints": {}
410
+ },
411
+ "turn_orders": {
412
+ "name": "turn_orders",
413
+ "columns": {
414
+ "match_id": {
415
+ "name": "match_id",
416
+ "type": "text",
417
+ "primaryKey": false,
418
+ "notNull": true,
419
+ "autoincrement": false
420
+ },
421
+ "turn": {
422
+ "name": "turn",
423
+ "type": "integer",
424
+ "primaryKey": false,
425
+ "notNull": true,
426
+ "autoincrement": false
427
+ },
428
+ "player_id": {
429
+ "name": "player_id",
430
+ "type": "text",
431
+ "primaryKey": false,
432
+ "notNull": true,
433
+ "autoincrement": false
434
+ },
435
+ "orders": {
436
+ "name": "orders",
437
+ "type": "text",
438
+ "primaryKey": false,
439
+ "notNull": false,
440
+ "autoincrement": false
441
+ },
442
+ "orders_hash": {
443
+ "name": "orders_hash",
444
+ "type": "text",
445
+ "primaryKey": false,
446
+ "notNull": false,
447
+ "autoincrement": false
448
+ },
449
+ "ready": {
450
+ "name": "ready",
451
+ "type": "integer",
452
+ "primaryKey": false,
453
+ "notNull": true,
454
+ "autoincrement": false,
455
+ "default": false
456
+ },
457
+ "submitted_at": {
458
+ "name": "submitted_at",
459
+ "type": "integer",
460
+ "primaryKey": false,
461
+ "notNull": false,
462
+ "autoincrement": false
463
+ }
464
+ },
465
+ "indexes": {},
466
+ "foreignKeys": {
467
+ "turn_orders_match_id_matches_id_fk": {
468
+ "name": "turn_orders_match_id_matches_id_fk",
469
+ "tableFrom": "turn_orders",
470
+ "tableTo": "matches",
471
+ "columnsFrom": [
472
+ "match_id"
473
+ ],
474
+ "columnsTo": [
475
+ "id"
476
+ ],
477
+ "onDelete": "cascade",
478
+ "onUpdate": "no action"
479
+ }
480
+ },
481
+ "compositePrimaryKeys": {
482
+ "turn_orders_match_id_turn_player_id_pk": {
483
+ "columns": [
484
+ "match_id",
485
+ "turn",
486
+ "player_id"
487
+ ],
488
+ "name": "turn_orders_match_id_turn_player_id_pk"
489
+ }
490
+ },
491
+ "uniqueConstraints": {},
492
+ "checkConstraints": {}
493
+ },
494
+ "turn_reports": {
495
+ "name": "turn_reports",
496
+ "columns": {
497
+ "match_id": {
498
+ "name": "match_id",
499
+ "type": "text",
500
+ "primaryKey": false,
501
+ "notNull": true,
502
+ "autoincrement": false
503
+ },
504
+ "turn": {
505
+ "name": "turn",
506
+ "type": "integer",
507
+ "primaryKey": false,
508
+ "notNull": true,
509
+ "autoincrement": false
510
+ },
511
+ "player_id": {
512
+ "name": "player_id",
513
+ "type": "text",
514
+ "primaryKey": false,
515
+ "notNull": true,
516
+ "autoincrement": false
517
+ },
518
+ "state_hash": {
519
+ "name": "state_hash",
520
+ "type": "text",
521
+ "primaryKey": false,
522
+ "notNull": true,
523
+ "autoincrement": false
524
+ },
525
+ "finished": {
526
+ "name": "finished",
527
+ "type": "integer",
528
+ "primaryKey": false,
529
+ "notNull": true,
530
+ "autoincrement": false,
531
+ "default": false
532
+ },
533
+ "reported_at": {
534
+ "name": "reported_at",
535
+ "type": "integer",
536
+ "primaryKey": false,
537
+ "notNull": true,
538
+ "autoincrement": false
539
+ }
540
+ },
541
+ "indexes": {},
542
+ "foreignKeys": {
543
+ "turn_reports_match_id_matches_id_fk": {
544
+ "name": "turn_reports_match_id_matches_id_fk",
545
+ "tableFrom": "turn_reports",
546
+ "tableTo": "matches",
547
+ "columnsFrom": [
548
+ "match_id"
549
+ ],
550
+ "columnsTo": [
551
+ "id"
552
+ ],
553
+ "onDelete": "cascade",
554
+ "onUpdate": "no action"
555
+ }
556
+ },
557
+ "compositePrimaryKeys": {
558
+ "turn_reports_match_id_turn_player_id_pk": {
559
+ "columns": [
560
+ "match_id",
561
+ "turn",
562
+ "player_id"
563
+ ],
564
+ "name": "turn_reports_match_id_turn_player_id_pk"
565
+ }
566
+ },
567
+ "uniqueConstraints": {},
568
+ "checkConstraints": {}
569
+ },
570
+ "turns": {
571
+ "name": "turns",
572
+ "columns": {
573
+ "match_id": {
574
+ "name": "match_id",
575
+ "type": "text",
576
+ "primaryKey": false,
577
+ "notNull": true,
578
+ "autoincrement": false
579
+ },
580
+ "number": {
581
+ "name": "number",
582
+ "type": "integer",
583
+ "primaryKey": false,
584
+ "notNull": true,
585
+ "autoincrement": false
586
+ },
587
+ "status": {
588
+ "name": "status",
589
+ "type": "text",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "autoincrement": false
593
+ },
594
+ "opened_at": {
595
+ "name": "opened_at",
596
+ "type": "integer",
597
+ "primaryKey": false,
598
+ "notNull": true,
599
+ "autoincrement": false
600
+ },
601
+ "deadline_at": {
602
+ "name": "deadline_at",
603
+ "type": "integer",
604
+ "primaryKey": false,
605
+ "notNull": false,
606
+ "autoincrement": false
607
+ },
608
+ "sealed_at": {
609
+ "name": "sealed_at",
610
+ "type": "integer",
611
+ "primaryKey": false,
612
+ "notNull": false,
613
+ "autoincrement": false
614
+ },
615
+ "order_set_hash": {
616
+ "name": "order_set_hash",
617
+ "type": "text",
618
+ "primaryKey": false,
619
+ "notNull": false,
620
+ "autoincrement": false
621
+ },
622
+ "sealed_slots": {
623
+ "name": "sealed_slots",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": false,
627
+ "autoincrement": false
628
+ },
629
+ "state_hash": {
630
+ "name": "state_hash",
631
+ "type": "text",
632
+ "primaryKey": false,
633
+ "notNull": false,
634
+ "autoincrement": false
635
+ }
636
+ },
637
+ "indexes": {
638
+ "turns_deadline_idx": {
639
+ "name": "turns_deadline_idx",
640
+ "columns": [
641
+ "status",
642
+ "deadline_at"
643
+ ],
644
+ "isUnique": false
645
+ }
646
+ },
647
+ "foreignKeys": {
648
+ "turns_match_id_matches_id_fk": {
649
+ "name": "turns_match_id_matches_id_fk",
650
+ "tableFrom": "turns",
651
+ "tableTo": "matches",
652
+ "columnsFrom": [
653
+ "match_id"
654
+ ],
655
+ "columnsTo": [
656
+ "id"
657
+ ],
658
+ "onDelete": "cascade",
659
+ "onUpdate": "no action"
660
+ }
661
+ },
662
+ "compositePrimaryKeys": {
663
+ "turns_match_id_number_pk": {
664
+ "columns": [
665
+ "match_id",
666
+ "number"
667
+ ],
668
+ "name": "turns_match_id_number_pk"
669
+ }
670
+ },
671
+ "uniqueConstraints": {},
672
+ "checkConstraints": {}
673
+ }
674
+ },
675
+ "views": {},
676
+ "enums": {},
677
+ "_meta": {
678
+ "schemas": {},
679
+ "tables": {},
680
+ "columns": {}
681
+ },
682
+ "internal": {
683
+ "indexes": {}
684
+ }
685
+ }
@@ -15,6 +15,13 @@
15
15
  "when": 1789380379533,
16
16
  "tag": "0001_sticky_umar",
17
17
  "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "6",
22
+ "when": 1789756760428,
23
+ "tag": "0002_clean_shinobi_shaw",
24
+ "breakpoints": true
18
25
  }
19
26
  ]
20
- }
27
+ }