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