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