@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,2080 @@
1
+ {
2
+ "id": "cf4013e8-5562-4a51-a9b1-db7a502eb4fb",
3
+ "prevId": "2982c4c7-447e-43e0-ba25-232cfc9bf724",
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
+ "debug_sessions_team_announcements": {
625
+ "name": "debug_sessions_team_announcements",
626
+ "columns": [
627
+ {
628
+ "expression": "team_id",
629
+ "isExpression": false,
630
+ "asc": true,
631
+ "nulls": "last"
632
+ }
633
+ ],
634
+ "isUnique": true,
635
+ "where": "kind = 'announcements'",
636
+ "concurrently": false,
637
+ "method": "btree",
638
+ "with": {}
639
+ }
640
+ },
641
+ "foreignKeys": {
642
+ "debug_sessions_team_id_teams_id_fk": {
643
+ "name": "debug_sessions_team_id_teams_id_fk",
644
+ "tableFrom": "debug_sessions",
645
+ "tableTo": "teams",
646
+ "columnsFrom": [
647
+ "team_id"
648
+ ],
649
+ "columnsTo": [
650
+ "id"
651
+ ],
652
+ "onDelete": "cascade",
653
+ "onUpdate": "no action"
654
+ },
655
+ "debug_sessions_project_id_projects_id_fk": {
656
+ "name": "debug_sessions_project_id_projects_id_fk",
657
+ "tableFrom": "debug_sessions",
658
+ "tableTo": "projects",
659
+ "columnsFrom": [
660
+ "project_id"
661
+ ],
662
+ "columnsTo": [
663
+ "id"
664
+ ],
665
+ "onDelete": "set null",
666
+ "onUpdate": "no action"
667
+ },
668
+ "debug_sessions_opened_by_users_id_fk": {
669
+ "name": "debug_sessions_opened_by_users_id_fk",
670
+ "tableFrom": "debug_sessions",
671
+ "tableTo": "users",
672
+ "columnsFrom": [
673
+ "opened_by"
674
+ ],
675
+ "columnsTo": [
676
+ "id"
677
+ ],
678
+ "onDelete": "no action",
679
+ "onUpdate": "no action"
680
+ }
681
+ },
682
+ "compositePrimaryKeys": {},
683
+ "uniqueConstraints": {},
684
+ "policies": {},
685
+ "checkConstraints": {},
686
+ "isRLSEnabled": false
687
+ },
688
+ "public.environment_baselines": {
689
+ "name": "environment_baselines",
690
+ "schema": "",
691
+ "columns": {
692
+ "id": {
693
+ "name": "id",
694
+ "type": "uuid",
695
+ "primaryKey": true,
696
+ "notNull": true,
697
+ "default": "gen_random_uuid()"
698
+ },
699
+ "team_id": {
700
+ "name": "team_id",
701
+ "type": "uuid",
702
+ "primaryKey": false,
703
+ "notNull": true
704
+ },
705
+ "project_id": {
706
+ "name": "project_id",
707
+ "type": "uuid",
708
+ "primaryKey": false,
709
+ "notNull": true
710
+ },
711
+ "data": {
712
+ "name": "data",
713
+ "type": "jsonb",
714
+ "primaryKey": false,
715
+ "notNull": true
716
+ },
717
+ "fingerprint": {
718
+ "name": "fingerprint",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": true
722
+ },
723
+ "active": {
724
+ "name": "active",
725
+ "type": "boolean",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "default": true
729
+ },
730
+ "created_by": {
731
+ "name": "created_by",
732
+ "type": "uuid",
733
+ "primaryKey": false,
734
+ "notNull": false
735
+ },
736
+ "created_at": {
737
+ "name": "created_at",
738
+ "type": "timestamp with time zone",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "default": "now()"
742
+ }
743
+ },
744
+ "indexes": {
745
+ "environment_baselines_project_active": {
746
+ "name": "environment_baselines_project_active",
747
+ "columns": [
748
+ {
749
+ "expression": "project_id",
750
+ "isExpression": false,
751
+ "asc": true,
752
+ "nulls": "last"
753
+ },
754
+ {
755
+ "expression": "active",
756
+ "isExpression": false,
757
+ "asc": true,
758
+ "nulls": "last"
759
+ },
760
+ {
761
+ "expression": "created_at",
762
+ "isExpression": false,
763
+ "asc": true,
764
+ "nulls": "last"
765
+ }
766
+ ],
767
+ "isUnique": false,
768
+ "concurrently": false,
769
+ "method": "btree",
770
+ "with": {}
771
+ }
772
+ },
773
+ "foreignKeys": {
774
+ "environment_baselines_team_id_teams_id_fk": {
775
+ "name": "environment_baselines_team_id_teams_id_fk",
776
+ "tableFrom": "environment_baselines",
777
+ "tableTo": "teams",
778
+ "columnsFrom": [
779
+ "team_id"
780
+ ],
781
+ "columnsTo": [
782
+ "id"
783
+ ],
784
+ "onDelete": "cascade",
785
+ "onUpdate": "no action"
786
+ },
787
+ "environment_baselines_project_id_projects_id_fk": {
788
+ "name": "environment_baselines_project_id_projects_id_fk",
789
+ "tableFrom": "environment_baselines",
790
+ "tableTo": "projects",
791
+ "columnsFrom": [
792
+ "project_id"
793
+ ],
794
+ "columnsTo": [
795
+ "id"
796
+ ],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "environment_baselines_created_by_users_id_fk": {
801
+ "name": "environment_baselines_created_by_users_id_fk",
802
+ "tableFrom": "environment_baselines",
803
+ "tableTo": "users",
804
+ "columnsFrom": [
805
+ "created_by"
806
+ ],
807
+ "columnsTo": [
808
+ "id"
809
+ ],
810
+ "onDelete": "set null",
811
+ "onUpdate": "no action"
812
+ }
813
+ },
814
+ "compositePrimaryKeys": {},
815
+ "uniqueConstraints": {},
816
+ "policies": {},
817
+ "checkConstraints": {},
818
+ "isRLSEnabled": false
819
+ },
820
+ "public.invites": {
821
+ "name": "invites",
822
+ "schema": "",
823
+ "columns": {
824
+ "id": {
825
+ "name": "id",
826
+ "type": "uuid",
827
+ "primaryKey": true,
828
+ "notNull": true,
829
+ "default": "gen_random_uuid()"
830
+ },
831
+ "team_id": {
832
+ "name": "team_id",
833
+ "type": "uuid",
834
+ "primaryKey": false,
835
+ "notNull": true
836
+ },
837
+ "code": {
838
+ "name": "code",
839
+ "type": "text",
840
+ "primaryKey": false,
841
+ "notNull": true
842
+ },
843
+ "created_by": {
844
+ "name": "created_by",
845
+ "type": "uuid",
846
+ "primaryKey": false,
847
+ "notNull": false
848
+ },
849
+ "expires_at": {
850
+ "name": "expires_at",
851
+ "type": "timestamp with time zone",
852
+ "primaryKey": false,
853
+ "notNull": true
854
+ },
855
+ "uses": {
856
+ "name": "uses",
857
+ "type": "integer",
858
+ "primaryKey": false,
859
+ "notNull": true,
860
+ "default": 0
861
+ },
862
+ "max_uses": {
863
+ "name": "max_uses",
864
+ "type": "integer",
865
+ "primaryKey": false,
866
+ "notNull": false
867
+ },
868
+ "created_at": {
869
+ "name": "created_at",
870
+ "type": "timestamp with time zone",
871
+ "primaryKey": false,
872
+ "notNull": true,
873
+ "default": "now()"
874
+ }
875
+ },
876
+ "indexes": {},
877
+ "foreignKeys": {
878
+ "invites_team_id_teams_id_fk": {
879
+ "name": "invites_team_id_teams_id_fk",
880
+ "tableFrom": "invites",
881
+ "tableTo": "teams",
882
+ "columnsFrom": [
883
+ "team_id"
884
+ ],
885
+ "columnsTo": [
886
+ "id"
887
+ ],
888
+ "onDelete": "cascade",
889
+ "onUpdate": "no action"
890
+ },
891
+ "invites_created_by_users_id_fk": {
892
+ "name": "invites_created_by_users_id_fk",
893
+ "tableFrom": "invites",
894
+ "tableTo": "users",
895
+ "columnsFrom": [
896
+ "created_by"
897
+ ],
898
+ "columnsTo": [
899
+ "id"
900
+ ],
901
+ "onDelete": "no action",
902
+ "onUpdate": "no action"
903
+ }
904
+ },
905
+ "compositePrimaryKeys": {},
906
+ "uniqueConstraints": {
907
+ "invites_code_unique": {
908
+ "name": "invites_code_unique",
909
+ "nullsNotDistinct": false,
910
+ "columns": [
911
+ "code"
912
+ ]
913
+ }
914
+ },
915
+ "policies": {},
916
+ "checkConstraints": {},
917
+ "isRLSEnabled": false
918
+ },
919
+ "public.memberships": {
920
+ "name": "memberships",
921
+ "schema": "",
922
+ "columns": {
923
+ "team_id": {
924
+ "name": "team_id",
925
+ "type": "uuid",
926
+ "primaryKey": false,
927
+ "notNull": true
928
+ },
929
+ "user_id": {
930
+ "name": "user_id",
931
+ "type": "uuid",
932
+ "primaryKey": false,
933
+ "notNull": true
934
+ },
935
+ "role": {
936
+ "name": "role",
937
+ "type": "text",
938
+ "primaryKey": false,
939
+ "notNull": true,
940
+ "default": "'member'"
941
+ },
942
+ "created_at": {
943
+ "name": "created_at",
944
+ "type": "timestamp with time zone",
945
+ "primaryKey": false,
946
+ "notNull": true,
947
+ "default": "now()"
948
+ }
949
+ },
950
+ "indexes": {},
951
+ "foreignKeys": {
952
+ "memberships_team_id_teams_id_fk": {
953
+ "name": "memberships_team_id_teams_id_fk",
954
+ "tableFrom": "memberships",
955
+ "tableTo": "teams",
956
+ "columnsFrom": [
957
+ "team_id"
958
+ ],
959
+ "columnsTo": [
960
+ "id"
961
+ ],
962
+ "onDelete": "cascade",
963
+ "onUpdate": "no action"
964
+ },
965
+ "memberships_user_id_users_id_fk": {
966
+ "name": "memberships_user_id_users_id_fk",
967
+ "tableFrom": "memberships",
968
+ "tableTo": "users",
969
+ "columnsFrom": [
970
+ "user_id"
971
+ ],
972
+ "columnsTo": [
973
+ "id"
974
+ ],
975
+ "onDelete": "cascade",
976
+ "onUpdate": "no action"
977
+ }
978
+ },
979
+ "compositePrimaryKeys": {
980
+ "memberships_team_id_user_id_pk": {
981
+ "name": "memberships_team_id_user_id_pk",
982
+ "columns": [
983
+ "team_id",
984
+ "user_id"
985
+ ]
986
+ }
987
+ },
988
+ "uniqueConstraints": {},
989
+ "policies": {},
990
+ "checkConstraints": {},
991
+ "isRLSEnabled": false
992
+ },
993
+ "public.messages": {
994
+ "name": "messages",
995
+ "schema": "",
996
+ "columns": {
997
+ "id": {
998
+ "name": "id",
999
+ "type": "uuid",
1000
+ "primaryKey": true,
1001
+ "notNull": true,
1002
+ "default": "gen_random_uuid()"
1003
+ },
1004
+ "session_id": {
1005
+ "name": "session_id",
1006
+ "type": "uuid",
1007
+ "primaryKey": false,
1008
+ "notNull": true
1009
+ },
1010
+ "author_id": {
1011
+ "name": "author_id",
1012
+ "type": "uuid",
1013
+ "primaryKey": false,
1014
+ "notNull": false
1015
+ },
1016
+ "token_id": {
1017
+ "name": "token_id",
1018
+ "type": "uuid",
1019
+ "primaryKey": false,
1020
+ "notNull": false
1021
+ },
1022
+ "kind": {
1023
+ "name": "kind",
1024
+ "type": "text",
1025
+ "primaryKey": false,
1026
+ "notNull": true,
1027
+ "default": "'note'"
1028
+ },
1029
+ "via": {
1030
+ "name": "via",
1031
+ "type": "text",
1032
+ "primaryKey": false,
1033
+ "notNull": false
1034
+ },
1035
+ "body": {
1036
+ "name": "body",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true
1040
+ },
1041
+ "attachments": {
1042
+ "name": "attachments",
1043
+ "type": "jsonb",
1044
+ "primaryKey": false,
1045
+ "notNull": false
1046
+ },
1047
+ "created_at": {
1048
+ "name": "created_at",
1049
+ "type": "timestamp with time zone",
1050
+ "primaryKey": false,
1051
+ "notNull": true,
1052
+ "default": "now()"
1053
+ }
1054
+ },
1055
+ "indexes": {
1056
+ "messages_session_created": {
1057
+ "name": "messages_session_created",
1058
+ "columns": [
1059
+ {
1060
+ "expression": "session_id",
1061
+ "isExpression": false,
1062
+ "asc": true,
1063
+ "nulls": "last"
1064
+ },
1065
+ {
1066
+ "expression": "created_at",
1067
+ "isExpression": false,
1068
+ "asc": true,
1069
+ "nulls": "last"
1070
+ }
1071
+ ],
1072
+ "isUnique": false,
1073
+ "concurrently": false,
1074
+ "method": "btree",
1075
+ "with": {}
1076
+ }
1077
+ },
1078
+ "foreignKeys": {
1079
+ "messages_session_id_debug_sessions_id_fk": {
1080
+ "name": "messages_session_id_debug_sessions_id_fk",
1081
+ "tableFrom": "messages",
1082
+ "tableTo": "debug_sessions",
1083
+ "columnsFrom": [
1084
+ "session_id"
1085
+ ],
1086
+ "columnsTo": [
1087
+ "id"
1088
+ ],
1089
+ "onDelete": "cascade",
1090
+ "onUpdate": "no action"
1091
+ },
1092
+ "messages_author_id_users_id_fk": {
1093
+ "name": "messages_author_id_users_id_fk",
1094
+ "tableFrom": "messages",
1095
+ "tableTo": "users",
1096
+ "columnsFrom": [
1097
+ "author_id"
1098
+ ],
1099
+ "columnsTo": [
1100
+ "id"
1101
+ ],
1102
+ "onDelete": "no action",
1103
+ "onUpdate": "no action"
1104
+ },
1105
+ "messages_token_id_tokens_id_fk": {
1106
+ "name": "messages_token_id_tokens_id_fk",
1107
+ "tableFrom": "messages",
1108
+ "tableTo": "tokens",
1109
+ "columnsFrom": [
1110
+ "token_id"
1111
+ ],
1112
+ "columnsTo": [
1113
+ "id"
1114
+ ],
1115
+ "onDelete": "set null",
1116
+ "onUpdate": "no action"
1117
+ }
1118
+ },
1119
+ "compositePrimaryKeys": {},
1120
+ "uniqueConstraints": {},
1121
+ "policies": {},
1122
+ "checkConstraints": {},
1123
+ "isRLSEnabled": false
1124
+ },
1125
+ "public.policy_bundles": {
1126
+ "name": "policy_bundles",
1127
+ "schema": "",
1128
+ "columns": {
1129
+ "id": {
1130
+ "name": "id",
1131
+ "type": "uuid",
1132
+ "primaryKey": true,
1133
+ "notNull": true,
1134
+ "default": "gen_random_uuid()"
1135
+ },
1136
+ "team_id": {
1137
+ "name": "team_id",
1138
+ "type": "uuid",
1139
+ "primaryKey": false,
1140
+ "notNull": true
1141
+ },
1142
+ "project_id": {
1143
+ "name": "project_id",
1144
+ "type": "uuid",
1145
+ "primaryKey": false,
1146
+ "notNull": false
1147
+ },
1148
+ "scope_key": {
1149
+ "name": "scope_key",
1150
+ "type": "text",
1151
+ "primaryKey": false,
1152
+ "notNull": true
1153
+ },
1154
+ "version": {
1155
+ "name": "version",
1156
+ "type": "integer",
1157
+ "primaryKey": false,
1158
+ "notNull": true
1159
+ },
1160
+ "status": {
1161
+ "name": "status",
1162
+ "type": "text",
1163
+ "primaryKey": false,
1164
+ "notNull": true,
1165
+ "default": "'active'"
1166
+ },
1167
+ "document": {
1168
+ "name": "document",
1169
+ "type": "jsonb",
1170
+ "primaryKey": false,
1171
+ "notNull": true
1172
+ },
1173
+ "hash": {
1174
+ "name": "hash",
1175
+ "type": "text",
1176
+ "primaryKey": false,
1177
+ "notNull": true
1178
+ },
1179
+ "created_by": {
1180
+ "name": "created_by",
1181
+ "type": "uuid",
1182
+ "primaryKey": false,
1183
+ "notNull": false
1184
+ },
1185
+ "created_at": {
1186
+ "name": "created_at",
1187
+ "type": "timestamp with time zone",
1188
+ "primaryKey": false,
1189
+ "notNull": true,
1190
+ "default": "now()"
1191
+ }
1192
+ },
1193
+ "indexes": {
1194
+ "policy_bundles_team_scope_version": {
1195
+ "name": "policy_bundles_team_scope_version",
1196
+ "columns": [
1197
+ {
1198
+ "expression": "team_id",
1199
+ "isExpression": false,
1200
+ "asc": true,
1201
+ "nulls": "last"
1202
+ },
1203
+ {
1204
+ "expression": "scope_key",
1205
+ "isExpression": false,
1206
+ "asc": true,
1207
+ "nulls": "last"
1208
+ },
1209
+ {
1210
+ "expression": "version",
1211
+ "isExpression": false,
1212
+ "asc": true,
1213
+ "nulls": "last"
1214
+ }
1215
+ ],
1216
+ "isUnique": true,
1217
+ "concurrently": false,
1218
+ "method": "btree",
1219
+ "with": {}
1220
+ }
1221
+ },
1222
+ "foreignKeys": {
1223
+ "policy_bundles_team_id_teams_id_fk": {
1224
+ "name": "policy_bundles_team_id_teams_id_fk",
1225
+ "tableFrom": "policy_bundles",
1226
+ "tableTo": "teams",
1227
+ "columnsFrom": [
1228
+ "team_id"
1229
+ ],
1230
+ "columnsTo": [
1231
+ "id"
1232
+ ],
1233
+ "onDelete": "cascade",
1234
+ "onUpdate": "no action"
1235
+ },
1236
+ "policy_bundles_project_id_projects_id_fk": {
1237
+ "name": "policy_bundles_project_id_projects_id_fk",
1238
+ "tableFrom": "policy_bundles",
1239
+ "tableTo": "projects",
1240
+ "columnsFrom": [
1241
+ "project_id"
1242
+ ],
1243
+ "columnsTo": [
1244
+ "id"
1245
+ ],
1246
+ "onDelete": "cascade",
1247
+ "onUpdate": "no action"
1248
+ },
1249
+ "policy_bundles_created_by_users_id_fk": {
1250
+ "name": "policy_bundles_created_by_users_id_fk",
1251
+ "tableFrom": "policy_bundles",
1252
+ "tableTo": "users",
1253
+ "columnsFrom": [
1254
+ "created_by"
1255
+ ],
1256
+ "columnsTo": [
1257
+ "id"
1258
+ ],
1259
+ "onDelete": "set null",
1260
+ "onUpdate": "no action"
1261
+ }
1262
+ },
1263
+ "compositePrimaryKeys": {},
1264
+ "uniqueConstraints": {},
1265
+ "policies": {},
1266
+ "checkConstraints": {},
1267
+ "isRLSEnabled": false
1268
+ },
1269
+ "public.policy_receipts": {
1270
+ "name": "policy_receipts",
1271
+ "schema": "",
1272
+ "columns": {
1273
+ "run_id": {
1274
+ "name": "run_id",
1275
+ "type": "uuid",
1276
+ "primaryKey": true,
1277
+ "notNull": true
1278
+ },
1279
+ "expected_hash": {
1280
+ "name": "expected_hash",
1281
+ "type": "text",
1282
+ "primaryKey": false,
1283
+ "notNull": true
1284
+ },
1285
+ "reported_hash": {
1286
+ "name": "reported_hash",
1287
+ "type": "text",
1288
+ "primaryKey": false,
1289
+ "notNull": false
1290
+ },
1291
+ "drift": {
1292
+ "name": "drift",
1293
+ "type": "boolean",
1294
+ "primaryKey": false,
1295
+ "notNull": true,
1296
+ "default": false
1297
+ },
1298
+ "created_at": {
1299
+ "name": "created_at",
1300
+ "type": "timestamp with time zone",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "default": "now()"
1304
+ }
1305
+ },
1306
+ "indexes": {},
1307
+ "foreignKeys": {
1308
+ "policy_receipts_run_id_agent_runs_id_fk": {
1309
+ "name": "policy_receipts_run_id_agent_runs_id_fk",
1310
+ "tableFrom": "policy_receipts",
1311
+ "tableTo": "agent_runs",
1312
+ "columnsFrom": [
1313
+ "run_id"
1314
+ ],
1315
+ "columnsTo": [
1316
+ "id"
1317
+ ],
1318
+ "onDelete": "cascade",
1319
+ "onUpdate": "no action"
1320
+ }
1321
+ },
1322
+ "compositePrimaryKeys": {},
1323
+ "uniqueConstraints": {},
1324
+ "policies": {},
1325
+ "checkConstraints": {},
1326
+ "isRLSEnabled": false
1327
+ },
1328
+ "public.projects": {
1329
+ "name": "projects",
1330
+ "schema": "",
1331
+ "columns": {
1332
+ "id": {
1333
+ "name": "id",
1334
+ "type": "uuid",
1335
+ "primaryKey": true,
1336
+ "notNull": true,
1337
+ "default": "gen_random_uuid()"
1338
+ },
1339
+ "team_id": {
1340
+ "name": "team_id",
1341
+ "type": "uuid",
1342
+ "primaryKey": false,
1343
+ "notNull": true
1344
+ },
1345
+ "name": {
1346
+ "name": "name",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "slug": {
1352
+ "name": "slug",
1353
+ "type": "text",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "created_by": {
1358
+ "name": "created_by",
1359
+ "type": "uuid",
1360
+ "primaryKey": false,
1361
+ "notNull": false
1362
+ },
1363
+ "created_at": {
1364
+ "name": "created_at",
1365
+ "type": "timestamp with time zone",
1366
+ "primaryKey": false,
1367
+ "notNull": true,
1368
+ "default": "now()"
1369
+ }
1370
+ },
1371
+ "indexes": {
1372
+ "projects_team_slug": {
1373
+ "name": "projects_team_slug",
1374
+ "columns": [
1375
+ {
1376
+ "expression": "team_id",
1377
+ "isExpression": false,
1378
+ "asc": true,
1379
+ "nulls": "last"
1380
+ },
1381
+ {
1382
+ "expression": "slug",
1383
+ "isExpression": false,
1384
+ "asc": true,
1385
+ "nulls": "last"
1386
+ }
1387
+ ],
1388
+ "isUnique": true,
1389
+ "concurrently": false,
1390
+ "method": "btree",
1391
+ "with": {}
1392
+ }
1393
+ },
1394
+ "foreignKeys": {
1395
+ "projects_team_id_teams_id_fk": {
1396
+ "name": "projects_team_id_teams_id_fk",
1397
+ "tableFrom": "projects",
1398
+ "tableTo": "teams",
1399
+ "columnsFrom": [
1400
+ "team_id"
1401
+ ],
1402
+ "columnsTo": [
1403
+ "id"
1404
+ ],
1405
+ "onDelete": "cascade",
1406
+ "onUpdate": "no action"
1407
+ },
1408
+ "projects_created_by_users_id_fk": {
1409
+ "name": "projects_created_by_users_id_fk",
1410
+ "tableFrom": "projects",
1411
+ "tableTo": "users",
1412
+ "columnsFrom": [
1413
+ "created_by"
1414
+ ],
1415
+ "columnsTo": [
1416
+ "id"
1417
+ ],
1418
+ "onDelete": "no action",
1419
+ "onUpdate": "no action"
1420
+ }
1421
+ },
1422
+ "compositePrimaryKeys": {},
1423
+ "uniqueConstraints": {},
1424
+ "policies": {},
1425
+ "checkConstraints": {},
1426
+ "isRLSEnabled": false
1427
+ },
1428
+ "public.read_state": {
1429
+ "name": "read_state",
1430
+ "schema": "",
1431
+ "columns": {
1432
+ "user_id": {
1433
+ "name": "user_id",
1434
+ "type": "uuid",
1435
+ "primaryKey": false,
1436
+ "notNull": true
1437
+ },
1438
+ "session_id": {
1439
+ "name": "session_id",
1440
+ "type": "uuid",
1441
+ "primaryKey": false,
1442
+ "notNull": true
1443
+ },
1444
+ "last_read_at": {
1445
+ "name": "last_read_at",
1446
+ "type": "timestamp with time zone",
1447
+ "primaryKey": false,
1448
+ "notNull": true,
1449
+ "default": "now()"
1450
+ }
1451
+ },
1452
+ "indexes": {},
1453
+ "foreignKeys": {
1454
+ "read_state_user_id_users_id_fk": {
1455
+ "name": "read_state_user_id_users_id_fk",
1456
+ "tableFrom": "read_state",
1457
+ "tableTo": "users",
1458
+ "columnsFrom": [
1459
+ "user_id"
1460
+ ],
1461
+ "columnsTo": [
1462
+ "id"
1463
+ ],
1464
+ "onDelete": "cascade",
1465
+ "onUpdate": "no action"
1466
+ },
1467
+ "read_state_session_id_debug_sessions_id_fk": {
1468
+ "name": "read_state_session_id_debug_sessions_id_fk",
1469
+ "tableFrom": "read_state",
1470
+ "tableTo": "debug_sessions",
1471
+ "columnsFrom": [
1472
+ "session_id"
1473
+ ],
1474
+ "columnsTo": [
1475
+ "id"
1476
+ ],
1477
+ "onDelete": "cascade",
1478
+ "onUpdate": "no action"
1479
+ }
1480
+ },
1481
+ "compositePrimaryKeys": {
1482
+ "read_state_user_id_session_id_pk": {
1483
+ "name": "read_state_user_id_session_id_pk",
1484
+ "columns": [
1485
+ "user_id",
1486
+ "session_id"
1487
+ ]
1488
+ }
1489
+ },
1490
+ "uniqueConstraints": {},
1491
+ "policies": {},
1492
+ "checkConstraints": {},
1493
+ "isRLSEnabled": false
1494
+ },
1495
+ "public.snapshots": {
1496
+ "name": "snapshots",
1497
+ "schema": "",
1498
+ "columns": {
1499
+ "id": {
1500
+ "name": "id",
1501
+ "type": "uuid",
1502
+ "primaryKey": true,
1503
+ "notNull": true,
1504
+ "default": "gen_random_uuid()"
1505
+ },
1506
+ "team_id": {
1507
+ "name": "team_id",
1508
+ "type": "uuid",
1509
+ "primaryKey": false,
1510
+ "notNull": true
1511
+ },
1512
+ "user_id": {
1513
+ "name": "user_id",
1514
+ "type": "uuid",
1515
+ "primaryKey": false,
1516
+ "notNull": true
1517
+ },
1518
+ "repo": {
1519
+ "name": "repo",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": false
1523
+ },
1524
+ "project_id": {
1525
+ "name": "project_id",
1526
+ "type": "uuid",
1527
+ "primaryKey": false,
1528
+ "notNull": false
1529
+ },
1530
+ "token_id": {
1531
+ "name": "token_id",
1532
+ "type": "uuid",
1533
+ "primaryKey": false,
1534
+ "notNull": false
1535
+ },
1536
+ "data": {
1537
+ "name": "data",
1538
+ "type": "jsonb",
1539
+ "primaryKey": false,
1540
+ "notNull": true
1541
+ },
1542
+ "created_at": {
1543
+ "name": "created_at",
1544
+ "type": "timestamp with time zone",
1545
+ "primaryKey": false,
1546
+ "notNull": true,
1547
+ "default": "now()"
1548
+ }
1549
+ },
1550
+ "indexes": {
1551
+ "snapshots_team_user_created": {
1552
+ "name": "snapshots_team_user_created",
1553
+ "columns": [
1554
+ {
1555
+ "expression": "team_id",
1556
+ "isExpression": false,
1557
+ "asc": true,
1558
+ "nulls": "last"
1559
+ },
1560
+ {
1561
+ "expression": "user_id",
1562
+ "isExpression": false,
1563
+ "asc": true,
1564
+ "nulls": "last"
1565
+ },
1566
+ {
1567
+ "expression": "created_at",
1568
+ "isExpression": false,
1569
+ "asc": true,
1570
+ "nulls": "last"
1571
+ }
1572
+ ],
1573
+ "isUnique": false,
1574
+ "concurrently": false,
1575
+ "method": "btree",
1576
+ "with": {}
1577
+ }
1578
+ },
1579
+ "foreignKeys": {
1580
+ "snapshots_team_id_teams_id_fk": {
1581
+ "name": "snapshots_team_id_teams_id_fk",
1582
+ "tableFrom": "snapshots",
1583
+ "tableTo": "teams",
1584
+ "columnsFrom": [
1585
+ "team_id"
1586
+ ],
1587
+ "columnsTo": [
1588
+ "id"
1589
+ ],
1590
+ "onDelete": "cascade",
1591
+ "onUpdate": "no action"
1592
+ },
1593
+ "snapshots_user_id_users_id_fk": {
1594
+ "name": "snapshots_user_id_users_id_fk",
1595
+ "tableFrom": "snapshots",
1596
+ "tableTo": "users",
1597
+ "columnsFrom": [
1598
+ "user_id"
1599
+ ],
1600
+ "columnsTo": [
1601
+ "id"
1602
+ ],
1603
+ "onDelete": "cascade",
1604
+ "onUpdate": "no action"
1605
+ },
1606
+ "snapshots_project_id_projects_id_fk": {
1607
+ "name": "snapshots_project_id_projects_id_fk",
1608
+ "tableFrom": "snapshots",
1609
+ "tableTo": "projects",
1610
+ "columnsFrom": [
1611
+ "project_id"
1612
+ ],
1613
+ "columnsTo": [
1614
+ "id"
1615
+ ],
1616
+ "onDelete": "cascade",
1617
+ "onUpdate": "no action"
1618
+ },
1619
+ "snapshots_token_id_tokens_id_fk": {
1620
+ "name": "snapshots_token_id_tokens_id_fk",
1621
+ "tableFrom": "snapshots",
1622
+ "tableTo": "tokens",
1623
+ "columnsFrom": [
1624
+ "token_id"
1625
+ ],
1626
+ "columnsTo": [
1627
+ "id"
1628
+ ],
1629
+ "onDelete": "set null",
1630
+ "onUpdate": "no action"
1631
+ }
1632
+ },
1633
+ "compositePrimaryKeys": {},
1634
+ "uniqueConstraints": {},
1635
+ "policies": {},
1636
+ "checkConstraints": {},
1637
+ "isRLSEnabled": false
1638
+ },
1639
+ "public.teams": {
1640
+ "name": "teams",
1641
+ "schema": "",
1642
+ "columns": {
1643
+ "id": {
1644
+ "name": "id",
1645
+ "type": "uuid",
1646
+ "primaryKey": true,
1647
+ "notNull": true,
1648
+ "default": "gen_random_uuid()"
1649
+ },
1650
+ "name": {
1651
+ "name": "name",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "slug": {
1657
+ "name": "slug",
1658
+ "type": "text",
1659
+ "primaryKey": false,
1660
+ "notNull": true
1661
+ },
1662
+ "created_by": {
1663
+ "name": "created_by",
1664
+ "type": "uuid",
1665
+ "primaryKey": false,
1666
+ "notNull": false
1667
+ },
1668
+ "webhook_url": {
1669
+ "name": "webhook_url",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": false
1673
+ },
1674
+ "plan": {
1675
+ "name": "plan",
1676
+ "type": "text",
1677
+ "primaryKey": false,
1678
+ "notNull": true,
1679
+ "default": "'free'"
1680
+ },
1681
+ "inbound_token": {
1682
+ "name": "inbound_token",
1683
+ "type": "text",
1684
+ "primaryKey": false,
1685
+ "notNull": false
1686
+ },
1687
+ "created_at": {
1688
+ "name": "created_at",
1689
+ "type": "timestamp with time zone",
1690
+ "primaryKey": false,
1691
+ "notNull": true,
1692
+ "default": "now()"
1693
+ }
1694
+ },
1695
+ "indexes": {},
1696
+ "foreignKeys": {
1697
+ "teams_created_by_users_id_fk": {
1698
+ "name": "teams_created_by_users_id_fk",
1699
+ "tableFrom": "teams",
1700
+ "tableTo": "users",
1701
+ "columnsFrom": [
1702
+ "created_by"
1703
+ ],
1704
+ "columnsTo": [
1705
+ "id"
1706
+ ],
1707
+ "onDelete": "no action",
1708
+ "onUpdate": "no action"
1709
+ }
1710
+ },
1711
+ "compositePrimaryKeys": {},
1712
+ "uniqueConstraints": {
1713
+ "teams_slug_unique": {
1714
+ "name": "teams_slug_unique",
1715
+ "nullsNotDistinct": false,
1716
+ "columns": [
1717
+ "slug"
1718
+ ]
1719
+ },
1720
+ "teams_inbound_token_unique": {
1721
+ "name": "teams_inbound_token_unique",
1722
+ "nullsNotDistinct": false,
1723
+ "columns": [
1724
+ "inbound_token"
1725
+ ]
1726
+ }
1727
+ },
1728
+ "policies": {},
1729
+ "checkConstraints": {},
1730
+ "isRLSEnabled": false
1731
+ },
1732
+ "public.tokens": {
1733
+ "name": "tokens",
1734
+ "schema": "",
1735
+ "columns": {
1736
+ "id": {
1737
+ "name": "id",
1738
+ "type": "uuid",
1739
+ "primaryKey": true,
1740
+ "notNull": true,
1741
+ "default": "gen_random_uuid()"
1742
+ },
1743
+ "user_id": {
1744
+ "name": "user_id",
1745
+ "type": "uuid",
1746
+ "primaryKey": false,
1747
+ "notNull": true
1748
+ },
1749
+ "name": {
1750
+ "name": "name",
1751
+ "type": "text",
1752
+ "primaryKey": false,
1753
+ "notNull": true
1754
+ },
1755
+ "token_hash": {
1756
+ "name": "token_hash",
1757
+ "type": "text",
1758
+ "primaryKey": false,
1759
+ "notNull": true
1760
+ },
1761
+ "prefix": {
1762
+ "name": "prefix",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": true
1766
+ },
1767
+ "last_used_at": {
1768
+ "name": "last_used_at",
1769
+ "type": "timestamp with time zone",
1770
+ "primaryKey": false,
1771
+ "notNull": false
1772
+ },
1773
+ "revoked_at": {
1774
+ "name": "revoked_at",
1775
+ "type": "timestamp with time zone",
1776
+ "primaryKey": false,
1777
+ "notNull": false
1778
+ },
1779
+ "created_at": {
1780
+ "name": "created_at",
1781
+ "type": "timestamp with time zone",
1782
+ "primaryKey": false,
1783
+ "notNull": true,
1784
+ "default": "now()"
1785
+ }
1786
+ },
1787
+ "indexes": {},
1788
+ "foreignKeys": {
1789
+ "tokens_user_id_users_id_fk": {
1790
+ "name": "tokens_user_id_users_id_fk",
1791
+ "tableFrom": "tokens",
1792
+ "tableTo": "users",
1793
+ "columnsFrom": [
1794
+ "user_id"
1795
+ ],
1796
+ "columnsTo": [
1797
+ "id"
1798
+ ],
1799
+ "onDelete": "cascade",
1800
+ "onUpdate": "no action"
1801
+ }
1802
+ },
1803
+ "compositePrimaryKeys": {},
1804
+ "uniqueConstraints": {
1805
+ "tokens_token_hash_unique": {
1806
+ "name": "tokens_token_hash_unique",
1807
+ "nullsNotDistinct": false,
1808
+ "columns": [
1809
+ "token_hash"
1810
+ ]
1811
+ }
1812
+ },
1813
+ "policies": {},
1814
+ "checkConstraints": {},
1815
+ "isRLSEnabled": false
1816
+ },
1817
+ "public.users": {
1818
+ "name": "users",
1819
+ "schema": "",
1820
+ "columns": {
1821
+ "id": {
1822
+ "name": "id",
1823
+ "type": "uuid",
1824
+ "primaryKey": true,
1825
+ "notNull": true,
1826
+ "default": "gen_random_uuid()"
1827
+ },
1828
+ "github_id": {
1829
+ "name": "github_id",
1830
+ "type": "bigint",
1831
+ "primaryKey": false,
1832
+ "notNull": false
1833
+ },
1834
+ "username": {
1835
+ "name": "username",
1836
+ "type": "text",
1837
+ "primaryKey": false,
1838
+ "notNull": true
1839
+ },
1840
+ "password_hash": {
1841
+ "name": "password_hash",
1842
+ "type": "text",
1843
+ "primaryKey": false,
1844
+ "notNull": false
1845
+ },
1846
+ "display_name": {
1847
+ "name": "display_name",
1848
+ "type": "text",
1849
+ "primaryKey": false,
1850
+ "notNull": false
1851
+ },
1852
+ "email": {
1853
+ "name": "email",
1854
+ "type": "text",
1855
+ "primaryKey": false,
1856
+ "notNull": false
1857
+ },
1858
+ "avatar_url": {
1859
+ "name": "avatar_url",
1860
+ "type": "text",
1861
+ "primaryKey": false,
1862
+ "notNull": false
1863
+ },
1864
+ "created_at": {
1865
+ "name": "created_at",
1866
+ "type": "timestamp with time zone",
1867
+ "primaryKey": false,
1868
+ "notNull": true,
1869
+ "default": "now()"
1870
+ }
1871
+ },
1872
+ "indexes": {},
1873
+ "foreignKeys": {},
1874
+ "compositePrimaryKeys": {},
1875
+ "uniqueConstraints": {
1876
+ "users_github_id_unique": {
1877
+ "name": "users_github_id_unique",
1878
+ "nullsNotDistinct": false,
1879
+ "columns": [
1880
+ "github_id"
1881
+ ]
1882
+ },
1883
+ "users_username_unique": {
1884
+ "name": "users_username_unique",
1885
+ "nullsNotDistinct": false,
1886
+ "columns": [
1887
+ "username"
1888
+ ]
1889
+ }
1890
+ },
1891
+ "policies": {},
1892
+ "checkConstraints": {},
1893
+ "isRLSEnabled": false
1894
+ },
1895
+ "public.web_sessions": {
1896
+ "name": "web_sessions",
1897
+ "schema": "",
1898
+ "columns": {
1899
+ "id": {
1900
+ "name": "id",
1901
+ "type": "text",
1902
+ "primaryKey": true,
1903
+ "notNull": true
1904
+ },
1905
+ "user_id": {
1906
+ "name": "user_id",
1907
+ "type": "uuid",
1908
+ "primaryKey": false,
1909
+ "notNull": true
1910
+ },
1911
+ "expires_at": {
1912
+ "name": "expires_at",
1913
+ "type": "timestamp with time zone",
1914
+ "primaryKey": false,
1915
+ "notNull": true
1916
+ },
1917
+ "created_at": {
1918
+ "name": "created_at",
1919
+ "type": "timestamp with time zone",
1920
+ "primaryKey": false,
1921
+ "notNull": true,
1922
+ "default": "now()"
1923
+ }
1924
+ },
1925
+ "indexes": {},
1926
+ "foreignKeys": {
1927
+ "web_sessions_user_id_users_id_fk": {
1928
+ "name": "web_sessions_user_id_users_id_fk",
1929
+ "tableFrom": "web_sessions",
1930
+ "tableTo": "users",
1931
+ "columnsFrom": [
1932
+ "user_id"
1933
+ ],
1934
+ "columnsTo": [
1935
+ "id"
1936
+ ],
1937
+ "onDelete": "cascade",
1938
+ "onUpdate": "no action"
1939
+ }
1940
+ },
1941
+ "compositePrimaryKeys": {},
1942
+ "uniqueConstraints": {},
1943
+ "policies": {},
1944
+ "checkConstraints": {},
1945
+ "isRLSEnabled": false
1946
+ },
1947
+ "public.work_claims": {
1948
+ "name": "work_claims",
1949
+ "schema": "",
1950
+ "columns": {
1951
+ "id": {
1952
+ "name": "id",
1953
+ "type": "uuid",
1954
+ "primaryKey": true,
1955
+ "notNull": true,
1956
+ "default": "gen_random_uuid()"
1957
+ },
1958
+ "run_id": {
1959
+ "name": "run_id",
1960
+ "type": "uuid",
1961
+ "primaryKey": false,
1962
+ "notNull": true
1963
+ },
1964
+ "resource_type": {
1965
+ "name": "resource_type",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": true
1969
+ },
1970
+ "resource_key": {
1971
+ "name": "resource_key",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true
1975
+ },
1976
+ "access": {
1977
+ "name": "access",
1978
+ "type": "text",
1979
+ "primaryKey": false,
1980
+ "notNull": true,
1981
+ "default": "'write'"
1982
+ },
1983
+ "lease_expires_at": {
1984
+ "name": "lease_expires_at",
1985
+ "type": "timestamp with time zone",
1986
+ "primaryKey": false,
1987
+ "notNull": true
1988
+ },
1989
+ "created_at": {
1990
+ "name": "created_at",
1991
+ "type": "timestamp with time zone",
1992
+ "primaryKey": false,
1993
+ "notNull": true,
1994
+ "default": "now()"
1995
+ }
1996
+ },
1997
+ "indexes": {
1998
+ "work_claims_run_resource": {
1999
+ "name": "work_claims_run_resource",
2000
+ "columns": [
2001
+ {
2002
+ "expression": "run_id",
2003
+ "isExpression": false,
2004
+ "asc": true,
2005
+ "nulls": "last"
2006
+ },
2007
+ {
2008
+ "expression": "resource_type",
2009
+ "isExpression": false,
2010
+ "asc": true,
2011
+ "nulls": "last"
2012
+ },
2013
+ {
2014
+ "expression": "resource_key",
2015
+ "isExpression": false,
2016
+ "asc": true,
2017
+ "nulls": "last"
2018
+ },
2019
+ {
2020
+ "expression": "access",
2021
+ "isExpression": false,
2022
+ "asc": true,
2023
+ "nulls": "last"
2024
+ }
2025
+ ],
2026
+ "isUnique": true,
2027
+ "concurrently": false,
2028
+ "method": "btree",
2029
+ "with": {}
2030
+ },
2031
+ "work_claims_lease": {
2032
+ "name": "work_claims_lease",
2033
+ "columns": [
2034
+ {
2035
+ "expression": "lease_expires_at",
2036
+ "isExpression": false,
2037
+ "asc": true,
2038
+ "nulls": "last"
2039
+ }
2040
+ ],
2041
+ "isUnique": false,
2042
+ "concurrently": false,
2043
+ "method": "btree",
2044
+ "with": {}
2045
+ }
2046
+ },
2047
+ "foreignKeys": {
2048
+ "work_claims_run_id_agent_runs_id_fk": {
2049
+ "name": "work_claims_run_id_agent_runs_id_fk",
2050
+ "tableFrom": "work_claims",
2051
+ "tableTo": "agent_runs",
2052
+ "columnsFrom": [
2053
+ "run_id"
2054
+ ],
2055
+ "columnsTo": [
2056
+ "id"
2057
+ ],
2058
+ "onDelete": "cascade",
2059
+ "onUpdate": "no action"
2060
+ }
2061
+ },
2062
+ "compositePrimaryKeys": {},
2063
+ "uniqueConstraints": {},
2064
+ "policies": {},
2065
+ "checkConstraints": {},
2066
+ "isRLSEnabled": false
2067
+ }
2068
+ },
2069
+ "enums": {},
2070
+ "schemas": {},
2071
+ "sequences": {},
2072
+ "roles": {},
2073
+ "policies": {},
2074
+ "views": {},
2075
+ "_meta": {
2076
+ "columns": {},
2077
+ "schemas": {},
2078
+ "tables": {}
2079
+ }
2080
+ }