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