@matteai/stma-server 0.11.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 (43) hide show
  1. package/dist/index.js +18444 -0
  2. package/dist/index.js.map +1 -0
  3. package/drizzle/0000_nappy_franklin_storm.sql +115 -0
  4. package/drizzle/0001_grey_ogun.sql +1 -0
  5. package/drizzle/0002_crazy_vindicator.sql +1 -0
  6. package/drizzle/0003_tan_puma.sql +1 -0
  7. package/drizzle/0004_dry_selene.sql +40 -0
  8. package/drizzle/0005_hot_the_fallen.sql +103 -0
  9. package/drizzle/0006_cooing_cargill.sql +42 -0
  10. package/drizzle/0007_public_slyde.sql +12 -0
  11. package/drizzle/0008_loving_maestro.sql +9 -0
  12. package/drizzle/0009_cultured_bucky.sql +15 -0
  13. package/drizzle/0010_dazzling_mephisto.sql +26 -0
  14. package/drizzle/0011_kind_toxin.sql +20 -0
  15. package/drizzle/0012_ordinary_jamie_braddock.sql +31 -0
  16. package/drizzle/0013_warm_silk_fever.sql +7 -0
  17. package/drizzle/0014_talented_squadron_sinister.sql +22 -0
  18. package/drizzle/0015_wild_bill_hollister.sql +8 -0
  19. package/drizzle/0016_lucky_shooting_star.sql +8 -0
  20. package/drizzle/0017_same_blindfold.sql +21 -0
  21. package/drizzle/0018_premium_namora.sql +20 -0
  22. package/drizzle/0019_brown_dragon_lord.sql +6 -0
  23. package/drizzle/meta/0000_snapshot.json +845 -0
  24. package/drizzle/meta/0001_snapshot.json +851 -0
  25. package/drizzle/meta/0002_snapshot.json +857 -0
  26. package/drizzle/meta/0003_snapshot.json +863 -0
  27. package/drizzle/meta/0004_snapshot.json +1204 -0
  28. package/drizzle/meta/0005_snapshot.json +2063 -0
  29. package/drizzle/meta/0006_snapshot.json +2080 -0
  30. package/drizzle/meta/0007_snapshot.json +2157 -0
  31. package/drizzle/meta/0008_snapshot.json +2216 -0
  32. package/drizzle/meta/0009_snapshot.json +2314 -0
  33. package/drizzle/meta/0010_snapshot.json +2431 -0
  34. package/drizzle/meta/0011_snapshot.json +2608 -0
  35. package/drizzle/meta/0012_snapshot.json +2870 -0
  36. package/drizzle/meta/0013_snapshot.json +2918 -0
  37. package/drizzle/meta/0014_snapshot.json +3081 -0
  38. package/drizzle/meta/0015_snapshot.json +3093 -0
  39. package/drizzle/meta/0017_snapshot.json +3271 -0
  40. package/drizzle/meta/0018_snapshot.json +3430 -0
  41. package/drizzle/meta/0019_snapshot.json +3466 -0
  42. package/drizzle/meta/_journal.json +146 -0
  43. package/package.json +67 -0
