@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,3081 @@
1
+ {
2
+ "id": "a0dda25f-09d9-4922-bd71-3c84a4c7b82f",
3
+ "prevId": "f8c8b4ea-0875-409a-85fd-42931460f919",
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
+ "role": {
263
+ "name": "role",
264
+ "type": "text",
265
+ "primaryKey": false,
266
+ "notNull": false
267
+ },
268
+ "device_fingerprint": {
269
+ "name": "device_fingerprint",
270
+ "type": "text",
271
+ "primaryKey": false,
272
+ "notNull": true
273
+ },
274
+ "capabilities": {
275
+ "name": "capabilities",
276
+ "type": "jsonb",
277
+ "primaryKey": false,
278
+ "notNull": true,
279
+ "default": "'[]'::jsonb"
280
+ },
281
+ "last_seen_at": {
282
+ "name": "last_seen_at",
283
+ "type": "timestamp with time zone",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "revoked_at": {
289
+ "name": "revoked_at",
290
+ "type": "timestamp with time zone",
291
+ "primaryKey": false,
292
+ "notNull": false
293
+ },
294
+ "created_at": {
295
+ "name": "created_at",
296
+ "type": "timestamp with time zone",
297
+ "primaryKey": false,
298
+ "notNull": true,
299
+ "default": "now()"
300
+ }
301
+ },
302
+ "indexes": {
303
+ "agent_installations_user_device_name": {
304
+ "name": "agent_installations_user_device_name",
305
+ "columns": [
306
+ {
307
+ "expression": "user_id",
308
+ "isExpression": false,
309
+ "asc": true,
310
+ "nulls": "last"
311
+ },
312
+ {
313
+ "expression": "device_fingerprint",
314
+ "isExpression": false,
315
+ "asc": true,
316
+ "nulls": "last"
317
+ },
318
+ {
319
+ "expression": "name",
320
+ "isExpression": false,
321
+ "asc": true,
322
+ "nulls": "last"
323
+ }
324
+ ],
325
+ "isUnique": true,
326
+ "concurrently": false,
327
+ "method": "btree",
328
+ "with": {}
329
+ }
330
+ },
331
+ "foreignKeys": {
332
+ "agent_installations_user_id_users_id_fk": {
333
+ "name": "agent_installations_user_id_users_id_fk",
334
+ "tableFrom": "agent_installations",
335
+ "tableTo": "users",
336
+ "columnsFrom": [
337
+ "user_id"
338
+ ],
339
+ "columnsTo": [
340
+ "id"
341
+ ],
342
+ "onDelete": "cascade",
343
+ "onUpdate": "no action"
344
+ }
345
+ },
346
+ "compositePrimaryKeys": {},
347
+ "uniqueConstraints": {},
348
+ "policies": {},
349
+ "checkConstraints": {},
350
+ "isRLSEnabled": false
351
+ },
352
+ "public.agent_runs": {
353
+ "name": "agent_runs",
354
+ "schema": "",
355
+ "columns": {
356
+ "id": {
357
+ "name": "id",
358
+ "type": "uuid",
359
+ "primaryKey": true,
360
+ "notNull": true,
361
+ "default": "gen_random_uuid()"
362
+ },
363
+ "installation_id": {
364
+ "name": "installation_id",
365
+ "type": "uuid",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "team_id": {
370
+ "name": "team_id",
371
+ "type": "uuid",
372
+ "primaryKey": false,
373
+ "notNull": true
374
+ },
375
+ "project_id": {
376
+ "name": "project_id",
377
+ "type": "uuid",
378
+ "primaryKey": false,
379
+ "notNull": false
380
+ },
381
+ "task_key": {
382
+ "name": "task_key",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": false
386
+ },
387
+ "intent": {
388
+ "name": "intent",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": false
392
+ },
393
+ "repo": {
394
+ "name": "repo",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": false
398
+ },
399
+ "branch": {
400
+ "name": "branch",
401
+ "type": "text",
402
+ "primaryKey": false,
403
+ "notNull": false
404
+ },
405
+ "worktree": {
406
+ "name": "worktree",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": false
410
+ },
411
+ "base_sha": {
412
+ "name": "base_sha",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": false
416
+ },
417
+ "status": {
418
+ "name": "status",
419
+ "type": "text",
420
+ "primaryKey": false,
421
+ "notNull": true,
422
+ "default": "'starting'"
423
+ },
424
+ "policy_hash": {
425
+ "name": "policy_hash",
426
+ "type": "text",
427
+ "primaryKey": false,
428
+ "notNull": false
429
+ },
430
+ "environment_fingerprint": {
431
+ "name": "environment_fingerprint",
432
+ "type": "text",
433
+ "primaryKey": false,
434
+ "notNull": false
435
+ },
436
+ "attempt_group": {
437
+ "name": "attempt_group",
438
+ "type": "text",
439
+ "primaryKey": false,
440
+ "notNull": false
441
+ },
442
+ "quota_pct": {
443
+ "name": "quota_pct",
444
+ "type": "integer",
445
+ "primaryKey": false,
446
+ "notNull": false
447
+ },
448
+ "quota_state": {
449
+ "name": "quota_state",
450
+ "type": "text",
451
+ "primaryKey": false,
452
+ "notNull": false
453
+ },
454
+ "quota_resets_at": {
455
+ "name": "quota_resets_at",
456
+ "type": "timestamp with time zone",
457
+ "primaryKey": false,
458
+ "notNull": false
459
+ },
460
+ "quota_label": {
461
+ "name": "quota_label",
462
+ "type": "text",
463
+ "primaryKey": false,
464
+ "notNull": false
465
+ },
466
+ "started_at": {
467
+ "name": "started_at",
468
+ "type": "timestamp with time zone",
469
+ "primaryKey": false,
470
+ "notNull": true,
471
+ "default": "now()"
472
+ },
473
+ "last_heartbeat_at": {
474
+ "name": "last_heartbeat_at",
475
+ "type": "timestamp with time zone",
476
+ "primaryKey": false,
477
+ "notNull": true,
478
+ "default": "now()"
479
+ },
480
+ "ended_at": {
481
+ "name": "ended_at",
482
+ "type": "timestamp with time zone",
483
+ "primaryKey": false,
484
+ "notNull": false
485
+ }
486
+ },
487
+ "indexes": {
488
+ "agent_runs_team_status_heartbeat": {
489
+ "name": "agent_runs_team_status_heartbeat",
490
+ "columns": [
491
+ {
492
+ "expression": "team_id",
493
+ "isExpression": false,
494
+ "asc": true,
495
+ "nulls": "last"
496
+ },
497
+ {
498
+ "expression": "status",
499
+ "isExpression": false,
500
+ "asc": true,
501
+ "nulls": "last"
502
+ },
503
+ {
504
+ "expression": "last_heartbeat_at",
505
+ "isExpression": false,
506
+ "asc": true,
507
+ "nulls": "last"
508
+ }
509
+ ],
510
+ "isUnique": false,
511
+ "concurrently": false,
512
+ "method": "btree",
513
+ "with": {}
514
+ },
515
+ "agent_runs_installation_started": {
516
+ "name": "agent_runs_installation_started",
517
+ "columns": [
518
+ {
519
+ "expression": "installation_id",
520
+ "isExpression": false,
521
+ "asc": true,
522
+ "nulls": "last"
523
+ },
524
+ {
525
+ "expression": "started_at",
526
+ "isExpression": false,
527
+ "asc": true,
528
+ "nulls": "last"
529
+ }
530
+ ],
531
+ "isUnique": false,
532
+ "concurrently": false,
533
+ "method": "btree",
534
+ "with": {}
535
+ }
536
+ },
537
+ "foreignKeys": {
538
+ "agent_runs_installation_id_agent_installations_id_fk": {
539
+ "name": "agent_runs_installation_id_agent_installations_id_fk",
540
+ "tableFrom": "agent_runs",
541
+ "tableTo": "agent_installations",
542
+ "columnsFrom": [
543
+ "installation_id"
544
+ ],
545
+ "columnsTo": [
546
+ "id"
547
+ ],
548
+ "onDelete": "cascade",
549
+ "onUpdate": "no action"
550
+ },
551
+ "agent_runs_team_id_teams_id_fk": {
552
+ "name": "agent_runs_team_id_teams_id_fk",
553
+ "tableFrom": "agent_runs",
554
+ "tableTo": "teams",
555
+ "columnsFrom": [
556
+ "team_id"
557
+ ],
558
+ "columnsTo": [
559
+ "id"
560
+ ],
561
+ "onDelete": "cascade",
562
+ "onUpdate": "no action"
563
+ },
564
+ "agent_runs_project_id_projects_id_fk": {
565
+ "name": "agent_runs_project_id_projects_id_fk",
566
+ "tableFrom": "agent_runs",
567
+ "tableTo": "projects",
568
+ "columnsFrom": [
569
+ "project_id"
570
+ ],
571
+ "columnsTo": [
572
+ "id"
573
+ ],
574
+ "onDelete": "set null",
575
+ "onUpdate": "no action"
576
+ }
577
+ },
578
+ "compositePrimaryKeys": {},
579
+ "uniqueConstraints": {},
580
+ "policies": {},
581
+ "checkConstraints": {},
582
+ "isRLSEnabled": false
583
+ },
584
+ "public.auth_codes": {
585
+ "name": "auth_codes",
586
+ "schema": "",
587
+ "columns": {
588
+ "id": {
589
+ "name": "id",
590
+ "type": "uuid",
591
+ "primaryKey": true,
592
+ "notNull": true,
593
+ "default": "gen_random_uuid()"
594
+ },
595
+ "user_id": {
596
+ "name": "user_id",
597
+ "type": "uuid",
598
+ "primaryKey": false,
599
+ "notNull": true
600
+ },
601
+ "purpose": {
602
+ "name": "purpose",
603
+ "type": "text",
604
+ "primaryKey": false,
605
+ "notNull": true
606
+ },
607
+ "code_hash": {
608
+ "name": "code_hash",
609
+ "type": "text",
610
+ "primaryKey": false,
611
+ "notNull": true
612
+ },
613
+ "expires_at": {
614
+ "name": "expires_at",
615
+ "type": "timestamp with time zone",
616
+ "primaryKey": false,
617
+ "notNull": true
618
+ },
619
+ "attempts": {
620
+ "name": "attempts",
621
+ "type": "integer",
622
+ "primaryKey": false,
623
+ "notNull": true,
624
+ "default": 0
625
+ },
626
+ "consumed_at": {
627
+ "name": "consumed_at",
628
+ "type": "timestamp with time zone",
629
+ "primaryKey": false,
630
+ "notNull": false
631
+ },
632
+ "created_at": {
633
+ "name": "created_at",
634
+ "type": "timestamp with time zone",
635
+ "primaryKey": false,
636
+ "notNull": true,
637
+ "default": "now()"
638
+ }
639
+ },
640
+ "indexes": {
641
+ "auth_codes_user_purpose": {
642
+ "name": "auth_codes_user_purpose",
643
+ "columns": [
644
+ {
645
+ "expression": "user_id",
646
+ "isExpression": false,
647
+ "asc": true,
648
+ "nulls": "last"
649
+ },
650
+ {
651
+ "expression": "purpose",
652
+ "isExpression": false,
653
+ "asc": true,
654
+ "nulls": "last"
655
+ }
656
+ ],
657
+ "isUnique": false,
658
+ "concurrently": false,
659
+ "method": "btree",
660
+ "with": {}
661
+ }
662
+ },
663
+ "foreignKeys": {
664
+ "auth_codes_user_id_users_id_fk": {
665
+ "name": "auth_codes_user_id_users_id_fk",
666
+ "tableFrom": "auth_codes",
667
+ "tableTo": "users",
668
+ "columnsFrom": [
669
+ "user_id"
670
+ ],
671
+ "columnsTo": [
672
+ "id"
673
+ ],
674
+ "onDelete": "cascade",
675
+ "onUpdate": "no action"
676
+ }
677
+ },
678
+ "compositePrimaryKeys": {},
679
+ "uniqueConstraints": {},
680
+ "policies": {},
681
+ "checkConstraints": {},
682
+ "isRLSEnabled": false
683
+ },
684
+ "public.crm_contacts": {
685
+ "name": "crm_contacts",
686
+ "schema": "",
687
+ "columns": {
688
+ "id": {
689
+ "name": "id",
690
+ "type": "uuid",
691
+ "primaryKey": true,
692
+ "notNull": true,
693
+ "default": "gen_random_uuid()"
694
+ },
695
+ "name": {
696
+ "name": "name",
697
+ "type": "text",
698
+ "primaryKey": false,
699
+ "notNull": true
700
+ },
701
+ "org": {
702
+ "name": "org",
703
+ "type": "text",
704
+ "primaryKey": false,
705
+ "notNull": false
706
+ },
707
+ "contact": {
708
+ "name": "contact",
709
+ "type": "text",
710
+ "primaryKey": false,
711
+ "notNull": false
712
+ },
713
+ "status": {
714
+ "name": "status",
715
+ "type": "text",
716
+ "primaryKey": false,
717
+ "notNull": true,
718
+ "default": "'lead'"
719
+ },
720
+ "source": {
721
+ "name": "source",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": false
725
+ },
726
+ "notes": {
727
+ "name": "notes",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "next_action_at": {
733
+ "name": "next_action_at",
734
+ "type": "timestamp with time zone",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "created_at": {
739
+ "name": "created_at",
740
+ "type": "timestamp with time zone",
741
+ "primaryKey": false,
742
+ "notNull": true,
743
+ "default": "now()"
744
+ },
745
+ "updated_at": {
746
+ "name": "updated_at",
747
+ "type": "timestamp with time zone",
748
+ "primaryKey": false,
749
+ "notNull": true,
750
+ "default": "now()"
751
+ }
752
+ },
753
+ "indexes": {},
754
+ "foreignKeys": {},
755
+ "compositePrimaryKeys": {},
756
+ "uniqueConstraints": {},
757
+ "policies": {},
758
+ "checkConstraints": {},
759
+ "isRLSEnabled": false
760
+ },
761
+ "public.debug_sessions": {
762
+ "name": "debug_sessions",
763
+ "schema": "",
764
+ "columns": {
765
+ "id": {
766
+ "name": "id",
767
+ "type": "uuid",
768
+ "primaryKey": true,
769
+ "notNull": true,
770
+ "default": "gen_random_uuid()"
771
+ },
772
+ "team_id": {
773
+ "name": "team_id",
774
+ "type": "uuid",
775
+ "primaryKey": false,
776
+ "notNull": true
777
+ },
778
+ "project_id": {
779
+ "name": "project_id",
780
+ "type": "uuid",
781
+ "primaryKey": false,
782
+ "notNull": false
783
+ },
784
+ "kind": {
785
+ "name": "kind",
786
+ "type": "text",
787
+ "primaryKey": false,
788
+ "notNull": true,
789
+ "default": "'debug'"
790
+ },
791
+ "title": {
792
+ "name": "title",
793
+ "type": "text",
794
+ "primaryKey": false,
795
+ "notNull": true
796
+ },
797
+ "status": {
798
+ "name": "status",
799
+ "type": "text",
800
+ "primaryKey": false,
801
+ "notNull": true,
802
+ "default": "'open'"
803
+ },
804
+ "opened_by": {
805
+ "name": "opened_by",
806
+ "type": "uuid",
807
+ "primaryKey": false,
808
+ "notNull": false
809
+ },
810
+ "context": {
811
+ "name": "context",
812
+ "type": "jsonb",
813
+ "primaryKey": false,
814
+ "notNull": false
815
+ },
816
+ "resolution": {
817
+ "name": "resolution",
818
+ "type": "jsonb",
819
+ "primaryKey": false,
820
+ "notNull": false
821
+ },
822
+ "created_at": {
823
+ "name": "created_at",
824
+ "type": "timestamp with time zone",
825
+ "primaryKey": false,
826
+ "notNull": true,
827
+ "default": "now()"
828
+ },
829
+ "resolved_at": {
830
+ "name": "resolved_at",
831
+ "type": "timestamp with time zone",
832
+ "primaryKey": false,
833
+ "notNull": false
834
+ }
835
+ },
836
+ "indexes": {
837
+ "debug_sessions_team_announcements": {
838
+ "name": "debug_sessions_team_announcements",
839
+ "columns": [
840
+ {
841
+ "expression": "team_id",
842
+ "isExpression": false,
843
+ "asc": true,
844
+ "nulls": "last"
845
+ }
846
+ ],
847
+ "isUnique": true,
848
+ "where": "kind = 'announcements'",
849
+ "concurrently": false,
850
+ "method": "btree",
851
+ "with": {}
852
+ }
853
+ },
854
+ "foreignKeys": {
855
+ "debug_sessions_team_id_teams_id_fk": {
856
+ "name": "debug_sessions_team_id_teams_id_fk",
857
+ "tableFrom": "debug_sessions",
858
+ "tableTo": "teams",
859
+ "columnsFrom": [
860
+ "team_id"
861
+ ],
862
+ "columnsTo": [
863
+ "id"
864
+ ],
865
+ "onDelete": "cascade",
866
+ "onUpdate": "no action"
867
+ },
868
+ "debug_sessions_project_id_projects_id_fk": {
869
+ "name": "debug_sessions_project_id_projects_id_fk",
870
+ "tableFrom": "debug_sessions",
871
+ "tableTo": "projects",
872
+ "columnsFrom": [
873
+ "project_id"
874
+ ],
875
+ "columnsTo": [
876
+ "id"
877
+ ],
878
+ "onDelete": "set null",
879
+ "onUpdate": "no action"
880
+ },
881
+ "debug_sessions_opened_by_users_id_fk": {
882
+ "name": "debug_sessions_opened_by_users_id_fk",
883
+ "tableFrom": "debug_sessions",
884
+ "tableTo": "users",
885
+ "columnsFrom": [
886
+ "opened_by"
887
+ ],
888
+ "columnsTo": [
889
+ "id"
890
+ ],
891
+ "onDelete": "no action",
892
+ "onUpdate": "no action"
893
+ }
894
+ },
895
+ "compositePrimaryKeys": {},
896
+ "uniqueConstraints": {},
897
+ "policies": {},
898
+ "checkConstraints": {},
899
+ "isRLSEnabled": false
900
+ },
901
+ "public.environment_baselines": {
902
+ "name": "environment_baselines",
903
+ "schema": "",
904
+ "columns": {
905
+ "id": {
906
+ "name": "id",
907
+ "type": "uuid",
908
+ "primaryKey": true,
909
+ "notNull": true,
910
+ "default": "gen_random_uuid()"
911
+ },
912
+ "team_id": {
913
+ "name": "team_id",
914
+ "type": "uuid",
915
+ "primaryKey": false,
916
+ "notNull": true
917
+ },
918
+ "project_id": {
919
+ "name": "project_id",
920
+ "type": "uuid",
921
+ "primaryKey": false,
922
+ "notNull": true
923
+ },
924
+ "data": {
925
+ "name": "data",
926
+ "type": "jsonb",
927
+ "primaryKey": false,
928
+ "notNull": true
929
+ },
930
+ "fingerprint": {
931
+ "name": "fingerprint",
932
+ "type": "text",
933
+ "primaryKey": false,
934
+ "notNull": true
935
+ },
936
+ "active": {
937
+ "name": "active",
938
+ "type": "boolean",
939
+ "primaryKey": false,
940
+ "notNull": true,
941
+ "default": true
942
+ },
943
+ "created_by": {
944
+ "name": "created_by",
945
+ "type": "uuid",
946
+ "primaryKey": false,
947
+ "notNull": false
948
+ },
949
+ "created_at": {
950
+ "name": "created_at",
951
+ "type": "timestamp with time zone",
952
+ "primaryKey": false,
953
+ "notNull": true,
954
+ "default": "now()"
955
+ }
956
+ },
957
+ "indexes": {
958
+ "environment_baselines_project_active": {
959
+ "name": "environment_baselines_project_active",
960
+ "columns": [
961
+ {
962
+ "expression": "project_id",
963
+ "isExpression": false,
964
+ "asc": true,
965
+ "nulls": "last"
966
+ },
967
+ {
968
+ "expression": "active",
969
+ "isExpression": false,
970
+ "asc": true,
971
+ "nulls": "last"
972
+ },
973
+ {
974
+ "expression": "created_at",
975
+ "isExpression": false,
976
+ "asc": true,
977
+ "nulls": "last"
978
+ }
979
+ ],
980
+ "isUnique": false,
981
+ "concurrently": false,
982
+ "method": "btree",
983
+ "with": {}
984
+ }
985
+ },
986
+ "foreignKeys": {
987
+ "environment_baselines_team_id_teams_id_fk": {
988
+ "name": "environment_baselines_team_id_teams_id_fk",
989
+ "tableFrom": "environment_baselines",
990
+ "tableTo": "teams",
991
+ "columnsFrom": [
992
+ "team_id"
993
+ ],
994
+ "columnsTo": [
995
+ "id"
996
+ ],
997
+ "onDelete": "cascade",
998
+ "onUpdate": "no action"
999
+ },
1000
+ "environment_baselines_project_id_projects_id_fk": {
1001
+ "name": "environment_baselines_project_id_projects_id_fk",
1002
+ "tableFrom": "environment_baselines",
1003
+ "tableTo": "projects",
1004
+ "columnsFrom": [
1005
+ "project_id"
1006
+ ],
1007
+ "columnsTo": [
1008
+ "id"
1009
+ ],
1010
+ "onDelete": "cascade",
1011
+ "onUpdate": "no action"
1012
+ },
1013
+ "environment_baselines_created_by_users_id_fk": {
1014
+ "name": "environment_baselines_created_by_users_id_fk",
1015
+ "tableFrom": "environment_baselines",
1016
+ "tableTo": "users",
1017
+ "columnsFrom": [
1018
+ "created_by"
1019
+ ],
1020
+ "columnsTo": [
1021
+ "id"
1022
+ ],
1023
+ "onDelete": "set null",
1024
+ "onUpdate": "no action"
1025
+ }
1026
+ },
1027
+ "compositePrimaryKeys": {},
1028
+ "uniqueConstraints": {},
1029
+ "policies": {},
1030
+ "checkConstraints": {},
1031
+ "isRLSEnabled": false
1032
+ },
1033
+ "public.environment_checks": {
1034
+ "name": "environment_checks",
1035
+ "schema": "",
1036
+ "columns": {
1037
+ "id": {
1038
+ "name": "id",
1039
+ "type": "uuid",
1040
+ "primaryKey": true,
1041
+ "notNull": true,
1042
+ "default": "gen_random_uuid()"
1043
+ },
1044
+ "team_id": {
1045
+ "name": "team_id",
1046
+ "type": "uuid",
1047
+ "primaryKey": false,
1048
+ "notNull": true
1049
+ },
1050
+ "project_id": {
1051
+ "name": "project_id",
1052
+ "type": "uuid",
1053
+ "primaryKey": false,
1054
+ "notNull": true
1055
+ },
1056
+ "user_id": {
1057
+ "name": "user_id",
1058
+ "type": "uuid",
1059
+ "primaryKey": false,
1060
+ "notNull": false
1061
+ },
1062
+ "run_id": {
1063
+ "name": "run_id",
1064
+ "type": "uuid",
1065
+ "primaryKey": false,
1066
+ "notNull": false
1067
+ },
1068
+ "status": {
1069
+ "name": "status",
1070
+ "type": "text",
1071
+ "primaryKey": false,
1072
+ "notNull": true
1073
+ },
1074
+ "fingerprint": {
1075
+ "name": "fingerprint",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": true
1079
+ },
1080
+ "baseline_fingerprint": {
1081
+ "name": "baseline_fingerprint",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": false
1085
+ },
1086
+ "summary": {
1087
+ "name": "summary",
1088
+ "type": "text",
1089
+ "primaryKey": false,
1090
+ "notNull": false
1091
+ },
1092
+ "details": {
1093
+ "name": "details",
1094
+ "type": "jsonb",
1095
+ "primaryKey": false,
1096
+ "notNull": false
1097
+ },
1098
+ "created_at": {
1099
+ "name": "created_at",
1100
+ "type": "timestamp with time zone",
1101
+ "primaryKey": false,
1102
+ "notNull": true,
1103
+ "default": "now()"
1104
+ }
1105
+ },
1106
+ "indexes": {
1107
+ "environment_checks_team_created": {
1108
+ "name": "environment_checks_team_created",
1109
+ "columns": [
1110
+ {
1111
+ "expression": "team_id",
1112
+ "isExpression": false,
1113
+ "asc": true,
1114
+ "nulls": "last"
1115
+ },
1116
+ {
1117
+ "expression": "created_at",
1118
+ "isExpression": false,
1119
+ "asc": true,
1120
+ "nulls": "last"
1121
+ }
1122
+ ],
1123
+ "isUnique": false,
1124
+ "concurrently": false,
1125
+ "method": "btree",
1126
+ "with": {}
1127
+ },
1128
+ "environment_checks_project_created": {
1129
+ "name": "environment_checks_project_created",
1130
+ "columns": [
1131
+ {
1132
+ "expression": "project_id",
1133
+ "isExpression": false,
1134
+ "asc": true,
1135
+ "nulls": "last"
1136
+ },
1137
+ {
1138
+ "expression": "created_at",
1139
+ "isExpression": false,
1140
+ "asc": true,
1141
+ "nulls": "last"
1142
+ }
1143
+ ],
1144
+ "isUnique": false,
1145
+ "concurrently": false,
1146
+ "method": "btree",
1147
+ "with": {}
1148
+ }
1149
+ },
1150
+ "foreignKeys": {
1151
+ "environment_checks_team_id_teams_id_fk": {
1152
+ "name": "environment_checks_team_id_teams_id_fk",
1153
+ "tableFrom": "environment_checks",
1154
+ "tableTo": "teams",
1155
+ "columnsFrom": [
1156
+ "team_id"
1157
+ ],
1158
+ "columnsTo": [
1159
+ "id"
1160
+ ],
1161
+ "onDelete": "cascade",
1162
+ "onUpdate": "no action"
1163
+ },
1164
+ "environment_checks_project_id_projects_id_fk": {
1165
+ "name": "environment_checks_project_id_projects_id_fk",
1166
+ "tableFrom": "environment_checks",
1167
+ "tableTo": "projects",
1168
+ "columnsFrom": [
1169
+ "project_id"
1170
+ ],
1171
+ "columnsTo": [
1172
+ "id"
1173
+ ],
1174
+ "onDelete": "cascade",
1175
+ "onUpdate": "no action"
1176
+ },
1177
+ "environment_checks_user_id_users_id_fk": {
1178
+ "name": "environment_checks_user_id_users_id_fk",
1179
+ "tableFrom": "environment_checks",
1180
+ "tableTo": "users",
1181
+ "columnsFrom": [
1182
+ "user_id"
1183
+ ],
1184
+ "columnsTo": [
1185
+ "id"
1186
+ ],
1187
+ "onDelete": "set null",
1188
+ "onUpdate": "no action"
1189
+ },
1190
+ "environment_checks_run_id_agent_runs_id_fk": {
1191
+ "name": "environment_checks_run_id_agent_runs_id_fk",
1192
+ "tableFrom": "environment_checks",
1193
+ "tableTo": "agent_runs",
1194
+ "columnsFrom": [
1195
+ "run_id"
1196
+ ],
1197
+ "columnsTo": [
1198
+ "id"
1199
+ ],
1200
+ "onDelete": "set null",
1201
+ "onUpdate": "no action"
1202
+ }
1203
+ },
1204
+ "compositePrimaryKeys": {},
1205
+ "uniqueConstraints": {},
1206
+ "policies": {},
1207
+ "checkConstraints": {},
1208
+ "isRLSEnabled": false
1209
+ },
1210
+ "public.error_events": {
1211
+ "name": "error_events",
1212
+ "schema": "",
1213
+ "columns": {
1214
+ "id": {
1215
+ "name": "id",
1216
+ "type": "uuid",
1217
+ "primaryKey": true,
1218
+ "notNull": true,
1219
+ "default": "gen_random_uuid()"
1220
+ },
1221
+ "at": {
1222
+ "name": "at",
1223
+ "type": "timestamp with time zone",
1224
+ "primaryKey": false,
1225
+ "notNull": true,
1226
+ "default": "now()"
1227
+ },
1228
+ "kind": {
1229
+ "name": "kind",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": true,
1233
+ "default": "'http'"
1234
+ },
1235
+ "method": {
1236
+ "name": "method",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": false
1240
+ },
1241
+ "path": {
1242
+ "name": "path",
1243
+ "type": "text",
1244
+ "primaryKey": false,
1245
+ "notNull": false
1246
+ },
1247
+ "status": {
1248
+ "name": "status",
1249
+ "type": "integer",
1250
+ "primaryKey": false,
1251
+ "notNull": false
1252
+ },
1253
+ "message": {
1254
+ "name": "message",
1255
+ "type": "text",
1256
+ "primaryKey": false,
1257
+ "notNull": true
1258
+ },
1259
+ "stack": {
1260
+ "name": "stack",
1261
+ "type": "text",
1262
+ "primaryKey": false,
1263
+ "notNull": false
1264
+ },
1265
+ "user_id": {
1266
+ "name": "user_id",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": false
1270
+ },
1271
+ "team_slug": {
1272
+ "name": "team_slug",
1273
+ "type": "text",
1274
+ "primaryKey": false,
1275
+ "notNull": false
1276
+ },
1277
+ "request_id": {
1278
+ "name": "request_id",
1279
+ "type": "text",
1280
+ "primaryKey": false,
1281
+ "notNull": false
1282
+ }
1283
+ },
1284
+ "indexes": {
1285
+ "error_events_at": {
1286
+ "name": "error_events_at",
1287
+ "columns": [
1288
+ {
1289
+ "expression": "at",
1290
+ "isExpression": false,
1291
+ "asc": false,
1292
+ "nulls": "last"
1293
+ }
1294
+ ],
1295
+ "isUnique": false,
1296
+ "concurrently": false,
1297
+ "method": "btree",
1298
+ "with": {}
1299
+ }
1300
+ },
1301
+ "foreignKeys": {},
1302
+ "compositePrimaryKeys": {},
1303
+ "uniqueConstraints": {},
1304
+ "policies": {},
1305
+ "checkConstraints": {},
1306
+ "isRLSEnabled": false
1307
+ },
1308
+ "public.invites": {
1309
+ "name": "invites",
1310
+ "schema": "",
1311
+ "columns": {
1312
+ "id": {
1313
+ "name": "id",
1314
+ "type": "uuid",
1315
+ "primaryKey": true,
1316
+ "notNull": true,
1317
+ "default": "gen_random_uuid()"
1318
+ },
1319
+ "team_id": {
1320
+ "name": "team_id",
1321
+ "type": "uuid",
1322
+ "primaryKey": false,
1323
+ "notNull": true
1324
+ },
1325
+ "code": {
1326
+ "name": "code",
1327
+ "type": "text",
1328
+ "primaryKey": false,
1329
+ "notNull": true
1330
+ },
1331
+ "created_by": {
1332
+ "name": "created_by",
1333
+ "type": "uuid",
1334
+ "primaryKey": false,
1335
+ "notNull": false
1336
+ },
1337
+ "expires_at": {
1338
+ "name": "expires_at",
1339
+ "type": "timestamp with time zone",
1340
+ "primaryKey": false,
1341
+ "notNull": true
1342
+ },
1343
+ "uses": {
1344
+ "name": "uses",
1345
+ "type": "integer",
1346
+ "primaryKey": false,
1347
+ "notNull": true,
1348
+ "default": 0
1349
+ },
1350
+ "max_uses": {
1351
+ "name": "max_uses",
1352
+ "type": "integer",
1353
+ "primaryKey": false,
1354
+ "notNull": false
1355
+ },
1356
+ "created_at": {
1357
+ "name": "created_at",
1358
+ "type": "timestamp with time zone",
1359
+ "primaryKey": false,
1360
+ "notNull": true,
1361
+ "default": "now()"
1362
+ }
1363
+ },
1364
+ "indexes": {},
1365
+ "foreignKeys": {
1366
+ "invites_team_id_teams_id_fk": {
1367
+ "name": "invites_team_id_teams_id_fk",
1368
+ "tableFrom": "invites",
1369
+ "tableTo": "teams",
1370
+ "columnsFrom": [
1371
+ "team_id"
1372
+ ],
1373
+ "columnsTo": [
1374
+ "id"
1375
+ ],
1376
+ "onDelete": "cascade",
1377
+ "onUpdate": "no action"
1378
+ },
1379
+ "invites_created_by_users_id_fk": {
1380
+ "name": "invites_created_by_users_id_fk",
1381
+ "tableFrom": "invites",
1382
+ "tableTo": "users",
1383
+ "columnsFrom": [
1384
+ "created_by"
1385
+ ],
1386
+ "columnsTo": [
1387
+ "id"
1388
+ ],
1389
+ "onDelete": "no action",
1390
+ "onUpdate": "no action"
1391
+ }
1392
+ },
1393
+ "compositePrimaryKeys": {},
1394
+ "uniqueConstraints": {
1395
+ "invites_code_unique": {
1396
+ "name": "invites_code_unique",
1397
+ "nullsNotDistinct": false,
1398
+ "columns": [
1399
+ "code"
1400
+ ]
1401
+ }
1402
+ },
1403
+ "policies": {},
1404
+ "checkConstraints": {},
1405
+ "isRLSEnabled": false
1406
+ },
1407
+ "public.memberships": {
1408
+ "name": "memberships",
1409
+ "schema": "",
1410
+ "columns": {
1411
+ "team_id": {
1412
+ "name": "team_id",
1413
+ "type": "uuid",
1414
+ "primaryKey": false,
1415
+ "notNull": true
1416
+ },
1417
+ "user_id": {
1418
+ "name": "user_id",
1419
+ "type": "uuid",
1420
+ "primaryKey": false,
1421
+ "notNull": true
1422
+ },
1423
+ "role": {
1424
+ "name": "role",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": true,
1428
+ "default": "'member'"
1429
+ },
1430
+ "created_at": {
1431
+ "name": "created_at",
1432
+ "type": "timestamp with time zone",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "default": "now()"
1436
+ }
1437
+ },
1438
+ "indexes": {},
1439
+ "foreignKeys": {
1440
+ "memberships_team_id_teams_id_fk": {
1441
+ "name": "memberships_team_id_teams_id_fk",
1442
+ "tableFrom": "memberships",
1443
+ "tableTo": "teams",
1444
+ "columnsFrom": [
1445
+ "team_id"
1446
+ ],
1447
+ "columnsTo": [
1448
+ "id"
1449
+ ],
1450
+ "onDelete": "cascade",
1451
+ "onUpdate": "no action"
1452
+ },
1453
+ "memberships_user_id_users_id_fk": {
1454
+ "name": "memberships_user_id_users_id_fk",
1455
+ "tableFrom": "memberships",
1456
+ "tableTo": "users",
1457
+ "columnsFrom": [
1458
+ "user_id"
1459
+ ],
1460
+ "columnsTo": [
1461
+ "id"
1462
+ ],
1463
+ "onDelete": "cascade",
1464
+ "onUpdate": "no action"
1465
+ }
1466
+ },
1467
+ "compositePrimaryKeys": {
1468
+ "memberships_team_id_user_id_pk": {
1469
+ "name": "memberships_team_id_user_id_pk",
1470
+ "columns": [
1471
+ "team_id",
1472
+ "user_id"
1473
+ ]
1474
+ }
1475
+ },
1476
+ "uniqueConstraints": {},
1477
+ "policies": {},
1478
+ "checkConstraints": {},
1479
+ "isRLSEnabled": false
1480
+ },
1481
+ "public.messages": {
1482
+ "name": "messages",
1483
+ "schema": "",
1484
+ "columns": {
1485
+ "id": {
1486
+ "name": "id",
1487
+ "type": "uuid",
1488
+ "primaryKey": true,
1489
+ "notNull": true,
1490
+ "default": "gen_random_uuid()"
1491
+ },
1492
+ "session_id": {
1493
+ "name": "session_id",
1494
+ "type": "uuid",
1495
+ "primaryKey": false,
1496
+ "notNull": true
1497
+ },
1498
+ "author_id": {
1499
+ "name": "author_id",
1500
+ "type": "uuid",
1501
+ "primaryKey": false,
1502
+ "notNull": false
1503
+ },
1504
+ "token_id": {
1505
+ "name": "token_id",
1506
+ "type": "uuid",
1507
+ "primaryKey": false,
1508
+ "notNull": false
1509
+ },
1510
+ "kind": {
1511
+ "name": "kind",
1512
+ "type": "text",
1513
+ "primaryKey": false,
1514
+ "notNull": true,
1515
+ "default": "'note'"
1516
+ },
1517
+ "via": {
1518
+ "name": "via",
1519
+ "type": "text",
1520
+ "primaryKey": false,
1521
+ "notNull": false
1522
+ },
1523
+ "body": {
1524
+ "name": "body",
1525
+ "type": "text",
1526
+ "primaryKey": false,
1527
+ "notNull": true
1528
+ },
1529
+ "attachments": {
1530
+ "name": "attachments",
1531
+ "type": "jsonb",
1532
+ "primaryKey": false,
1533
+ "notNull": false
1534
+ },
1535
+ "created_at": {
1536
+ "name": "created_at",
1537
+ "type": "timestamp with time zone",
1538
+ "primaryKey": false,
1539
+ "notNull": true,
1540
+ "default": "now()"
1541
+ }
1542
+ },
1543
+ "indexes": {
1544
+ "messages_session_created": {
1545
+ "name": "messages_session_created",
1546
+ "columns": [
1547
+ {
1548
+ "expression": "session_id",
1549
+ "isExpression": false,
1550
+ "asc": true,
1551
+ "nulls": "last"
1552
+ },
1553
+ {
1554
+ "expression": "created_at",
1555
+ "isExpression": false,
1556
+ "asc": true,
1557
+ "nulls": "last"
1558
+ }
1559
+ ],
1560
+ "isUnique": false,
1561
+ "concurrently": false,
1562
+ "method": "btree",
1563
+ "with": {}
1564
+ }
1565
+ },
1566
+ "foreignKeys": {
1567
+ "messages_session_id_debug_sessions_id_fk": {
1568
+ "name": "messages_session_id_debug_sessions_id_fk",
1569
+ "tableFrom": "messages",
1570
+ "tableTo": "debug_sessions",
1571
+ "columnsFrom": [
1572
+ "session_id"
1573
+ ],
1574
+ "columnsTo": [
1575
+ "id"
1576
+ ],
1577
+ "onDelete": "cascade",
1578
+ "onUpdate": "no action"
1579
+ },
1580
+ "messages_author_id_users_id_fk": {
1581
+ "name": "messages_author_id_users_id_fk",
1582
+ "tableFrom": "messages",
1583
+ "tableTo": "users",
1584
+ "columnsFrom": [
1585
+ "author_id"
1586
+ ],
1587
+ "columnsTo": [
1588
+ "id"
1589
+ ],
1590
+ "onDelete": "no action",
1591
+ "onUpdate": "no action"
1592
+ },
1593
+ "messages_token_id_tokens_id_fk": {
1594
+ "name": "messages_token_id_tokens_id_fk",
1595
+ "tableFrom": "messages",
1596
+ "tableTo": "tokens",
1597
+ "columnsFrom": [
1598
+ "token_id"
1599
+ ],
1600
+ "columnsTo": [
1601
+ "id"
1602
+ ],
1603
+ "onDelete": "set null",
1604
+ "onUpdate": "no action"
1605
+ }
1606
+ },
1607
+ "compositePrimaryKeys": {},
1608
+ "uniqueConstraints": {},
1609
+ "policies": {},
1610
+ "checkConstraints": {},
1611
+ "isRLSEnabled": false
1612
+ },
1613
+ "public.notification_prefs": {
1614
+ "name": "notification_prefs",
1615
+ "schema": "",
1616
+ "columns": {
1617
+ "user_id": {
1618
+ "name": "user_id",
1619
+ "type": "uuid",
1620
+ "primaryKey": true,
1621
+ "notNull": true
1622
+ },
1623
+ "session_reply": {
1624
+ "name": "session_reply",
1625
+ "type": "boolean",
1626
+ "primaryKey": false,
1627
+ "notNull": true,
1628
+ "default": true
1629
+ },
1630
+ "session_resolved": {
1631
+ "name": "session_resolved",
1632
+ "type": "boolean",
1633
+ "primaryKey": false,
1634
+ "notNull": true,
1635
+ "default": true
1636
+ },
1637
+ "team_joined": {
1638
+ "name": "team_joined",
1639
+ "type": "boolean",
1640
+ "primaryKey": false,
1641
+ "notNull": true,
1642
+ "default": true
1643
+ },
1644
+ "announcements": {
1645
+ "name": "announcements",
1646
+ "type": "boolean",
1647
+ "primaryKey": false,
1648
+ "notNull": true,
1649
+ "default": false
1650
+ },
1651
+ "webhook_url": {
1652
+ "name": "webhook_url",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": false
1656
+ },
1657
+ "updated_at": {
1658
+ "name": "updated_at",
1659
+ "type": "timestamp with time zone",
1660
+ "primaryKey": false,
1661
+ "notNull": true,
1662
+ "default": "now()"
1663
+ }
1664
+ },
1665
+ "indexes": {},
1666
+ "foreignKeys": {
1667
+ "notification_prefs_user_id_users_id_fk": {
1668
+ "name": "notification_prefs_user_id_users_id_fk",
1669
+ "tableFrom": "notification_prefs",
1670
+ "tableTo": "users",
1671
+ "columnsFrom": [
1672
+ "user_id"
1673
+ ],
1674
+ "columnsTo": [
1675
+ "id"
1676
+ ],
1677
+ "onDelete": "cascade",
1678
+ "onUpdate": "no action"
1679
+ }
1680
+ },
1681
+ "compositePrimaryKeys": {},
1682
+ "uniqueConstraints": {},
1683
+ "policies": {},
1684
+ "checkConstraints": {},
1685
+ "isRLSEnabled": false
1686
+ },
1687
+ "public.notification_queue": {
1688
+ "name": "notification_queue",
1689
+ "schema": "",
1690
+ "columns": {
1691
+ "id": {
1692
+ "name": "id",
1693
+ "type": "uuid",
1694
+ "primaryKey": true,
1695
+ "notNull": true,
1696
+ "default": "gen_random_uuid()"
1697
+ },
1698
+ "user_id": {
1699
+ "name": "user_id",
1700
+ "type": "uuid",
1701
+ "primaryKey": false,
1702
+ "notNull": true
1703
+ },
1704
+ "kind": {
1705
+ "name": "kind",
1706
+ "type": "text",
1707
+ "primaryKey": false,
1708
+ "notNull": true
1709
+ },
1710
+ "coalesce_key": {
1711
+ "name": "coalesce_key",
1712
+ "type": "text",
1713
+ "primaryKey": false,
1714
+ "notNull": true
1715
+ },
1716
+ "team_id": {
1717
+ "name": "team_id",
1718
+ "type": "uuid",
1719
+ "primaryKey": false,
1720
+ "notNull": false
1721
+ },
1722
+ "session_id": {
1723
+ "name": "session_id",
1724
+ "type": "uuid",
1725
+ "primaryKey": false,
1726
+ "notNull": false
1727
+ },
1728
+ "since_at": {
1729
+ "name": "since_at",
1730
+ "type": "timestamp with time zone",
1731
+ "primaryKey": false,
1732
+ "notNull": true,
1733
+ "default": "now()"
1734
+ },
1735
+ "not_before": {
1736
+ "name": "not_before",
1737
+ "type": "timestamp with time zone",
1738
+ "primaryKey": false,
1739
+ "notNull": true
1740
+ },
1741
+ "status": {
1742
+ "name": "status",
1743
+ "type": "text",
1744
+ "primaryKey": false,
1745
+ "notNull": true,
1746
+ "default": "'pending'"
1747
+ },
1748
+ "reason": {
1749
+ "name": "reason",
1750
+ "type": "text",
1751
+ "primaryKey": false,
1752
+ "notNull": false
1753
+ },
1754
+ "sent_at": {
1755
+ "name": "sent_at",
1756
+ "type": "timestamp with time zone",
1757
+ "primaryKey": false,
1758
+ "notNull": false
1759
+ },
1760
+ "created_at": {
1761
+ "name": "created_at",
1762
+ "type": "timestamp with time zone",
1763
+ "primaryKey": false,
1764
+ "notNull": true,
1765
+ "default": "now()"
1766
+ }
1767
+ },
1768
+ "indexes": {
1769
+ "notification_queue_pending": {
1770
+ "name": "notification_queue_pending",
1771
+ "columns": [
1772
+ {
1773
+ "expression": "user_id",
1774
+ "isExpression": false,
1775
+ "asc": true,
1776
+ "nulls": "last"
1777
+ },
1778
+ {
1779
+ "expression": "coalesce_key",
1780
+ "isExpression": false,
1781
+ "asc": true,
1782
+ "nulls": "last"
1783
+ }
1784
+ ],
1785
+ "isUnique": true,
1786
+ "where": "status = 'pending'",
1787
+ "concurrently": false,
1788
+ "method": "btree",
1789
+ "with": {}
1790
+ },
1791
+ "notification_queue_due": {
1792
+ "name": "notification_queue_due",
1793
+ "columns": [
1794
+ {
1795
+ "expression": "status",
1796
+ "isExpression": false,
1797
+ "asc": true,
1798
+ "nulls": "last"
1799
+ },
1800
+ {
1801
+ "expression": "not_before",
1802
+ "isExpression": false,
1803
+ "asc": true,
1804
+ "nulls": "last"
1805
+ }
1806
+ ],
1807
+ "isUnique": false,
1808
+ "concurrently": false,
1809
+ "method": "btree",
1810
+ "with": {}
1811
+ },
1812
+ "notification_queue_user_sent": {
1813
+ "name": "notification_queue_user_sent",
1814
+ "columns": [
1815
+ {
1816
+ "expression": "user_id",
1817
+ "isExpression": false,
1818
+ "asc": true,
1819
+ "nulls": "last"
1820
+ },
1821
+ {
1822
+ "expression": "sent_at",
1823
+ "isExpression": false,
1824
+ "asc": true,
1825
+ "nulls": "last"
1826
+ }
1827
+ ],
1828
+ "isUnique": false,
1829
+ "concurrently": false,
1830
+ "method": "btree",
1831
+ "with": {}
1832
+ }
1833
+ },
1834
+ "foreignKeys": {
1835
+ "notification_queue_user_id_users_id_fk": {
1836
+ "name": "notification_queue_user_id_users_id_fk",
1837
+ "tableFrom": "notification_queue",
1838
+ "tableTo": "users",
1839
+ "columnsFrom": [
1840
+ "user_id"
1841
+ ],
1842
+ "columnsTo": [
1843
+ "id"
1844
+ ],
1845
+ "onDelete": "cascade",
1846
+ "onUpdate": "no action"
1847
+ },
1848
+ "notification_queue_team_id_teams_id_fk": {
1849
+ "name": "notification_queue_team_id_teams_id_fk",
1850
+ "tableFrom": "notification_queue",
1851
+ "tableTo": "teams",
1852
+ "columnsFrom": [
1853
+ "team_id"
1854
+ ],
1855
+ "columnsTo": [
1856
+ "id"
1857
+ ],
1858
+ "onDelete": "cascade",
1859
+ "onUpdate": "no action"
1860
+ },
1861
+ "notification_queue_session_id_debug_sessions_id_fk": {
1862
+ "name": "notification_queue_session_id_debug_sessions_id_fk",
1863
+ "tableFrom": "notification_queue",
1864
+ "tableTo": "debug_sessions",
1865
+ "columnsFrom": [
1866
+ "session_id"
1867
+ ],
1868
+ "columnsTo": [
1869
+ "id"
1870
+ ],
1871
+ "onDelete": "cascade",
1872
+ "onUpdate": "no action"
1873
+ }
1874
+ },
1875
+ "compositePrimaryKeys": {},
1876
+ "uniqueConstraints": {},
1877
+ "policies": {},
1878
+ "checkConstraints": {},
1879
+ "isRLSEnabled": false
1880
+ },
1881
+ "public.policy_bundles": {
1882
+ "name": "policy_bundles",
1883
+ "schema": "",
1884
+ "columns": {
1885
+ "id": {
1886
+ "name": "id",
1887
+ "type": "uuid",
1888
+ "primaryKey": true,
1889
+ "notNull": true,
1890
+ "default": "gen_random_uuid()"
1891
+ },
1892
+ "team_id": {
1893
+ "name": "team_id",
1894
+ "type": "uuid",
1895
+ "primaryKey": false,
1896
+ "notNull": true
1897
+ },
1898
+ "project_id": {
1899
+ "name": "project_id",
1900
+ "type": "uuid",
1901
+ "primaryKey": false,
1902
+ "notNull": false
1903
+ },
1904
+ "scope_key": {
1905
+ "name": "scope_key",
1906
+ "type": "text",
1907
+ "primaryKey": false,
1908
+ "notNull": true
1909
+ },
1910
+ "version": {
1911
+ "name": "version",
1912
+ "type": "integer",
1913
+ "primaryKey": false,
1914
+ "notNull": true
1915
+ },
1916
+ "status": {
1917
+ "name": "status",
1918
+ "type": "text",
1919
+ "primaryKey": false,
1920
+ "notNull": true,
1921
+ "default": "'active'"
1922
+ },
1923
+ "document": {
1924
+ "name": "document",
1925
+ "type": "jsonb",
1926
+ "primaryKey": false,
1927
+ "notNull": true
1928
+ },
1929
+ "hash": {
1930
+ "name": "hash",
1931
+ "type": "text",
1932
+ "primaryKey": false,
1933
+ "notNull": true
1934
+ },
1935
+ "created_by": {
1936
+ "name": "created_by",
1937
+ "type": "uuid",
1938
+ "primaryKey": false,
1939
+ "notNull": false
1940
+ },
1941
+ "created_at": {
1942
+ "name": "created_at",
1943
+ "type": "timestamp with time zone",
1944
+ "primaryKey": false,
1945
+ "notNull": true,
1946
+ "default": "now()"
1947
+ }
1948
+ },
1949
+ "indexes": {
1950
+ "policy_bundles_team_scope_version": {
1951
+ "name": "policy_bundles_team_scope_version",
1952
+ "columns": [
1953
+ {
1954
+ "expression": "team_id",
1955
+ "isExpression": false,
1956
+ "asc": true,
1957
+ "nulls": "last"
1958
+ },
1959
+ {
1960
+ "expression": "scope_key",
1961
+ "isExpression": false,
1962
+ "asc": true,
1963
+ "nulls": "last"
1964
+ },
1965
+ {
1966
+ "expression": "version",
1967
+ "isExpression": false,
1968
+ "asc": true,
1969
+ "nulls": "last"
1970
+ }
1971
+ ],
1972
+ "isUnique": true,
1973
+ "concurrently": false,
1974
+ "method": "btree",
1975
+ "with": {}
1976
+ }
1977
+ },
1978
+ "foreignKeys": {
1979
+ "policy_bundles_team_id_teams_id_fk": {
1980
+ "name": "policy_bundles_team_id_teams_id_fk",
1981
+ "tableFrom": "policy_bundles",
1982
+ "tableTo": "teams",
1983
+ "columnsFrom": [
1984
+ "team_id"
1985
+ ],
1986
+ "columnsTo": [
1987
+ "id"
1988
+ ],
1989
+ "onDelete": "cascade",
1990
+ "onUpdate": "no action"
1991
+ },
1992
+ "policy_bundles_project_id_projects_id_fk": {
1993
+ "name": "policy_bundles_project_id_projects_id_fk",
1994
+ "tableFrom": "policy_bundles",
1995
+ "tableTo": "projects",
1996
+ "columnsFrom": [
1997
+ "project_id"
1998
+ ],
1999
+ "columnsTo": [
2000
+ "id"
2001
+ ],
2002
+ "onDelete": "cascade",
2003
+ "onUpdate": "no action"
2004
+ },
2005
+ "policy_bundles_created_by_users_id_fk": {
2006
+ "name": "policy_bundles_created_by_users_id_fk",
2007
+ "tableFrom": "policy_bundles",
2008
+ "tableTo": "users",
2009
+ "columnsFrom": [
2010
+ "created_by"
2011
+ ],
2012
+ "columnsTo": [
2013
+ "id"
2014
+ ],
2015
+ "onDelete": "set null",
2016
+ "onUpdate": "no action"
2017
+ }
2018
+ },
2019
+ "compositePrimaryKeys": {},
2020
+ "uniqueConstraints": {},
2021
+ "policies": {},
2022
+ "checkConstraints": {},
2023
+ "isRLSEnabled": false
2024
+ },
2025
+ "public.policy_receipts": {
2026
+ "name": "policy_receipts",
2027
+ "schema": "",
2028
+ "columns": {
2029
+ "run_id": {
2030
+ "name": "run_id",
2031
+ "type": "uuid",
2032
+ "primaryKey": true,
2033
+ "notNull": true
2034
+ },
2035
+ "expected_hash": {
2036
+ "name": "expected_hash",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": true
2040
+ },
2041
+ "reported_hash": {
2042
+ "name": "reported_hash",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": false
2046
+ },
2047
+ "drift": {
2048
+ "name": "drift",
2049
+ "type": "boolean",
2050
+ "primaryKey": false,
2051
+ "notNull": true,
2052
+ "default": false
2053
+ },
2054
+ "created_at": {
2055
+ "name": "created_at",
2056
+ "type": "timestamp with time zone",
2057
+ "primaryKey": false,
2058
+ "notNull": true,
2059
+ "default": "now()"
2060
+ }
2061
+ },
2062
+ "indexes": {},
2063
+ "foreignKeys": {
2064
+ "policy_receipts_run_id_agent_runs_id_fk": {
2065
+ "name": "policy_receipts_run_id_agent_runs_id_fk",
2066
+ "tableFrom": "policy_receipts",
2067
+ "tableTo": "agent_runs",
2068
+ "columnsFrom": [
2069
+ "run_id"
2070
+ ],
2071
+ "columnsTo": [
2072
+ "id"
2073
+ ],
2074
+ "onDelete": "cascade",
2075
+ "onUpdate": "no action"
2076
+ }
2077
+ },
2078
+ "compositePrimaryKeys": {},
2079
+ "uniqueConstraints": {},
2080
+ "policies": {},
2081
+ "checkConstraints": {},
2082
+ "isRLSEnabled": false
2083
+ },
2084
+ "public.projects": {
2085
+ "name": "projects",
2086
+ "schema": "",
2087
+ "columns": {
2088
+ "id": {
2089
+ "name": "id",
2090
+ "type": "uuid",
2091
+ "primaryKey": true,
2092
+ "notNull": true,
2093
+ "default": "gen_random_uuid()"
2094
+ },
2095
+ "team_id": {
2096
+ "name": "team_id",
2097
+ "type": "uuid",
2098
+ "primaryKey": false,
2099
+ "notNull": true
2100
+ },
2101
+ "name": {
2102
+ "name": "name",
2103
+ "type": "text",
2104
+ "primaryKey": false,
2105
+ "notNull": true
2106
+ },
2107
+ "slug": {
2108
+ "name": "slug",
2109
+ "type": "text",
2110
+ "primaryKey": false,
2111
+ "notNull": true
2112
+ },
2113
+ "created_by": {
2114
+ "name": "created_by",
2115
+ "type": "uuid",
2116
+ "primaryKey": false,
2117
+ "notNull": false
2118
+ },
2119
+ "created_at": {
2120
+ "name": "created_at",
2121
+ "type": "timestamp with time zone",
2122
+ "primaryKey": false,
2123
+ "notNull": true,
2124
+ "default": "now()"
2125
+ }
2126
+ },
2127
+ "indexes": {
2128
+ "projects_team_slug": {
2129
+ "name": "projects_team_slug",
2130
+ "columns": [
2131
+ {
2132
+ "expression": "team_id",
2133
+ "isExpression": false,
2134
+ "asc": true,
2135
+ "nulls": "last"
2136
+ },
2137
+ {
2138
+ "expression": "slug",
2139
+ "isExpression": false,
2140
+ "asc": true,
2141
+ "nulls": "last"
2142
+ }
2143
+ ],
2144
+ "isUnique": true,
2145
+ "concurrently": false,
2146
+ "method": "btree",
2147
+ "with": {}
2148
+ }
2149
+ },
2150
+ "foreignKeys": {
2151
+ "projects_team_id_teams_id_fk": {
2152
+ "name": "projects_team_id_teams_id_fk",
2153
+ "tableFrom": "projects",
2154
+ "tableTo": "teams",
2155
+ "columnsFrom": [
2156
+ "team_id"
2157
+ ],
2158
+ "columnsTo": [
2159
+ "id"
2160
+ ],
2161
+ "onDelete": "cascade",
2162
+ "onUpdate": "no action"
2163
+ },
2164
+ "projects_created_by_users_id_fk": {
2165
+ "name": "projects_created_by_users_id_fk",
2166
+ "tableFrom": "projects",
2167
+ "tableTo": "users",
2168
+ "columnsFrom": [
2169
+ "created_by"
2170
+ ],
2171
+ "columnsTo": [
2172
+ "id"
2173
+ ],
2174
+ "onDelete": "no action",
2175
+ "onUpdate": "no action"
2176
+ }
2177
+ },
2178
+ "compositePrimaryKeys": {},
2179
+ "uniqueConstraints": {},
2180
+ "policies": {},
2181
+ "checkConstraints": {},
2182
+ "isRLSEnabled": false
2183
+ },
2184
+ "public.rate_counters": {
2185
+ "name": "rate_counters",
2186
+ "schema": "",
2187
+ "columns": {
2188
+ "key": {
2189
+ "name": "key",
2190
+ "type": "text",
2191
+ "primaryKey": true,
2192
+ "notNull": true
2193
+ },
2194
+ "count": {
2195
+ "name": "count",
2196
+ "type": "integer",
2197
+ "primaryKey": false,
2198
+ "notNull": true,
2199
+ "default": 0
2200
+ },
2201
+ "expires_at": {
2202
+ "name": "expires_at",
2203
+ "type": "timestamp with time zone",
2204
+ "primaryKey": false,
2205
+ "notNull": true
2206
+ }
2207
+ },
2208
+ "indexes": {
2209
+ "rate_counters_expires": {
2210
+ "name": "rate_counters_expires",
2211
+ "columns": [
2212
+ {
2213
+ "expression": "expires_at",
2214
+ "isExpression": false,
2215
+ "asc": true,
2216
+ "nulls": "last"
2217
+ }
2218
+ ],
2219
+ "isUnique": false,
2220
+ "concurrently": false,
2221
+ "method": "btree",
2222
+ "with": {}
2223
+ }
2224
+ },
2225
+ "foreignKeys": {},
2226
+ "compositePrimaryKeys": {},
2227
+ "uniqueConstraints": {},
2228
+ "policies": {},
2229
+ "checkConstraints": {},
2230
+ "isRLSEnabled": false
2231
+ },
2232
+ "public.read_state": {
2233
+ "name": "read_state",
2234
+ "schema": "",
2235
+ "columns": {
2236
+ "user_id": {
2237
+ "name": "user_id",
2238
+ "type": "uuid",
2239
+ "primaryKey": false,
2240
+ "notNull": true
2241
+ },
2242
+ "session_id": {
2243
+ "name": "session_id",
2244
+ "type": "uuid",
2245
+ "primaryKey": false,
2246
+ "notNull": true
2247
+ },
2248
+ "last_read_at": {
2249
+ "name": "last_read_at",
2250
+ "type": "timestamp with time zone",
2251
+ "primaryKey": false,
2252
+ "notNull": true,
2253
+ "default": "now()"
2254
+ }
2255
+ },
2256
+ "indexes": {},
2257
+ "foreignKeys": {
2258
+ "read_state_user_id_users_id_fk": {
2259
+ "name": "read_state_user_id_users_id_fk",
2260
+ "tableFrom": "read_state",
2261
+ "tableTo": "users",
2262
+ "columnsFrom": [
2263
+ "user_id"
2264
+ ],
2265
+ "columnsTo": [
2266
+ "id"
2267
+ ],
2268
+ "onDelete": "cascade",
2269
+ "onUpdate": "no action"
2270
+ },
2271
+ "read_state_session_id_debug_sessions_id_fk": {
2272
+ "name": "read_state_session_id_debug_sessions_id_fk",
2273
+ "tableFrom": "read_state",
2274
+ "tableTo": "debug_sessions",
2275
+ "columnsFrom": [
2276
+ "session_id"
2277
+ ],
2278
+ "columnsTo": [
2279
+ "id"
2280
+ ],
2281
+ "onDelete": "cascade",
2282
+ "onUpdate": "no action"
2283
+ }
2284
+ },
2285
+ "compositePrimaryKeys": {
2286
+ "read_state_user_id_session_id_pk": {
2287
+ "name": "read_state_user_id_session_id_pk",
2288
+ "columns": [
2289
+ "user_id",
2290
+ "session_id"
2291
+ ]
2292
+ }
2293
+ },
2294
+ "uniqueConstraints": {},
2295
+ "policies": {},
2296
+ "checkConstraints": {},
2297
+ "isRLSEnabled": false
2298
+ },
2299
+ "public.snapshots": {
2300
+ "name": "snapshots",
2301
+ "schema": "",
2302
+ "columns": {
2303
+ "id": {
2304
+ "name": "id",
2305
+ "type": "uuid",
2306
+ "primaryKey": true,
2307
+ "notNull": true,
2308
+ "default": "gen_random_uuid()"
2309
+ },
2310
+ "team_id": {
2311
+ "name": "team_id",
2312
+ "type": "uuid",
2313
+ "primaryKey": false,
2314
+ "notNull": true
2315
+ },
2316
+ "user_id": {
2317
+ "name": "user_id",
2318
+ "type": "uuid",
2319
+ "primaryKey": false,
2320
+ "notNull": true
2321
+ },
2322
+ "repo": {
2323
+ "name": "repo",
2324
+ "type": "text",
2325
+ "primaryKey": false,
2326
+ "notNull": false
2327
+ },
2328
+ "project_id": {
2329
+ "name": "project_id",
2330
+ "type": "uuid",
2331
+ "primaryKey": false,
2332
+ "notNull": false
2333
+ },
2334
+ "token_id": {
2335
+ "name": "token_id",
2336
+ "type": "uuid",
2337
+ "primaryKey": false,
2338
+ "notNull": false
2339
+ },
2340
+ "device_label": {
2341
+ "name": "device_label",
2342
+ "type": "text",
2343
+ "primaryKey": false,
2344
+ "notNull": true,
2345
+ "default": "'default'"
2346
+ },
2347
+ "device_id": {
2348
+ "name": "device_id",
2349
+ "type": "uuid",
2350
+ "primaryKey": false,
2351
+ "notNull": false
2352
+ },
2353
+ "data": {
2354
+ "name": "data",
2355
+ "type": "jsonb",
2356
+ "primaryKey": false,
2357
+ "notNull": true
2358
+ },
2359
+ "created_at": {
2360
+ "name": "created_at",
2361
+ "type": "timestamp with time zone",
2362
+ "primaryKey": false,
2363
+ "notNull": true,
2364
+ "default": "now()"
2365
+ }
2366
+ },
2367
+ "indexes": {
2368
+ "snapshots_team_user_created": {
2369
+ "name": "snapshots_team_user_created",
2370
+ "columns": [
2371
+ {
2372
+ "expression": "team_id",
2373
+ "isExpression": false,
2374
+ "asc": true,
2375
+ "nulls": "last"
2376
+ },
2377
+ {
2378
+ "expression": "user_id",
2379
+ "isExpression": false,
2380
+ "asc": true,
2381
+ "nulls": "last"
2382
+ },
2383
+ {
2384
+ "expression": "created_at",
2385
+ "isExpression": false,
2386
+ "asc": true,
2387
+ "nulls": "last"
2388
+ }
2389
+ ],
2390
+ "isUnique": false,
2391
+ "concurrently": false,
2392
+ "method": "btree",
2393
+ "with": {}
2394
+ },
2395
+ "snapshots_team_user_device_created": {
2396
+ "name": "snapshots_team_user_device_created",
2397
+ "columns": [
2398
+ {
2399
+ "expression": "team_id",
2400
+ "isExpression": false,
2401
+ "asc": true,
2402
+ "nulls": "last"
2403
+ },
2404
+ {
2405
+ "expression": "user_id",
2406
+ "isExpression": false,
2407
+ "asc": true,
2408
+ "nulls": "last"
2409
+ },
2410
+ {
2411
+ "expression": "device_label",
2412
+ "isExpression": false,
2413
+ "asc": true,
2414
+ "nulls": "last"
2415
+ },
2416
+ {
2417
+ "expression": "created_at",
2418
+ "isExpression": false,
2419
+ "asc": true,
2420
+ "nulls": "last"
2421
+ }
2422
+ ],
2423
+ "isUnique": false,
2424
+ "concurrently": false,
2425
+ "method": "btree",
2426
+ "with": {}
2427
+ }
2428
+ },
2429
+ "foreignKeys": {
2430
+ "snapshots_team_id_teams_id_fk": {
2431
+ "name": "snapshots_team_id_teams_id_fk",
2432
+ "tableFrom": "snapshots",
2433
+ "tableTo": "teams",
2434
+ "columnsFrom": [
2435
+ "team_id"
2436
+ ],
2437
+ "columnsTo": [
2438
+ "id"
2439
+ ],
2440
+ "onDelete": "cascade",
2441
+ "onUpdate": "no action"
2442
+ },
2443
+ "snapshots_user_id_users_id_fk": {
2444
+ "name": "snapshots_user_id_users_id_fk",
2445
+ "tableFrom": "snapshots",
2446
+ "tableTo": "users",
2447
+ "columnsFrom": [
2448
+ "user_id"
2449
+ ],
2450
+ "columnsTo": [
2451
+ "id"
2452
+ ],
2453
+ "onDelete": "cascade",
2454
+ "onUpdate": "no action"
2455
+ },
2456
+ "snapshots_project_id_projects_id_fk": {
2457
+ "name": "snapshots_project_id_projects_id_fk",
2458
+ "tableFrom": "snapshots",
2459
+ "tableTo": "projects",
2460
+ "columnsFrom": [
2461
+ "project_id"
2462
+ ],
2463
+ "columnsTo": [
2464
+ "id"
2465
+ ],
2466
+ "onDelete": "cascade",
2467
+ "onUpdate": "no action"
2468
+ },
2469
+ "snapshots_token_id_tokens_id_fk": {
2470
+ "name": "snapshots_token_id_tokens_id_fk",
2471
+ "tableFrom": "snapshots",
2472
+ "tableTo": "tokens",
2473
+ "columnsFrom": [
2474
+ "token_id"
2475
+ ],
2476
+ "columnsTo": [
2477
+ "id"
2478
+ ],
2479
+ "onDelete": "set null",
2480
+ "onUpdate": "no action"
2481
+ },
2482
+ "snapshots_device_id_agent_installations_id_fk": {
2483
+ "name": "snapshots_device_id_agent_installations_id_fk",
2484
+ "tableFrom": "snapshots",
2485
+ "tableTo": "agent_installations",
2486
+ "columnsFrom": [
2487
+ "device_id"
2488
+ ],
2489
+ "columnsTo": [
2490
+ "id"
2491
+ ],
2492
+ "onDelete": "set null",
2493
+ "onUpdate": "no action"
2494
+ }
2495
+ },
2496
+ "compositePrimaryKeys": {},
2497
+ "uniqueConstraints": {},
2498
+ "policies": {},
2499
+ "checkConstraints": {},
2500
+ "isRLSEnabled": false
2501
+ },
2502
+ "public.team_integrations": {
2503
+ "name": "team_integrations",
2504
+ "schema": "",
2505
+ "columns": {
2506
+ "id": {
2507
+ "name": "id",
2508
+ "type": "uuid",
2509
+ "primaryKey": true,
2510
+ "notNull": true,
2511
+ "default": "gen_random_uuid()"
2512
+ },
2513
+ "team_id": {
2514
+ "name": "team_id",
2515
+ "type": "uuid",
2516
+ "primaryKey": false,
2517
+ "notNull": true
2518
+ },
2519
+ "provider": {
2520
+ "name": "provider",
2521
+ "type": "text",
2522
+ "primaryKey": false,
2523
+ "notNull": true,
2524
+ "default": "'github'"
2525
+ },
2526
+ "repo": {
2527
+ "name": "repo",
2528
+ "type": "text",
2529
+ "primaryKey": false,
2530
+ "notNull": true
2531
+ },
2532
+ "token": {
2533
+ "name": "token",
2534
+ "type": "text",
2535
+ "primaryKey": false,
2536
+ "notNull": true
2537
+ },
2538
+ "comment_on_finish": {
2539
+ "name": "comment_on_finish",
2540
+ "type": "boolean",
2541
+ "primaryKey": false,
2542
+ "notNull": true,
2543
+ "default": true
2544
+ },
2545
+ "created_by": {
2546
+ "name": "created_by",
2547
+ "type": "uuid",
2548
+ "primaryKey": false,
2549
+ "notNull": false
2550
+ },
2551
+ "created_at": {
2552
+ "name": "created_at",
2553
+ "type": "timestamp with time zone",
2554
+ "primaryKey": false,
2555
+ "notNull": true,
2556
+ "default": "now()"
2557
+ },
2558
+ "updated_at": {
2559
+ "name": "updated_at",
2560
+ "type": "timestamp with time zone",
2561
+ "primaryKey": false,
2562
+ "notNull": true,
2563
+ "default": "now()"
2564
+ }
2565
+ },
2566
+ "indexes": {
2567
+ "team_integrations_team_provider": {
2568
+ "name": "team_integrations_team_provider",
2569
+ "columns": [
2570
+ {
2571
+ "expression": "team_id",
2572
+ "isExpression": false,
2573
+ "asc": true,
2574
+ "nulls": "last"
2575
+ },
2576
+ {
2577
+ "expression": "provider",
2578
+ "isExpression": false,
2579
+ "asc": true,
2580
+ "nulls": "last"
2581
+ }
2582
+ ],
2583
+ "isUnique": true,
2584
+ "concurrently": false,
2585
+ "method": "btree",
2586
+ "with": {}
2587
+ }
2588
+ },
2589
+ "foreignKeys": {
2590
+ "team_integrations_team_id_teams_id_fk": {
2591
+ "name": "team_integrations_team_id_teams_id_fk",
2592
+ "tableFrom": "team_integrations",
2593
+ "tableTo": "teams",
2594
+ "columnsFrom": [
2595
+ "team_id"
2596
+ ],
2597
+ "columnsTo": [
2598
+ "id"
2599
+ ],
2600
+ "onDelete": "cascade",
2601
+ "onUpdate": "no action"
2602
+ },
2603
+ "team_integrations_created_by_users_id_fk": {
2604
+ "name": "team_integrations_created_by_users_id_fk",
2605
+ "tableFrom": "team_integrations",
2606
+ "tableTo": "users",
2607
+ "columnsFrom": [
2608
+ "created_by"
2609
+ ],
2610
+ "columnsTo": [
2611
+ "id"
2612
+ ],
2613
+ "onDelete": "set null",
2614
+ "onUpdate": "no action"
2615
+ }
2616
+ },
2617
+ "compositePrimaryKeys": {},
2618
+ "uniqueConstraints": {},
2619
+ "policies": {},
2620
+ "checkConstraints": {},
2621
+ "isRLSEnabled": false
2622
+ },
2623
+ "public.teams": {
2624
+ "name": "teams",
2625
+ "schema": "",
2626
+ "columns": {
2627
+ "id": {
2628
+ "name": "id",
2629
+ "type": "uuid",
2630
+ "primaryKey": true,
2631
+ "notNull": true,
2632
+ "default": "gen_random_uuid()"
2633
+ },
2634
+ "name": {
2635
+ "name": "name",
2636
+ "type": "text",
2637
+ "primaryKey": false,
2638
+ "notNull": true
2639
+ },
2640
+ "slug": {
2641
+ "name": "slug",
2642
+ "type": "text",
2643
+ "primaryKey": false,
2644
+ "notNull": true
2645
+ },
2646
+ "created_by": {
2647
+ "name": "created_by",
2648
+ "type": "uuid",
2649
+ "primaryKey": false,
2650
+ "notNull": false
2651
+ },
2652
+ "webhook_url": {
2653
+ "name": "webhook_url",
2654
+ "type": "text",
2655
+ "primaryKey": false,
2656
+ "notNull": false
2657
+ },
2658
+ "plan": {
2659
+ "name": "plan",
2660
+ "type": "text",
2661
+ "primaryKey": false,
2662
+ "notNull": true,
2663
+ "default": "'free'"
2664
+ },
2665
+ "inbound_token": {
2666
+ "name": "inbound_token",
2667
+ "type": "text",
2668
+ "primaryKey": false,
2669
+ "notNull": false
2670
+ },
2671
+ "created_at": {
2672
+ "name": "created_at",
2673
+ "type": "timestamp with time zone",
2674
+ "primaryKey": false,
2675
+ "notNull": true,
2676
+ "default": "now()"
2677
+ }
2678
+ },
2679
+ "indexes": {},
2680
+ "foreignKeys": {
2681
+ "teams_created_by_users_id_fk": {
2682
+ "name": "teams_created_by_users_id_fk",
2683
+ "tableFrom": "teams",
2684
+ "tableTo": "users",
2685
+ "columnsFrom": [
2686
+ "created_by"
2687
+ ],
2688
+ "columnsTo": [
2689
+ "id"
2690
+ ],
2691
+ "onDelete": "no action",
2692
+ "onUpdate": "no action"
2693
+ }
2694
+ },
2695
+ "compositePrimaryKeys": {},
2696
+ "uniqueConstraints": {
2697
+ "teams_slug_unique": {
2698
+ "name": "teams_slug_unique",
2699
+ "nullsNotDistinct": false,
2700
+ "columns": [
2701
+ "slug"
2702
+ ]
2703
+ },
2704
+ "teams_inbound_token_unique": {
2705
+ "name": "teams_inbound_token_unique",
2706
+ "nullsNotDistinct": false,
2707
+ "columns": [
2708
+ "inbound_token"
2709
+ ]
2710
+ }
2711
+ },
2712
+ "policies": {},
2713
+ "checkConstraints": {},
2714
+ "isRLSEnabled": false
2715
+ },
2716
+ "public.tokens": {
2717
+ "name": "tokens",
2718
+ "schema": "",
2719
+ "columns": {
2720
+ "id": {
2721
+ "name": "id",
2722
+ "type": "uuid",
2723
+ "primaryKey": true,
2724
+ "notNull": true,
2725
+ "default": "gen_random_uuid()"
2726
+ },
2727
+ "user_id": {
2728
+ "name": "user_id",
2729
+ "type": "uuid",
2730
+ "primaryKey": false,
2731
+ "notNull": true
2732
+ },
2733
+ "name": {
2734
+ "name": "name",
2735
+ "type": "text",
2736
+ "primaryKey": false,
2737
+ "notNull": true
2738
+ },
2739
+ "token_hash": {
2740
+ "name": "token_hash",
2741
+ "type": "text",
2742
+ "primaryKey": false,
2743
+ "notNull": true
2744
+ },
2745
+ "prefix": {
2746
+ "name": "prefix",
2747
+ "type": "text",
2748
+ "primaryKey": false,
2749
+ "notNull": true
2750
+ },
2751
+ "last_used_at": {
2752
+ "name": "last_used_at",
2753
+ "type": "timestamp with time zone",
2754
+ "primaryKey": false,
2755
+ "notNull": false
2756
+ },
2757
+ "revoked_at": {
2758
+ "name": "revoked_at",
2759
+ "type": "timestamp with time zone",
2760
+ "primaryKey": false,
2761
+ "notNull": false
2762
+ },
2763
+ "created_at": {
2764
+ "name": "created_at",
2765
+ "type": "timestamp with time zone",
2766
+ "primaryKey": false,
2767
+ "notNull": true,
2768
+ "default": "now()"
2769
+ }
2770
+ },
2771
+ "indexes": {},
2772
+ "foreignKeys": {
2773
+ "tokens_user_id_users_id_fk": {
2774
+ "name": "tokens_user_id_users_id_fk",
2775
+ "tableFrom": "tokens",
2776
+ "tableTo": "users",
2777
+ "columnsFrom": [
2778
+ "user_id"
2779
+ ],
2780
+ "columnsTo": [
2781
+ "id"
2782
+ ],
2783
+ "onDelete": "cascade",
2784
+ "onUpdate": "no action"
2785
+ }
2786
+ },
2787
+ "compositePrimaryKeys": {},
2788
+ "uniqueConstraints": {
2789
+ "tokens_token_hash_unique": {
2790
+ "name": "tokens_token_hash_unique",
2791
+ "nullsNotDistinct": false,
2792
+ "columns": [
2793
+ "token_hash"
2794
+ ]
2795
+ }
2796
+ },
2797
+ "policies": {},
2798
+ "checkConstraints": {},
2799
+ "isRLSEnabled": false
2800
+ },
2801
+ "public.users": {
2802
+ "name": "users",
2803
+ "schema": "",
2804
+ "columns": {
2805
+ "id": {
2806
+ "name": "id",
2807
+ "type": "uuid",
2808
+ "primaryKey": true,
2809
+ "notNull": true,
2810
+ "default": "gen_random_uuid()"
2811
+ },
2812
+ "github_id": {
2813
+ "name": "github_id",
2814
+ "type": "bigint",
2815
+ "primaryKey": false,
2816
+ "notNull": false
2817
+ },
2818
+ "username": {
2819
+ "name": "username",
2820
+ "type": "text",
2821
+ "primaryKey": false,
2822
+ "notNull": true
2823
+ },
2824
+ "password_hash": {
2825
+ "name": "password_hash",
2826
+ "type": "text",
2827
+ "primaryKey": false,
2828
+ "notNull": false
2829
+ },
2830
+ "display_name": {
2831
+ "name": "display_name",
2832
+ "type": "text",
2833
+ "primaryKey": false,
2834
+ "notNull": false
2835
+ },
2836
+ "email": {
2837
+ "name": "email",
2838
+ "type": "text",
2839
+ "primaryKey": false,
2840
+ "notNull": false
2841
+ },
2842
+ "avatar_url": {
2843
+ "name": "avatar_url",
2844
+ "type": "text",
2845
+ "primaryKey": false,
2846
+ "notNull": false
2847
+ },
2848
+ "created_at": {
2849
+ "name": "created_at",
2850
+ "type": "timestamp with time zone",
2851
+ "primaryKey": false,
2852
+ "notNull": true,
2853
+ "default": "now()"
2854
+ }
2855
+ },
2856
+ "indexes": {
2857
+ "users_email_unique": {
2858
+ "name": "users_email_unique",
2859
+ "columns": [
2860
+ {
2861
+ "expression": "email",
2862
+ "isExpression": false,
2863
+ "asc": true,
2864
+ "nulls": "last"
2865
+ }
2866
+ ],
2867
+ "isUnique": true,
2868
+ "where": "email is not null",
2869
+ "concurrently": false,
2870
+ "method": "btree",
2871
+ "with": {}
2872
+ }
2873
+ },
2874
+ "foreignKeys": {},
2875
+ "compositePrimaryKeys": {},
2876
+ "uniqueConstraints": {
2877
+ "users_github_id_unique": {
2878
+ "name": "users_github_id_unique",
2879
+ "nullsNotDistinct": false,
2880
+ "columns": [
2881
+ "github_id"
2882
+ ]
2883
+ },
2884
+ "users_username_unique": {
2885
+ "name": "users_username_unique",
2886
+ "nullsNotDistinct": false,
2887
+ "columns": [
2888
+ "username"
2889
+ ]
2890
+ }
2891
+ },
2892
+ "policies": {},
2893
+ "checkConstraints": {},
2894
+ "isRLSEnabled": false
2895
+ },
2896
+ "public.web_sessions": {
2897
+ "name": "web_sessions",
2898
+ "schema": "",
2899
+ "columns": {
2900
+ "id": {
2901
+ "name": "id",
2902
+ "type": "text",
2903
+ "primaryKey": true,
2904
+ "notNull": true
2905
+ },
2906
+ "user_id": {
2907
+ "name": "user_id",
2908
+ "type": "uuid",
2909
+ "primaryKey": false,
2910
+ "notNull": true
2911
+ },
2912
+ "expires_at": {
2913
+ "name": "expires_at",
2914
+ "type": "timestamp with time zone",
2915
+ "primaryKey": false,
2916
+ "notNull": true
2917
+ },
2918
+ "created_at": {
2919
+ "name": "created_at",
2920
+ "type": "timestamp with time zone",
2921
+ "primaryKey": false,
2922
+ "notNull": true,
2923
+ "default": "now()"
2924
+ }
2925
+ },
2926
+ "indexes": {},
2927
+ "foreignKeys": {
2928
+ "web_sessions_user_id_users_id_fk": {
2929
+ "name": "web_sessions_user_id_users_id_fk",
2930
+ "tableFrom": "web_sessions",
2931
+ "tableTo": "users",
2932
+ "columnsFrom": [
2933
+ "user_id"
2934
+ ],
2935
+ "columnsTo": [
2936
+ "id"
2937
+ ],
2938
+ "onDelete": "cascade",
2939
+ "onUpdate": "no action"
2940
+ }
2941
+ },
2942
+ "compositePrimaryKeys": {},
2943
+ "uniqueConstraints": {},
2944
+ "policies": {},
2945
+ "checkConstraints": {},
2946
+ "isRLSEnabled": false
2947
+ },
2948
+ "public.work_claims": {
2949
+ "name": "work_claims",
2950
+ "schema": "",
2951
+ "columns": {
2952
+ "id": {
2953
+ "name": "id",
2954
+ "type": "uuid",
2955
+ "primaryKey": true,
2956
+ "notNull": true,
2957
+ "default": "gen_random_uuid()"
2958
+ },
2959
+ "run_id": {
2960
+ "name": "run_id",
2961
+ "type": "uuid",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "resource_type": {
2966
+ "name": "resource_type",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": true
2970
+ },
2971
+ "resource_key": {
2972
+ "name": "resource_key",
2973
+ "type": "text",
2974
+ "primaryKey": false,
2975
+ "notNull": true
2976
+ },
2977
+ "access": {
2978
+ "name": "access",
2979
+ "type": "text",
2980
+ "primaryKey": false,
2981
+ "notNull": true,
2982
+ "default": "'write'"
2983
+ },
2984
+ "lease_expires_at": {
2985
+ "name": "lease_expires_at",
2986
+ "type": "timestamp with time zone",
2987
+ "primaryKey": false,
2988
+ "notNull": true
2989
+ },
2990
+ "created_at": {
2991
+ "name": "created_at",
2992
+ "type": "timestamp with time zone",
2993
+ "primaryKey": false,
2994
+ "notNull": true,
2995
+ "default": "now()"
2996
+ }
2997
+ },
2998
+ "indexes": {
2999
+ "work_claims_run_resource": {
3000
+ "name": "work_claims_run_resource",
3001
+ "columns": [
3002
+ {
3003
+ "expression": "run_id",
3004
+ "isExpression": false,
3005
+ "asc": true,
3006
+ "nulls": "last"
3007
+ },
3008
+ {
3009
+ "expression": "resource_type",
3010
+ "isExpression": false,
3011
+ "asc": true,
3012
+ "nulls": "last"
3013
+ },
3014
+ {
3015
+ "expression": "resource_key",
3016
+ "isExpression": false,
3017
+ "asc": true,
3018
+ "nulls": "last"
3019
+ },
3020
+ {
3021
+ "expression": "access",
3022
+ "isExpression": false,
3023
+ "asc": true,
3024
+ "nulls": "last"
3025
+ }
3026
+ ],
3027
+ "isUnique": true,
3028
+ "concurrently": false,
3029
+ "method": "btree",
3030
+ "with": {}
3031
+ },
3032
+ "work_claims_lease": {
3033
+ "name": "work_claims_lease",
3034
+ "columns": [
3035
+ {
3036
+ "expression": "lease_expires_at",
3037
+ "isExpression": false,
3038
+ "asc": true,
3039
+ "nulls": "last"
3040
+ }
3041
+ ],
3042
+ "isUnique": false,
3043
+ "concurrently": false,
3044
+ "method": "btree",
3045
+ "with": {}
3046
+ }
3047
+ },
3048
+ "foreignKeys": {
3049
+ "work_claims_run_id_agent_runs_id_fk": {
3050
+ "name": "work_claims_run_id_agent_runs_id_fk",
3051
+ "tableFrom": "work_claims",
3052
+ "tableTo": "agent_runs",
3053
+ "columnsFrom": [
3054
+ "run_id"
3055
+ ],
3056
+ "columnsTo": [
3057
+ "id"
3058
+ ],
3059
+ "onDelete": "cascade",
3060
+ "onUpdate": "no action"
3061
+ }
3062
+ },
3063
+ "compositePrimaryKeys": {},
3064
+ "uniqueConstraints": {},
3065
+ "policies": {},
3066
+ "checkConstraints": {},
3067
+ "isRLSEnabled": false
3068
+ }
3069
+ },
3070
+ "enums": {},
3071
+ "schemas": {},
3072
+ "sequences": {},
3073
+ "roles": {},
3074
+ "policies": {},
3075
+ "views": {},
3076
+ "_meta": {
3077
+ "columns": {},
3078
+ "schemas": {},
3079
+ "tables": {}
3080
+ }
3081
+ }