@@ -0,0 +1,2063 @@
1
+ {
2
+ "id": "2982c4c7-447e-43e0-ba25-232cfc9bf724",
3
+ "prevId": "7e27c3ad-9373-4343-8eea-8326e35e74b4",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.activity": {
8
+ "name": "activity",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "team_id": {
19
+ "name": "team_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "project_id": {
25
+ "name": "project_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": false
29
+ },
30
+ "user_id": {
31
+ "name": "user_id",
32
+ "type": "uuid",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "token_id": {
37
+ "name": "token_id",
38
+ "type": "uuid",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "action": {
43
+ "name": "action",
44
+ "type": "text",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ },
48
+ "detail": {
49
+ "name": "detail",
50
+ "type": "text",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "created_at": {
55
+ "name": "created_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {
63
+ "activity_team_created": {
64
+ "name": "activity_team_created",
65
+ "columns": [
66
+ {
67
+ "expression": "team_id",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ },
72
+ {
73
+ "expression": "created_at",
74
+ "isExpression": false,
75
+ "asc": true,
76
+ "nulls": "last"
77
+ }
78
+ ],
79
+ "isUnique": false,
80
+ "concurrently": false,
81
+ "method": "btree",
82
+ "with": {}
83
+ }
84
+ },
85
+ "foreignKeys": {
86
+ "activity_team_id_teams_id_fk": {
87
+ "name": "activity_team_id_teams_id_fk",
88
+ "tableFrom": "activity",
89
+ "tableTo": "teams",
90
+ "columnsFrom": [
91
+ "team_id"
92
+ ],
93
+ "columnsTo": [
94
+ "id"
95
+ ],
96
+ "onDelete": "cascade",
97
+ "onUpdate": "no action"
98
+ },
99
+ "activity_project_id_projects_id_fk": {
100
+ "name": "activity_project_id_projects_id_fk",
101
+ "tableFrom": "activity",
102
+ "tableTo": "projects",
103
+ "columnsFrom": [
104
+ "project_id"
105
+ ],
106
+ "columnsTo": [
107
+ "id"
108
+ ],
109
+ "onDelete": "set null",
110
+ "onUpdate": "no action"
111
+ },
112
+ "activity_user_id_users_id_fk": {
113
+ "name": "activity_user_id_users_id_fk",
114
+ "tableFrom": "activity",
115
+ "tableTo": "users",
116
+ "columnsFrom": [
117
+ "user_id"
118
+ ],
119
+ "columnsTo": [
120
+ "id"
121
+ ],
122
+ "onDelete": "set null",
123
+ "onUpdate": "no action"
124
+ },
125
+ "activity_token_id_tokens_id_fk": {
126
+ "name": "activity_token_id_tokens_id_fk",
127
+ "tableFrom": "activity",
128
+ "tableTo": "tokens",
129
+ "columnsFrom": [
130
+ "token_id"
131
+ ],
132
+ "columnsTo": [
133
+ "id"
134
+ ],
135
+ "onDelete": "set null",
136
+ "onUpdate": "no action"
137
+ }
138
+ },
139
+ "compositePrimaryKeys": {},
140
+ "uniqueConstraints": {},
141
+ "policies": {},
142
+ "checkConstraints": {},
143
+ "isRLSEnabled": false
144
+ },
145
+ "public.agent_events": {
146
+ "name": "agent_events",
147
+ "schema": "",
148
+ "columns": {
149
+ "id": {
150
+ "name": "id",
151
+ "type": "uuid",
152
+ "primaryKey": true,
153
+ "notNull": true,
154
+ "default": "gen_random_uuid()"
155
+ },
156
+ "run_id": {
157
+ "name": "run_id",
158
+ "type": "uuid",
159
+ "primaryKey": false,
160
+ "notNull": true
161
+ },
162
+ "type": {
163
+ "name": "type",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true
167
+ },
168
+ "detail": {
169
+ "name": "detail",
170
+ "type": "jsonb",
171
+ "primaryKey": false,
172
+ "notNull": false
173
+ },
174
+ "created_at": {
175
+ "name": "created_at",
176
+ "type": "timestamp with time zone",
177
+ "primaryKey": false,
178
+ "notNull": true,
179
+ "default": "now()"
180
+ }
181
+ },
182
+ "indexes": {
183
+ "agent_events_run_created": {
184
+ "name": "agent_events_run_created",
185
+ "columns": [
186
+ {
187
+ "expression": "run_id",
188
+ "isExpression": false,
189
+ "asc": true,
190
+ "nulls": "last"
191
+ },
192
+ {
193
+ "expression": "created_at",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ }
198
+ ],
199
+ "isUnique": false,
200
+ "concurrently": false,
201
+ "method": "btree",
202
+ "with": {}
203
+ }
204
+ },
205
+ "foreignKeys": {
206
+ "agent_events_run_id_agent_runs_id_fk": {
207
+ "name": "agent_events_run_id_agent_runs_id_fk",
208
+ "tableFrom": "agent_events",
209
+ "tableTo": "agent_runs",
210
+ "columnsFrom": [
211
+ "run_id"
212
+ ],
213
+ "columnsTo": [
214
+ "id"
215
+ ],
216
+ "onDelete": "cascade",
217
+ "onUpdate": "no action"
218
+ }
219
+ },
220
+ "compositePrimaryKeys": {},
221
+ "uniqueConstraints": {},
222
+ "policies": {},
223
+ "checkConstraints": {},
224
+ "isRLSEnabled": false
225
+ },
226
+ "public.agent_installations": {
227
+ "name": "agent_installations",
228
+ "schema": "",
229
+ "columns": {
230
+ "id": {
231
+ "name": "id",
232
+ "type": "uuid",
233
+ "primaryKey": true,
234
+ "notNull": true,
235
+ "default": "gen_random_uuid()"
236
+ },
237
+ "user_id": {
238
+ "name": "user_id",
239
+ "type": "uuid",
240
+ "primaryKey": false,
241
+ "notNull": true
242
+ },
243
+ "name": {
244
+ "name": "name",
245
+ "type": "text",
246
+ "primaryKey": false,
247
+ "notNull": true
248
+ },
249
+ "client_type": {
250
+ "name": "client_type",
251
+ "type": "text",
252
+ "primaryKey": false,
253
+ "notNull": true,
254
+ "default": "'generic'"
255
+ },
256
+ "client_version": {
257
+ "name": "client_version",
258
+ "type": "text",
259
+ "primaryKey": false,
260
+ "notNull": false
261
+ },
262
+ "device_fingerprint": {
263
+ "name": "device_fingerprint",
264
+ "type": "text",
265
+ "primaryKey": false,
266
+ "notNull": true
267
+ },
268
+ "capabilities": {
269
+ "name": "capabilities",
270
+ "type": "jsonb",
271
+ "primaryKey": false,
272
+ "notNull": true,
273
+ "default": "'[]'::jsonb"
274
+ },
275
+ "last_seen_at": {
276
+ "name": "last_seen_at",
277
+ "type": "timestamp with time zone",
278
+ "primaryKey": false,
279
+ "notNull": true,
280
+ "default": "now()"
281
+ },
282
+ "revoked_at": {
283
+ "name": "revoked_at",
284
+ "type": "timestamp with time zone",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "created_at": {
289
+ "name": "created_at",
290
+ "type": "timestamp with time zone",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {
297
+ "agent_installations_user_device_name": {
298
+ "name": "agent_installations_user_device_name",
299
+ "columns": [
300
+ {
301
+ "expression": "user_id",
302
+ "isExpression": false,
303
+ "asc": true,
304
+ "nulls": "last"
305
+ },
306
+ {
307
+ "expression": "device_fingerprint",
308
+ "isExpression": false,
309
+ "asc": true,
310
+ "nulls": "last"
311
+ },
312
+ {
313
+ "expression": "name",
314
+ "isExpression": false,
315
+ "asc": true,
316
+ "nulls": "last"
317
+ }
318
+ ],
319
+ "isUnique": true,
320
+ "concurrently": false,
321
+ "method": "btree",
322
+ "with": {}
323
+ }
324
+ },
325
+ "foreignKeys": {
326
+ "agent_installations_user_id_users_id_fk": {
327
+ "name": "agent_installations_user_id_users_id_fk",
328
+ "tableFrom": "agent_installations",
329
+ "tableTo": "users",
330
+ "columnsFrom": [
331
+ "user_id"
332
+ ],
333
+ "columnsTo": [
334
+ "id"
335
+ ],
336
+ "onDelete": "cascade",
337
+ "onUpdate": "no action"
338
+ }
339
+ },
340
+ "compositePrimaryKeys": {},
341
+ "uniqueConstraints": {},
342
+ "policies": {},
343
+ "checkConstraints": {},
344
+ "isRLSEnabled": false
345
+ },
346
+ "public.agent_runs": {
347
+ "name": "agent_runs",
348
+ "schema": "",
349
+ "columns": {
350
+ "id": {
351
+ "name": "id",
352
+ "type": "uuid",
353
+ "primaryKey": true,
354
+ "notNull": true,
355
+ "default": "gen_random_uuid()"
356
+ },
357
+ "installation_id": {
358
+ "name": "installation_id",
359
+ "type": "uuid",
360
+ "primaryKey": false,
361
+ "notNull": true
362
+ },
363
+ "team_id": {
364
+ "name": "team_id",
365
+ "type": "uuid",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "project_id": {
370
+ "name": "project_id",
371
+ "type": "uuid",
372
+ "primaryKey": false,
373
+ "notNull": false
374
+ },
375
+ "task_key": {
376
+ "name": "task_key",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": false
380
+ },
381
+ "intent": {
382
+ "name": "intent",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": false
386
+ },
387
+ "repo": {
388
+ "name": "repo",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": false
392
+ },
393
+ "branch": {
394
+ "name": "branch",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": false
398
+ },
399
+ "worktree": {
400
+ "name": "worktree",
401
+ "type": "text",
402
+ "primaryKey": false,
403
+ "notNull": false
404
+ },
405
+ "base_sha": {
406
+ "name": "base_sha",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": false
410
+ },
411
+ "status": {
412
+ "name": "status",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "default": "'starting'"
417
+ },
418
+ "policy_hash": {
419
+ "name": "policy_hash",
420
+ "type": "text",
421
+ "primaryKey": false,
422
+ "notNull": false
423
+ },
424
+ "environment_fingerprint": {
425
+ "name": "environment_fingerprint",
426
+ "type": "text",
427
+ "primaryKey": false,
428
+ "notNull": false
429
+ },
430
+ "started_at": {
431
+ "name": "started_at",
432
+ "type": "timestamp with time zone",
433
+ "primaryKey": false,
434
+ "notNull": true,
435
+ "default": "now()"
436
+ },
437
+ "last_heartbeat_at": {
438
+ "name": "last_heartbeat_at",
439
+ "type": "timestamp with time zone",
440
+ "primaryKey": false,
441
+ "notNull": true,
442
+ "default": "now()"
443
+ },
444
+ "ended_at": {
445
+ "name": "ended_at",
446
+ "type": "timestamp with time zone",
447
+ "primaryKey": false,
448
+ "notNull": false
449
+ }
450
+ },
451
+ "indexes": {
452
+ "agent_runs_team_status_heartbeat": {
453
+ "name": "agent_runs_team_status_heartbeat",
454
+ "columns": [
455
+ {
456
+ "expression": "team_id",
457
+ "isExpression": false,
458
+ "asc": true,
459
+ "nulls": "last"
460
+ },
461
+ {
462
+ "expression": "status",
463
+ "isExpression": false,
464
+ "asc": true,
465
+ "nulls": "last"
466
+ },
467
+ {
468
+ "expression": "last_heartbeat_at",
469
+ "isExpression": false,
470
+ "asc": true,
471
+ "nulls": "last"
472
+ }
473
+ ],
474
+ "isUnique": false,
475
+ "concurrently": false,
476
+ "method": "btree",
477
+ "with": {}
478
+ },
479
+ "agent_runs_installation_started": {
480
+ "name": "agent_runs_installation_started",
481
+ "columns": [
482
+ {
483
+ "expression": "installation_id",
484
+ "isExpression": false,
485
+ "asc": true,
486
+ "nulls": "last"
487
+ },
488
+ {
489
+ "expression": "started_at",
490
+ "isExpression": false,
491
+ "asc": true,
492
+ "nulls": "last"
493
+ }
494
+ ],
495
+ "isUnique": false,
496
+ "concurrently": false,
497
+ "method": "btree",
498
+ "with": {}
499
+ }
500
+ },
501
+ "foreignKeys": {
502
+ "agent_runs_installation_id_agent_installations_id_fk": {
503
+ "name": "agent_runs_installation_id_agent_installations_id_fk",
504
+ "tableFrom": "agent_runs",
505
+ "tableTo": "agent_installations",
506
+ "columnsFrom": [
507
+ "installation_id"
508
+ ],
509
+ "columnsTo": [
510
+ "id"
511
+ ],
512
+ "onDelete": "cascade",
513
+ "onUpdate": "no action"
514
+ },
515
+ "agent_runs_team_id_teams_id_fk": {
516
+ "name": "agent_runs_team_id_teams_id_fk",
517
+ "tableFrom": "agent_runs",
518
+ "tableTo": "teams",
519
+ "columnsFrom": [
520
+ "team_id"
521
+ ],
522
+ "columnsTo": [
523
+ "id"
524
+ ],
525
+ "onDelete": "cascade",
526
+ "onUpdate": "no action"
527
+ },
528
+ "agent_runs_project_id_projects_id_fk": {
529
+ "name": "agent_runs_project_id_projects_id_fk",
530
+ "tableFrom": "agent_runs",
531
+ "tableTo": "projects",
532
+ "columnsFrom": [
533
+ "project_id"
534
+ ],
535
+ "columnsTo": [
536
+ "id"
537
+ ],
538
+ "onDelete": "set null",
539
+ "onUpdate": "no action"
540
+ }
541
+ },
542
+ "compositePrimaryKeys": {},
543
+ "uniqueConstraints": {},
544
+ "policies": {},
545
+ "checkConstraints": {},
546
+ "isRLSEnabled": false
547
+ },
548
+ "public.debug_sessions": {
549
+ "name": "debug_sessions",
550
+ "schema": "",
551
+ "columns": {
552
+ "id": {
553
+ "name": "id",
554
+ "type": "uuid",
555
+ "primaryKey": true,
556
+ "notNull": true,
557
+ "default": "gen_random_uuid()"
558
+ },
559
+ "team_id": {
560
+ "name": "team_id",
561
+ "type": "uuid",
562
+ "primaryKey": false,
563
+ "notNull": true
564
+ },
565
+ "project_id": {
566
+ "name": "project_id",
567
+ "type": "uuid",
568
+ "primaryKey": false,
569
+ "notNull": false
570
+ },
571
+ "kind": {
572
+ "name": "kind",
573
+ "type": "text",
574
+ "primaryKey": false,
575
+ "notNull": true,
576
+ "default": "'debug'"
577
+ },
578
+ "title": {
579
+ "name": "title",
580
+ "type": "text",
581
+ "primaryKey": false,
582
+ "notNull": true
583
+ },
584
+ "status": {
585
+ "name": "status",
586
+ "type": "text",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "default": "'open'"
590
+ },
591
+ "opened_by": {
592
+ "name": "opened_by",
593
+ "type": "uuid",
594
+ "primaryKey": false,
595
+ "notNull": false
596
+ },
597
+ "context": {
598
+ "name": "context",
599
+ "type": "jsonb",
600
+ "primaryKey": false,
601
+ "notNull": false
602
+ },
603
+ "resolution": {
604
+ "name": "resolution",
605
+ "type": "jsonb",
606
+ "primaryKey": false,
607
+ "notNull": false
608
+ },
609
+ "created_at": {
610
+ "name": "created_at",
611
+ "type": "timestamp with time zone",
612
+ "primaryKey": false,
613
+ "notNull": true,
614
+ "default": "now()"
615
+ },
616
+ "resolved_at": {
617
+ "name": "resolved_at",
618
+ "type": "timestamp with time zone",
619
+ "primaryKey": false,
620
+ "notNull": false
621
+ }
622
+ },
623
+ "indexes": {},
624
+ "foreignKeys": {
625
+ "debug_sessions_team_id_teams_id_fk": {
626
+ "name": "debug_sessions_team_id_teams_id_fk",
627
+ "tableFrom": "debug_sessions",
628
+ "tableTo": "teams",
629
+ "columnsFrom": [
630
+ "team_id"
631
+ ],
632
+ "columnsTo": [
633
+ "id"
634
+ ],
635
+ "onDelete": "cascade",
636
+ "onUpdate": "no action"
637
+ },
638
+ "debug_sessions_project_id_projects_id_fk": {
639
+ "name": "debug_sessions_project_id_projects_id_fk",
640
+ "tableFrom": "debug_sessions",
641
+ "tableTo": "projects",
642
+ "columnsFrom": [
643
+ "project_id"
644
+ ],
645
+ "columnsTo": [
646
+ "id"
647
+ ],
648
+ "onDelete": "set null",
649
+ "onUpdate": "no action"
650
+ },
651
+ "debug_sessions_opened_by_users_id_fk": {
652
+ "name": "debug_sessions_opened_by_users_id_fk",
653
+ "tableFrom": "debug_sessions",
654
+ "tableTo": "users",
655
+ "columnsFrom": [
656
+ "opened_by"
657
+ ],
658
+ "columnsTo": [
659
+ "id"
660
+ ],
661
+ "onDelete": "no action",
662
+ "onUpdate": "no action"
663
+ }
664
+ },
665
+ "compositePrimaryKeys": {},
666
+ "uniqueConstraints": {},
667
+ "policies": {},
668
+ "checkConstraints": {},
669
+ "isRLSEnabled": false
670
+ },
671
+ "public.environment_baselines": {
672
+ "name": "environment_baselines",
673
+ "schema": "",
674
+ "columns": {
675
+ "id": {
676
+ "name": "id",
677
+ "type": "uuid",
678
+ "primaryKey": true,
679
+ "notNull": true,
680
+ "default": "gen_random_uuid()"
681
+ },
682
+ "team_id": {
683
+ "name": "team_id",
684
+ "type": "uuid",
685
+ "primaryKey": false,
686
+ "notNull": true
687
+ },
688
+ "project_id": {
689
+ "name": "project_id",
690
+ "type": "uuid",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "data": {
695
+ "name": "data",
696
+ "type": "jsonb",
697
+ "primaryKey": false,
698
+ "notNull": true
699
+ },
700
+ "fingerprint": {
701
+ "name": "fingerprint",
702
+ "type": "text",
703
+ "primaryKey": false,
704
+ "notNull": true
705
+ },
706
+ "active": {
707
+ "name": "active",
708
+ "type": "boolean",
709
+ "primaryKey": false,
710
+ "notNull": true,
711
+ "default": true
712
+ },
713
+ "created_by": {
714
+ "name": "created_by",
715
+ "type": "uuid",
716
+ "primaryKey": false,
717
+ "notNull": false
718
+ },
719
+ "created_at": {
720
+ "name": "created_at",
721
+ "type": "timestamp with time zone",
722
+ "primaryKey": false,
723
+ "notNull": true,
724
+ "default": "now()"
725
+ }
726
+ },
727
+ "indexes": {
728
+ "environment_baselines_project_active": {
729
+ "name": "environment_baselines_project_active",
730
+ "columns": [
731
+ {
732
+ "expression": "project_id",
733
+ "isExpression": false,
734
+ "asc": true,
735
+ "nulls": "last"
736
+ },
737
+ {
738
+ "expression": "active",
739
+ "isExpression": false,
740
+ "asc": true,
741
+ "nulls": "last"
742
+ },
743
+ {
744
+ "expression": "created_at",
745
+ "isExpression": false,
746
+ "asc": true,
747
+ "nulls": "last"
748
+ }
749
+ ],
750
+ "isUnique": false,
751
+ "concurrently": false,
752
+ "method": "btree",
753
+ "with": {}
754
+ }
755
+ },
756
+ "foreignKeys": {
757
+ "environment_baselines_team_id_teams_id_fk": {
758
+ "name": "environment_baselines_team_id_teams_id_fk",
759
+ "tableFrom": "environment_baselines",
760
+ "tableTo": "teams",
761
+ "columnsFrom": [
762
+ "team_id"
763
+ ],
764
+ "columnsTo": [
765
+ "id"
766
+ ],
767
+ "onDelete": "cascade",
768
+ "onUpdate": "no action"
769
+ },
770
+ "environment_baselines_project_id_projects_id_fk": {
771
+ "name": "environment_baselines_project_id_projects_id_fk",
772
+ "tableFrom": "environment_baselines",
773
+ "tableTo": "projects",
774
+ "columnsFrom": [
775
+ "project_id"
776
+ ],
777
+ "columnsTo": [
778
+ "id"
779
+ ],
780
+ "onDelete": "cascade",
781
+ "onUpdate": "no action"
782
+ },
783
+ "environment_baselines_created_by_users_id_fk": {
784
+ "name": "environment_baselines_created_by_users_id_fk",
785
+ "tableFrom": "environment_baselines",
786
+ "tableTo": "users",
787
+ "columnsFrom": [
788
+ "created_by"
789
+ ],
790
+ "columnsTo": [
791
+ "id"
792
+ ],
793
+ "onDelete": "set null",
794
+ "onUpdate": "no action"
795
+ }
796
+ },
797
+ "compositePrimaryKeys": {},
798
+ "uniqueConstraints": {},
799
+ "policies": {},
800
+ "checkConstraints": {},
801
+ "isRLSEnabled": false
802
+ },
803
+ "public.invites": {
804
+ "name": "invites",
805
+ "schema": "",
806
+ "columns": {
807
+ "id": {
808
+ "name": "id",
809
+ "type": "uuid",
810
+ "primaryKey": true,
811
+ "notNull": true,
812
+ "default": "gen_random_uuid()"
813
+ },
814
+ "team_id": {
815
+ "name": "team_id",
816
+ "type": "uuid",
817
+ "primaryKey": false,
818
+ "notNull": true
819
+ },
820
+ "code": {
821
+ "name": "code",
822
+ "type": "text",
823
+ "primaryKey": false,
824
+ "notNull": true
825
+ },
826
+ "created_by": {
827
+ "name": "created_by",
828
+ "type": "uuid",
829
+ "primaryKey": false,
830
+ "notNull": false
831
+ },
832
+ "expires_at": {
833
+ "name": "expires_at",
834
+ "type": "timestamp with time zone",
835
+ "primaryKey": false,
836
+ "notNull": true
837
+ },
838
+ "uses": {
839
+ "name": "uses",
840
+ "type": "integer",
841
+ "primaryKey": false,
842
+ "notNull": true,
843
+ "default": 0
844
+ },
845
+ "max_uses": {
846
+ "name": "max_uses",
847
+ "type": "integer",
848
+ "primaryKey": false,
849
+ "notNull": false
850
+ },
851
+ "created_at": {
852
+ "name": "created_at",
853
+ "type": "timestamp with time zone",
854
+ "primaryKey": false,
855
+ "notNull": true,
856
+ "default": "now()"
857
+ }
858
+ },
859
+ "indexes": {},
860
+ "foreignKeys": {
861
+ "invites_team_id_teams_id_fk": {
862
+ "name": "invites_team_id_teams_id_fk",
863
+ "tableFrom": "invites",
864
+ "tableTo": "teams",
865
+ "columnsFrom": [
866
+ "team_id"
867
+ ],
868
+ "columnsTo": [
869
+ "id"
870
+ ],
871
+ "onDelete": "cascade",
872
+ "onUpdate": "no action"
873
+ },
874
+ "invites_created_by_users_id_fk": {
875
+ "name": "invites_created_by_users_id_fk",
876
+ "tableFrom": "invites",
877
+ "tableTo": "users",
878
+ "columnsFrom": [
879
+ "created_by"
880
+ ],
881
+ "columnsTo": [
882
+ "id"
883
+ ],
884
+ "onDelete": "no action",
885
+ "onUpdate": "no action"
886
+ }
887
+ },
888
+ "compositePrimaryKeys": {},
889
+ "uniqueConstraints": {
890
+ "invites_code_unique": {
891
+ "name": "invites_code_unique",
892
+ "nullsNotDistinct": false,
893
+ "columns": [
894
+ "code"
895
+ ]
896
+ }
897
+ },
898
+ "policies": {},
899
+ "checkConstraints": {},
900
+ "isRLSEnabled": false
901
+ },
902
+ "public.memberships": {
903
+ "name": "memberships",
904
+ "schema": "",
905
+ "columns": {
906
+ "team_id": {
907
+ "name": "team_id",
908
+ "type": "uuid",
909
+ "primaryKey": false,
910
+ "notNull": true
911
+ },
912
+ "user_id": {
913
+ "name": "user_id",
914
+ "type": "uuid",
915
+ "primaryKey": false,
916
+ "notNull": true
917
+ },
918
+ "role": {
919
+ "name": "role",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "default": "'member'"
924
+ },
925
+ "created_at": {
926
+ "name": "created_at",
927
+ "type": "timestamp with time zone",
928
+ "primaryKey": false,
929
+ "notNull": true,
930
+ "default": "now()"
931
+ }
932
+ },
933
+ "indexes": {},
934
+ "foreignKeys": {
935
+ "memberships_team_id_teams_id_fk": {
936
+ "name": "memberships_team_id_teams_id_fk",
937
+ "tableFrom": "memberships",
938
+ "tableTo": "teams",
939
+ "columnsFrom": [
940
+ "team_id"
941
+ ],
942
+ "columnsTo": [
943
+ "id"
944
+ ],
945
+ "onDelete": "cascade",
946
+ "onUpdate": "no action"
947
+ },
948
+ "memberships_user_id_users_id_fk": {
949
+ "name": "memberships_user_id_users_id_fk",
950
+ "tableFrom": "memberships",
951
+ "tableTo": "users",
952
+ "columnsFrom": [
953
+ "user_id"
954
+ ],
955
+ "columnsTo": [
956
+ "id"
957
+ ],
958
+ "onDelete": "cascade",
959
+ "onUpdate": "no action"
960
+ }
961
+ },
962
+ "compositePrimaryKeys": {
963
+ "memberships_team_id_user_id_pk": {
964
+ "name": "memberships_team_id_user_id_pk",
965
+ "columns": [
966
+ "team_id",
967
+ "user_id"
968
+ ]
969
+ }
970
+ },
971
+ "uniqueConstraints": {},
972
+ "policies": {},
973
+ "checkConstraints": {},
974
+ "isRLSEnabled": false
975
+ },
976
+ "public.messages": {
977
+ "name": "messages",
978
+ "schema": "",
979
+ "columns": {
980
+ "id": {
981
+ "name": "id",
982
+ "type": "uuid",
983
+ "primaryKey": true,
984
+ "notNull": true,
985
+ "default": "gen_random_uuid()"
986
+ },
987
+ "session_id": {
988
+ "name": "session_id",
989
+ "type": "uuid",
990
+ "primaryKey": false,
991
+ "notNull": true
992
+ },
993
+ "author_id": {
994
+ "name": "author_id",
995
+ "type": "uuid",
996
+ "primaryKey": false,
997
+ "notNull": false
998
+ },
999
+ "token_id": {
1000
+ "name": "token_id",
1001
+ "type": "uuid",
1002
+ "primaryKey": false,
1003
+ "notNull": false
1004
+ },
1005
+ "kind": {
1006
+ "name": "kind",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": true,
1010
+ "default": "'note'"
1011
+ },
1012
+ "via": {
1013
+ "name": "via",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": false
1017
+ },
1018
+ "body": {
1019
+ "name": "body",
1020
+ "type": "text",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ },
1024
+ "attachments": {
1025
+ "name": "attachments",
1026
+ "type": "jsonb",
1027
+ "primaryKey": false,
1028
+ "notNull": false
1029
+ },
1030
+ "created_at": {
1031
+ "name": "created_at",
1032
+ "type": "timestamp with time zone",
1033
+ "primaryKey": false,
1034
+ "notNull": true,
1035
+ "default": "now()"
1036
+ }
1037
+ },
1038
+ "indexes": {
1039
+ "messages_session_created": {
1040
+ "name": "messages_session_created",
1041
+ "columns": [
1042
+ {
1043
+ "expression": "session_id",
1044
+ "isExpression": false,
1045
+ "asc": true,
1046
+ "nulls": "last"
1047
+ },
1048
+ {
1049
+ "expression": "created_at",
1050
+ "isExpression": false,
1051
+ "asc": true,
1052
+ "nulls": "last"
1053
+ }
1054
+ ],
1055
+ "isUnique": false,
1056
+ "concurrently": false,
1057
+ "method": "btree",
1058
+ "with": {}
1059
+ }
1060
+ },
1061
+ "foreignKeys": {
1062
+ "messages_session_id_debug_sessions_id_fk": {
1063
+ "name": "messages_session_id_debug_sessions_id_fk",
1064
+ "tableFrom": "messages",
1065
+ "tableTo": "debug_sessions",
1066
+ "columnsFrom": [
1067
+ "session_id"
1068
+ ],
1069
+ "columnsTo": [
1070
+ "id"
1071
+ ],
1072
+ "onDelete": "cascade",
1073
+ "onUpdate": "no action"
1074
+ },
1075
+ "messages_author_id_users_id_fk": {
1076
+ "name": "messages_author_id_users_id_fk",
1077
+ "tableFrom": "messages",
1078
+ "tableTo": "users",
1079
+ "columnsFrom": [
1080
+ "author_id"
1081
+ ],
1082
+ "columnsTo": [
1083
+ "id"
1084
+ ],
1085
+ "onDelete": "no action",
1086
+ "onUpdate": "no action"
1087
+ },
1088
+ "messages_token_id_tokens_id_fk": {
1089
+ "name": "messages_token_id_tokens_id_fk",
1090
+ "tableFrom": "messages",
1091
+ "tableTo": "tokens",
1092
+ "columnsFrom": [
1093
+ "token_id"
1094
+ ],
1095
+ "columnsTo": [
1096
+ "id"
1097
+ ],
1098
+ "onDelete": "set null",
1099
+ "onUpdate": "no action"
1100
+ }
1101
+ },
1102
+ "compositePrimaryKeys": {},
1103
+ "uniqueConstraints": {},
1104
+ "policies": {},
1105
+ "checkConstraints": {},
1106
+ "isRLSEnabled": false
1107
+ },
1108
+ "public.policy_bundles": {
1109
+ "name": "policy_bundles",
1110
+ "schema": "",
1111
+ "columns": {
1112
+ "id": {
1113
+ "name": "id",
1114
+ "type": "uuid",
1115
+ "primaryKey": true,
1116
+ "notNull": true,
1117
+ "default": "gen_random_uuid()"
1118
+ },
1119
+ "team_id": {
1120
+ "name": "team_id",
1121
+ "type": "uuid",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "project_id": {
1126
+ "name": "project_id",
1127
+ "type": "uuid",
1128
+ "primaryKey": false,
1129
+ "notNull": false
1130
+ },
1131
+ "scope_key": {
1132
+ "name": "scope_key",
1133
+ "type": "text",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "version": {
1138
+ "name": "version",
1139
+ "type": "integer",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "status": {
1144
+ "name": "status",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": true,
1148
+ "default": "'active'"
1149
+ },
1150
+ "document": {
1151
+ "name": "document",
1152
+ "type": "jsonb",
1153
+ "primaryKey": false,
1154
+ "notNull": true
1155
+ },
1156
+ "hash": {
1157
+ "name": "hash",
1158
+ "type": "text",
1159
+ "primaryKey": false,
1160
+ "notNull": true
1161
+ },
1162
+ "created_by": {
1163
+ "name": "created_by",
1164
+ "type": "uuid",
1165
+ "primaryKey": false,
1166
+ "notNull": false
1167
+ },
1168
+ "created_at": {
1169
+ "name": "created_at",
1170
+ "type": "timestamp with time zone",
1171
+ "primaryKey": false,
1172
+ "notNull": true,
1173
+ "default": "now()"
1174
+ }
1175
+ },
1176
+ "indexes": {
1177
+ "policy_bundles_team_scope_version": {
1178
+ "name": "policy_bundles_team_scope_version",
1179
+ "columns": [
1180
+ {
1181
+ "expression": "team_id",
1182
+ "isExpression": false,
1183
+ "asc": true,
1184
+ "nulls": "last"
1185
+ },
1186
+ {
1187
+ "expression": "scope_key",
1188
+ "isExpression": false,
1189
+ "asc": true,
1190
+ "nulls": "last"
1191
+ },
1192
+ {
1193
+ "expression": "version",
1194
+ "isExpression": false,
1195
+ "asc": true,
1196
+ "nulls": "last"
1197
+ }
1198
+ ],
1199
+ "isUnique": true,
1200
+ "concurrently": false,
1201
+ "method": "btree",
1202
+ "with": {}
1203
+ }
1204
+ },
1205
+ "foreignKeys": {
1206
+ "policy_bundles_team_id_teams_id_fk": {
1207
+ "name": "policy_bundles_team_id_teams_id_fk",
1208
+ "tableFrom": "policy_bundles",
1209
+ "tableTo": "teams",
1210
+ "columnsFrom": [
1211
+ "team_id"
1212
+ ],
1213
+ "columnsTo": [
1214
+ "id"
1215
+ ],
1216
+ "onDelete": "cascade",
1217
+ "onUpdate": "no action"
1218
+ },
1219
+ "policy_bundles_project_id_projects_id_fk": {
1220
+ "name": "policy_bundles_project_id_projects_id_fk",
1221
+ "tableFrom": "policy_bundles",
1222
+ "tableTo": "projects",
1223
+ "columnsFrom": [
1224
+ "project_id"
1225
+ ],
1226
+ "columnsTo": [
1227
+ "id"
1228
+ ],
1229
+ "onDelete": "cascade",
1230
+ "onUpdate": "no action"
1231
+ },
1232
+ "policy_bundles_created_by_users_id_fk": {
1233
+ "name": "policy_bundles_created_by_users_id_fk",
1234
+ "tableFrom": "policy_bundles",
1235
+ "tableTo": "users",
1236
+ "columnsFrom": [
1237
+ "created_by"
1238
+ ],
1239
+ "columnsTo": [
1240
+ "id"
1241
+ ],
1242
+ "onDelete": "set null",
1243
+ "onUpdate": "no action"
1244
+ }
1245
+ },
1246
+ "compositePrimaryKeys": {},
1247
+ "uniqueConstraints": {},
1248
+ "policies": {},
1249
+ "checkConstraints": {},
1250
+ "isRLSEnabled": false
1251
+ },
1252
+ "public.policy_receipts": {
1253
+ "name": "policy_receipts",
1254
+ "schema": "",
1255
+ "columns": {
1256
+ "run_id": {
1257
+ "name": "run_id",
1258
+ "type": "uuid",
1259
+ "primaryKey": true,
1260
+ "notNull": true
1261
+ },
1262
+ "expected_hash": {
1263
+ "name": "expected_hash",
1264
+ "type": "text",
1265
+ "primaryKey": false,
1266
+ "notNull": true
1267
+ },
1268
+ "reported_hash": {
1269
+ "name": "reported_hash",
1270
+ "type": "text",
1271
+ "primaryKey": false,
1272
+ "notNull": false
1273
+ },
1274
+ "drift": {
1275
+ "name": "drift",
1276
+ "type": "boolean",
1277
+ "primaryKey": false,
1278
+ "notNull": true,
1279
+ "default": false
1280
+ },
1281
+ "created_at": {
1282
+ "name": "created_at",
1283
+ "type": "timestamp with time zone",
1284
+ "primaryKey": false,
1285
+ "notNull": true,
1286
+ "default": "now()"
1287
+ }
1288
+ },
1289
+ "indexes": {},
1290
+ "foreignKeys": {
1291
+ "policy_receipts_run_id_agent_runs_id_fk": {
1292
+ "name": "policy_receipts_run_id_agent_runs_id_fk",
1293
+ "tableFrom": "policy_receipts",
1294
+ "tableTo": "agent_runs",
1295
+ "columnsFrom": [
1296
+ "run_id"
1297
+ ],
1298
+ "columnsTo": [
1299
+ "id"
1300
+ ],
1301
+ "onDelete": "cascade",
1302
+ "onUpdate": "no action"
1303
+ }
1304
+ },
1305
+ "compositePrimaryKeys": {},
1306
+ "uniqueConstraints": {},
1307
+ "policies": {},
1308
+ "checkConstraints": {},
1309
+ "isRLSEnabled": false
1310
+ },
1311
+ "public.projects": {
1312
+ "name": "projects",
1313
+ "schema": "",
1314
+ "columns": {
1315
+ "id": {
1316
+ "name": "id",
1317
+ "type": "uuid",
1318
+ "primaryKey": true,
1319
+ "notNull": true,
1320
+ "default": "gen_random_uuid()"
1321
+ },
1322
+ "team_id": {
1323
+ "name": "team_id",
1324
+ "type": "uuid",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "name": {
1329
+ "name": "name",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true
1333
+ },
1334
+ "slug": {
1335
+ "name": "slug",
1336
+ "type": "text",
1337
+ "primaryKey": false,
1338
+ "notNull": true
1339
+ },
1340
+ "created_by": {
1341
+ "name": "created_by",
1342
+ "type": "uuid",
1343
+ "primaryKey": false,
1344
+ "notNull": false
1345
+ },
1346
+ "created_at": {
1347
+ "name": "created_at",
1348
+ "type": "timestamp with time zone",
1349
+ "primaryKey": false,
1350
+ "notNull": true,
1351
+ "default": "now()"
1352
+ }
1353
+ },
1354
+ "indexes": {
1355
+ "projects_team_slug": {
1356
+ "name": "projects_team_slug",
1357
+ "columns": [
1358
+ {
1359
+ "expression": "team_id",
1360
+ "isExpression": false,
1361
+ "asc": true,
1362
+ "nulls": "last"
1363
+ },
1364
+ {
1365
+ "expression": "slug",
1366
+ "isExpression": false,
1367
+ "asc": true,
1368
+ "nulls": "last"
1369
+ }
1370
+ ],
1371
+ "isUnique": true,
1372
+ "concurrently": false,
1373
+ "method": "btree",
1374
+ "with": {}
1375
+ }
1376
+ },
1377
+ "foreignKeys": {
1378
+ "projects_team_id_teams_id_fk": {
1379
+ "name": "projects_team_id_teams_id_fk",
1380
+ "tableFrom": "projects",
1381
+ "tableTo": "teams",
1382
+ "columnsFrom": [
1383
+ "team_id"
1384
+ ],
1385
+ "columnsTo": [
1386
+ "id"
1387
+ ],
1388
+ "onDelete": "cascade",
1389
+ "onUpdate": "no action"
1390
+ },
1391
+ "projects_created_by_users_id_fk": {
1392
+ "name": "projects_created_by_users_id_fk",
1393
+ "tableFrom": "projects",
1394
+ "tableTo": "users",
1395
+ "columnsFrom": [
1396
+ "created_by"
1397
+ ],
1398
+ "columnsTo": [
1399
+ "id"
1400
+ ],
1401
+ "onDelete": "no action",
1402
+ "onUpdate": "no action"
1403
+ }
1404
+ },
1405
+ "compositePrimaryKeys": {},
1406
+ "uniqueConstraints": {},
1407
+ "policies": {},
1408
+ "checkConstraints": {},
1409
+ "isRLSEnabled": false
1410
+ },
1411
+ "public.read_state": {
1412
+ "name": "read_state",
1413
+ "schema": "",
1414
+ "columns": {
1415
+ "user_id": {
1416
+ "name": "user_id",
1417
+ "type": "uuid",
1418
+ "primaryKey": false,
1419
+ "notNull": true
1420
+ },
1421
+ "session_id": {
1422
+ "name": "session_id",
1423
+ "type": "uuid",
1424
+ "primaryKey": false,
1425
+ "notNull": true
1426
+ },
1427
+ "last_read_at": {
1428
+ "name": "last_read_at",
1429
+ "type": "timestamp with time zone",
1430
+ "primaryKey": false,
1431
+ "notNull": true,
1432
+ "default": "now()"
1433
+ }
1434
+ },
1435
+ "indexes": {},
1436
+ "foreignKeys": {
1437
+ "read_state_user_id_users_id_fk": {
1438
+ "name": "read_state_user_id_users_id_fk",
1439
+ "tableFrom": "read_state",
1440
+ "tableTo": "users",
1441
+ "columnsFrom": [
1442
+ "user_id"
1443
+ ],
1444
+ "columnsTo": [
1445
+ "id"
1446
+ ],
1447
+ "onDelete": "cascade",
1448
+ "onUpdate": "no action"
1449
+ },
1450
+ "read_state_session_id_debug_sessions_id_fk": {
1451
+ "name": "read_state_session_id_debug_sessions_id_fk",
1452
+ "tableFrom": "read_state",
1453
+ "tableTo": "debug_sessions",
1454
+ "columnsFrom": [
1455
+ "session_id"
1456
+ ],
1457
+ "columnsTo": [
1458
+ "id"
1459
+ ],
1460
+ "onDelete": "cascade",
1461
+ "onUpdate": "no action"
1462
+ }
1463
+ },
1464
+ "compositePrimaryKeys": {
1465
+ "read_state_user_id_session_id_pk": {
1466
+ "name": "read_state_user_id_session_id_pk",
1467
+ "columns": [
1468
+ "user_id",
1469
+ "session_id"
1470
+ ]
1471
+ }
1472
+ },
1473
+ "uniqueConstraints": {},
1474
+ "policies": {},
1475
+ "checkConstraints": {},
1476
+ "isRLSEnabled": false
1477
+ },
1478
+ "public.snapshots": {
1479
+ "name": "snapshots",
1480
+ "schema": "",
1481
+ "columns": {
1482
+ "id": {
1483
+ "name": "id",
1484
+ "type": "uuid",
1485
+ "primaryKey": true,
1486
+ "notNull": true,
1487
+ "default": "gen_random_uuid()"
1488
+ },
1489
+ "team_id": {
1490
+ "name": "team_id",
1491
+ "type": "uuid",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "user_id": {
1496
+ "name": "user_id",
1497
+ "type": "uuid",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ },
1501
+ "repo": {
1502
+ "name": "repo",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": false
1506
+ },
1507
+ "project_id": {
1508
+ "name": "project_id",
1509
+ "type": "uuid",
1510
+ "primaryKey": false,
1511
+ "notNull": false
1512
+ },
1513
+ "token_id": {
1514
+ "name": "token_id",
1515
+ "type": "uuid",
1516
+ "primaryKey": false,
1517
+ "notNull": false
1518
+ },
1519
+ "data": {
1520
+ "name": "data",
1521
+ "type": "jsonb",
1522
+ "primaryKey": false,
1523
+ "notNull": true
1524
+ },
1525
+ "created_at": {
1526
+ "name": "created_at",
1527
+ "type": "timestamp with time zone",
1528
+ "primaryKey": false,
1529
+ "notNull": true,
1530
+ "default": "now()"
1531
+ }
1532
+ },
1533
+ "indexes": {
1534
+ "snapshots_team_user_created": {
1535
+ "name": "snapshots_team_user_created",
1536
+ "columns": [
1537
+ {
1538
+ "expression": "team_id",
1539
+ "isExpression": false,
1540
+ "asc": true,
1541
+ "nulls": "last"
1542
+ },
1543
+ {
1544
+ "expression": "user_id",
1545
+ "isExpression": false,
1546
+ "asc": true,
1547
+ "nulls": "last"
1548
+ },
1549
+ {
1550
+ "expression": "created_at",
1551
+ "isExpression": false,
1552
+ "asc": true,
1553
+ "nulls": "last"
1554
+ }
1555
+ ],
1556
+ "isUnique": false,
1557
+ "concurrently": false,
1558
+ "method": "btree",
1559
+ "with": {}
1560
+ }
1561
+ },
1562
+ "foreignKeys": {
1563
+ "snapshots_team_id_teams_id_fk": {
1564
+ "name": "snapshots_team_id_teams_id_fk",
1565
+ "tableFrom": "snapshots",
1566
+ "tableTo": "teams",
1567
+ "columnsFrom": [
1568
+ "team_id"
1569
+ ],
1570
+ "columnsTo": [
1571
+ "id"
1572
+ ],
1573
+ "onDelete": "cascade",
1574
+ "onUpdate": "no action"
1575
+ },
1576
+ "snapshots_user_id_users_id_fk": {
1577
+ "name": "snapshots_user_id_users_id_fk",
1578
+ "tableFrom": "snapshots",
1579
+ "tableTo": "users",
1580
+ "columnsFrom": [
1581
+ "user_id"
1582
+ ],
1583
+ "columnsTo": [
1584
+ "id"
1585
+ ],
1586
+ "onDelete": "cascade",
1587
+ "onUpdate": "no action"
1588
+ },
1589
+ "snapshots_project_id_projects_id_fk": {
1590
+ "name": "snapshots_project_id_projects_id_fk",
1591
+ "tableFrom": "snapshots",
1592
+ "tableTo": "projects",
1593
+ "columnsFrom": [
1594
+ "project_id"
1595
+ ],
1596
+ "columnsTo": [
1597
+ "id"
1598
+ ],
1599
+ "onDelete": "cascade",
1600
+ "onUpdate": "no action"
1601
+ },
1602
+ "snapshots_token_id_tokens_id_fk": {
1603
+ "name": "snapshots_token_id_tokens_id_fk",
1604
+ "tableFrom": "snapshots",
1605
+ "tableTo": "tokens",
1606
+ "columnsFrom": [
1607
+ "token_id"
1608
+ ],
1609
+ "columnsTo": [
1610
+ "id"
1611
+ ],
1612
+ "onDelete": "set null",
1613
+ "onUpdate": "no action"
1614
+ }
1615
+ },
1616
+ "compositePrimaryKeys": {},
1617
+ "uniqueConstraints": {},
1618
+ "policies": {},
1619
+ "checkConstraints": {},
1620
+ "isRLSEnabled": false
1621
+ },
1622
+ "public.teams": {
1623
+ "name": "teams",
1624
+ "schema": "",
1625
+ "columns": {
1626
+ "id": {
1627
+ "name": "id",
1628
+ "type": "uuid",
1629
+ "primaryKey": true,
1630
+ "notNull": true,
1631
+ "default": "gen_random_uuid()"
1632
+ },
1633
+ "name": {
1634
+ "name": "name",
1635
+ "type": "text",
1636
+ "primaryKey": false,
1637
+ "notNull": true
1638
+ },
1639
+ "slug": {
1640
+ "name": "slug",
1641
+ "type": "text",
1642
+ "primaryKey": false,
1643
+ "notNull": true
1644
+ },
1645
+ "created_by": {
1646
+ "name": "created_by",
1647
+ "type": "uuid",
1648
+ "primaryKey": false,
1649
+ "notNull": false
1650
+ },
1651
+ "webhook_url": {
1652
+ "name": "webhook_url",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": false
1656
+ },
1657
+ "plan": {
1658
+ "name": "plan",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true,
1662
+ "default": "'free'"
1663
+ },
1664
+ "inbound_token": {
1665
+ "name": "inbound_token",
1666
+ "type": "text",
1667
+ "primaryKey": false,
1668
+ "notNull": false
1669
+ },
1670
+ "created_at": {
1671
+ "name": "created_at",
1672
+ "type": "timestamp with time zone",
1673
+ "primaryKey": false,
1674
+ "notNull": true,
1675
+ "default": "now()"
1676
+ }
1677
+ },
1678
+ "indexes": {},
1679
+ "foreignKeys": {
1680
+ "teams_created_by_users_id_fk": {
1681
+ "name": "teams_created_by_users_id_fk",
1682
+ "tableFrom": "teams",
1683
+ "tableTo": "users",
1684
+ "columnsFrom": [
1685
+ "created_by"
1686
+ ],
1687
+ "columnsTo": [
1688
+ "id"
1689
+ ],
1690
+ "onDelete": "no action",
1691
+ "onUpdate": "no action"
1692
+ }
1693
+ },
1694
+ "compositePrimaryKeys": {},
1695
+ "uniqueConstraints": {
1696
+ "teams_slug_unique": {
1697
+ "name": "teams_slug_unique",
1698
+ "nullsNotDistinct": false,
1699
+ "columns": [
1700
+ "slug"
1701
+ ]
1702
+ },
1703
+ "teams_inbound_token_unique": {
1704
+ "name": "teams_inbound_token_unique",
1705
+ "nullsNotDistinct": false,
1706
+ "columns": [
1707
+ "inbound_token"
1708
+ ]
1709
+ }
1710
+ },
1711
+ "policies": {},
1712
+ "checkConstraints": {},
1713
+ "isRLSEnabled": false
1714
+ },
1715
+ "public.tokens": {
1716
+ "name": "tokens",
1717
+ "schema": "",
1718
+ "columns": {
1719
+ "id": {
1720
+ "name": "id",
1721
+ "type": "uuid",
1722
+ "primaryKey": true,
1723
+ "notNull": true,
1724
+ "default": "gen_random_uuid()"
1725
+ },
1726
+ "user_id": {
1727
+ "name": "user_id",
1728
+ "type": "uuid",
1729
+ "primaryKey": false,
1730
+ "notNull": true
1731
+ },
1732
+ "name": {
1733
+ "name": "name",
1734
+ "type": "text",
1735
+ "primaryKey": false,
1736
+ "notNull": true
1737
+ },
1738
+ "token_hash": {
1739
+ "name": "token_hash",
1740
+ "type": "text",
1741
+ "primaryKey": false,
1742
+ "notNull": true
1743
+ },
1744
+ "prefix": {
1745
+ "name": "prefix",
1746
+ "type": "text",
1747
+ "primaryKey": false,
1748
+ "notNull": true
1749
+ },
1750
+ "last_used_at": {
1751
+ "name": "last_used_at",
1752
+ "type": "timestamp with time zone",
1753
+ "primaryKey": false,
1754
+ "notNull": false
1755
+ },
1756
+ "revoked_at": {
1757
+ "name": "revoked_at",
1758
+ "type": "timestamp with time zone",
1759
+ "primaryKey": false,
1760
+ "notNull": false
1761
+ },
1762
+ "created_at": {
1763
+ "name": "created_at",
1764
+ "type": "timestamp with time zone",
1765
+ "primaryKey": false,
1766
+ "notNull": true,
1767
+ "default": "now()"
1768
+ }
1769
+ },
1770
+ "indexes": {},
1771
+ "foreignKeys": {
1772
+ "tokens_user_id_users_id_fk": {
1773
+ "name": "tokens_user_id_users_id_fk",
1774
+ "tableFrom": "tokens",
1775
+ "tableTo": "users",
1776
+ "columnsFrom": [
1777
+ "user_id"
1778
+ ],
1779
+ "columnsTo": [
1780
+ "id"
1781
+ ],
1782
+ "onDelete": "cascade",
1783
+ "onUpdate": "no action"
1784
+ }
1785
+ },
1786
+ "compositePrimaryKeys": {},
1787
+ "uniqueConstraints": {
1788
+ "tokens_token_hash_unique": {
1789
+ "name": "tokens_token_hash_unique",
1790
+ "nullsNotDistinct": false,
1791
+ "columns": [
1792
+ "token_hash"
1793
+ ]
1794
+ }
1795
+ },
1796
+ "policies": {},
1797
+ "checkConstraints": {},
1798
+ "isRLSEnabled": false
1799
+ },
1800
+ "public.users": {
1801
+ "name": "users",
1802
+ "schema": "",
1803
+ "columns": {
1804
+ "id": {
1805
+ "name": "id",
1806
+ "type": "uuid",
1807
+ "primaryKey": true,
1808
+ "notNull": true,
1809
+ "default": "gen_random_uuid()"
1810
+ },
1811
+ "github_id": {
1812
+ "name": "github_id",
1813
+ "type": "bigint",
1814
+ "primaryKey": false,
1815
+ "notNull": false
1816
+ },
1817
+ "username": {
1818
+ "name": "username",
1819
+ "type": "text",
1820
+ "primaryKey": false,
1821
+ "notNull": true
1822
+ },
1823
+ "password_hash": {
1824
+ "name": "password_hash",
1825
+ "type": "text",
1826
+ "primaryKey": false,
1827
+ "notNull": false
1828
+ },
1829
+ "display_name": {
1830
+ "name": "display_name",
1831
+ "type": "text",
1832
+ "primaryKey": false,
1833
+ "notNull": false
1834
+ },
1835
+ "email": {
1836
+ "name": "email",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": false
1840
+ },
1841
+ "avatar_url": {
1842
+ "name": "avatar_url",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": false
1846
+ },
1847
+ "created_at": {
1848
+ "name": "created_at",
1849
+ "type": "timestamp with time zone",
1850
+ "primaryKey": false,
1851
+ "notNull": true,
1852
+ "default": "now()"
1853
+ }
1854
+ },
1855
+ "indexes": {},
1856
+ "foreignKeys": {},
1857
+ "compositePrimaryKeys": {},
1858
+ "uniqueConstraints": {
1859
+ "users_github_id_unique": {
1860
+ "name": "users_github_id_unique",
1861
+ "nullsNotDistinct": false,
1862
+ "columns": [
1863
+ "github_id"
1864
+ ]
1865
+ },
1866
+ "users_username_unique": {
1867
+ "name": "users_username_unique",
1868
+ "nullsNotDistinct": false,
1869
+ "columns": [
1870
+ "username"
1871
+ ]
1872
+ }
1873
+ },
1874
+ "policies": {},
1875
+ "checkConstraints": {},
1876
+ "isRLSEnabled": false
1877
+ },
1878
+ "public.web_sessions": {
1879
+ "name": "web_sessions",
1880
+ "schema": "",
1881
+ "columns": {
1882
+ "id": {
1883
+ "name": "id",
1884
+ "type": "text",
1885
+ "primaryKey": true,
1886
+ "notNull": true
1887
+ },
1888
+ "user_id": {
1889
+ "name": "user_id",
1890
+ "type": "uuid",
1891
+ "primaryKey": false,
1892
+ "notNull": true
1893
+ },
1894
+ "expires_at": {
1895
+ "name": "expires_at",
1896
+ "type": "timestamp with time zone",
1897
+ "primaryKey": false,
1898
+ "notNull": true
1899
+ },
1900
+ "created_at": {
1901
+ "name": "created_at",
1902
+ "type": "timestamp with time zone",
1903
+ "primaryKey": false,
1904
+ "notNull": true,
1905
+ "default": "now()"
1906
+ }
1907
+ },
1908
+ "indexes": {},
1909
+ "foreignKeys": {
1910
+ "web_sessions_user_id_users_id_fk": {
1911
+ "name": "web_sessions_user_id_users_id_fk",
1912
+ "tableFrom": "web_sessions",
1913
+ "tableTo": "users",
1914
+ "columnsFrom": [
1915
+ "user_id"
1916
+ ],
1917
+ "columnsTo": [
1918
+ "id"
1919
+ ],
1920
+ "onDelete": "cascade",
1921
+ "onUpdate": "no action"
1922
+ }
1923
+ },
1924
+ "compositePrimaryKeys": {},
1925
+ "uniqueConstraints": {},
1926
+ "policies": {},
1927
+ "checkConstraints": {},
1928
+ "isRLSEnabled": false
1929
+ },
1930
+ "public.work_claims": {
1931
+ "name": "work_claims",
1932
+ "schema": "",
1933
+ "columns": {
1934
+ "id": {
1935
+ "name": "id",
1936
+ "type": "uuid",
1937
+ "primaryKey": true,
1938
+ "notNull": true,
1939
+ "default": "gen_random_uuid()"
1940
+ },
1941
+ "run_id": {
1942
+ "name": "run_id",
1943
+ "type": "uuid",
1944
+ "primaryKey": false,
1945
+ "notNull": true
1946
+ },
1947
+ "resource_type": {
1948
+ "name": "resource_type",
1949
+ "type": "text",
1950
+ "primaryKey": false,
1951
+ "notNull": true
1952
+ },
1953
+ "resource_key": {
1954
+ "name": "resource_key",
1955
+ "type": "text",
1956
+ "primaryKey": false,
1957
+ "notNull": true
1958
+ },
1959
+ "access": {
1960
+ "name": "access",
1961
+ "type": "text",
1962
+ "primaryKey": false,
1963
+ "notNull": true,
1964
+ "default": "'write'"
1965
+ },
1966
+ "lease_expires_at": {
1967
+ "name": "lease_expires_at",
1968
+ "type": "timestamp with time zone",
1969
+ "primaryKey": false,
1970
+ "notNull": true
1971
+ },
1972
+ "created_at": {
1973
+ "name": "created_at",
1974
+ "type": "timestamp with time zone",
1975
+ "primaryKey": false,
1976
+ "notNull": true,
1977
+ "default": "now()"
1978
+ }
1979
+ },
1980
+ "indexes": {
1981
+ "work_claims_run_resource": {
1982
+ "name": "work_claims_run_resource",
1983
+ "columns": [
1984
+ {
1985
+ "expression": "run_id",
1986
+ "isExpression": false,
1987
+ "asc": true,
1988
+ "nulls": "last"
1989
+ },
1990
+ {
1991
+ "expression": "resource_type",
1992
+ "isExpression": false,
1993
+ "asc": true,
1994
+ "nulls": "last"
1995
+ },
1996
+ {
1997
+ "expression": "resource_key",
1998
+ "isExpression": false,
1999
+ "asc": true,
2000
+ "nulls": "last"
2001
+ },
2002
+ {
2003
+ "expression": "access",
2004
+ "isExpression": false,
2005
+ "asc": true,
2006
+ "nulls": "last"
2007
+ }
2008
+ ],
2009
+ "isUnique": true,
2010
+ "concurrently": false,
2011
+ "method": "btree",
2012
+ "with": {}
2013
+ },
2014
+ "work_claims_lease": {
2015
+ "name": "work_claims_lease",
2016
+ "columns": [
2017
+ {
2018
+ "expression": "lease_expires_at",
2019
+ "isExpression": false,
2020
+ "asc": true,
2021
+ "nulls": "last"
2022
+ }
2023
+ ],
2024
+ "isUnique": false,
2025
+ "concurrently": false,
2026
+ "method": "btree",
2027
+ "with": {}
2028
+ }
2029
+ },
2030
+ "foreignKeys": {
2031
+ "work_claims_run_id_agent_runs_id_fk": {
2032
+ "name": "work_claims_run_id_agent_runs_id_fk",
2033
+ "tableFrom": "work_claims",
2034
+ "tableTo": "agent_runs",
2035
+ "columnsFrom": [
2036
+ "run_id"
2037
+ ],
2038
+ "columnsTo": [
2039
+ "id"
2040
+ ],
2041
+ "onDelete": "cascade",
2042
+ "onUpdate": "no action"
2043
+ }
2044
+ },
2045
+ "compositePrimaryKeys": {},
2046
+ "uniqueConstraints": {},
2047
+ "policies": {},
2048
+ "checkConstraints": {},
2049
+ "isRLSEnabled": false
2050
+ }
2051
+ },
2052
+ "enums": {},
2053
+ "schemas": {},
2054
+ "sequences": {},
2055
+ "roles": {},
2056
+ "policies": {},
2057
+ "views": {},
2058
+ "_meta": {
2059
+ "columns": {},
2060
+ "schemas": {},
2061
+ "tables": {}
2062
+ }
2063
+ }