@paperclipai/db 0.2.2 → 0.2.4

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 (91) hide show
  1. package/dist/migrations/0000_mature_masked_marvel.sql +208 -0
  2. package/dist/migrations/0001_fast_northstar.sql +87 -0
  3. package/dist/migrations/0002_big_zaladane.sql +1 -0
  4. package/dist/migrations/0003_shallow_quentin_quire.sql +5 -0
  5. package/dist/migrations/0004_issue_identifiers.sql +28 -0
  6. package/dist/migrations/0005_chief_luke_cage.sql +19 -0
  7. package/dist/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  8. package/dist/migrations/0007_new_quentin_quire.sql +20 -0
  9. package/dist/migrations/0008_amused_zzzax.sql +1 -0
  10. package/dist/migrations/0009_fast_jackal.sql +36 -0
  11. package/dist/migrations/0010_stale_justin_hammer.sql +37 -0
  12. package/dist/migrations/0011_windy_corsair.sql +18 -0
  13. package/dist/migrations/0012_perpetual_ser_duncan.sql +2 -0
  14. package/dist/migrations/0013_dashing_wasp.sql +4 -0
  15. package/dist/migrations/0014_many_mikhail_rasputin.sql +135 -0
  16. package/dist/migrations/0015_project_color_archived.sql +2 -0
  17. package/dist/migrations/0016_agent_icon.sql +1 -0
  18. package/dist/migrations/0017_tiresome_gabe_jones.sql +51 -0
  19. package/dist/migrations/0018_flat_sleepwalker.sql +26 -0
  20. package/dist/migrations/0019_public_victor_mancha.sql +18 -0
  21. package/dist/migrations/0020_white_anita_blake.sql +1 -0
  22. package/dist/migrations/0021_chief_vindicator.sql +1 -0
  23. package/dist/migrations/0022_company_brand_color.sql +1 -0
  24. package/dist/migrations/0023_fair_lethal_legion.sql +3 -0
  25. package/dist/migrations/meta/0000_snapshot.json +1743 -0
  26. package/dist/migrations/meta/0001_snapshot.json +2441 -0
  27. package/dist/migrations/meta/0002_snapshot.json +2454 -0
  28. package/dist/migrations/meta/0003_snapshot.json +2502 -0
  29. package/dist/migrations/meta/0005_snapshot.json +2719 -0
  30. package/dist/migrations/meta/0006_snapshot.json +3048 -0
  31. package/dist/migrations/meta/0007_snapshot.json +3258 -0
  32. package/dist/migrations/meta/0008_snapshot.json +3264 -0
  33. package/dist/migrations/meta/0009_snapshot.json +3587 -0
  34. package/dist/migrations/meta/0010_snapshot.json +3929 -0
  35. package/dist/migrations/meta/0011_snapshot.json +4068 -0
  36. package/dist/migrations/meta/0012_snapshot.json +4087 -0
  37. package/dist/migrations/meta/0013_snapshot.json +4118 -0
  38. package/dist/migrations/meta/0014_snapshot.json +5187 -0
  39. package/dist/migrations/meta/0017_snapshot.json +5215 -0
  40. package/dist/migrations/meta/0018_snapshot.json +5450 -0
  41. package/dist/migrations/meta/0019_snapshot.json +5603 -0
  42. package/dist/migrations/meta/0020_snapshot.json +5603 -0
  43. package/dist/migrations/meta/0021_snapshot.json +5609 -0
  44. package/dist/migrations/meta/0023_snapshot.json +5633 -0
  45. package/dist/migrations/meta/_journal.json +174 -0
  46. package/dist/migrations/migrations/0000_mature_masked_marvel.sql +208 -0
  47. package/dist/migrations/migrations/0001_fast_northstar.sql +87 -0
  48. package/dist/migrations/migrations/0002_big_zaladane.sql +1 -0
  49. package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +5 -0
  50. package/dist/migrations/migrations/0004_issue_identifiers.sql +28 -0
  51. package/dist/migrations/migrations/0005_chief_luke_cage.sql +19 -0
  52. package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  53. package/dist/migrations/migrations/0007_new_quentin_quire.sql +20 -0
  54. package/dist/migrations/migrations/0008_amused_zzzax.sql +1 -0
  55. package/dist/migrations/migrations/0009_fast_jackal.sql +36 -0
  56. package/dist/migrations/migrations/0010_stale_justin_hammer.sql +37 -0
  57. package/dist/migrations/migrations/0011_windy_corsair.sql +18 -0
  58. package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +2 -0
  59. package/dist/migrations/migrations/0013_dashing_wasp.sql +4 -0
  60. package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +135 -0
  61. package/dist/migrations/migrations/0015_project_color_archived.sql +2 -0
  62. package/dist/migrations/migrations/0016_agent_icon.sql +1 -0
  63. package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +51 -0
  64. package/dist/migrations/migrations/0018_flat_sleepwalker.sql +26 -0
  65. package/dist/migrations/migrations/0019_public_victor_mancha.sql +18 -0
  66. package/dist/migrations/migrations/0020_white_anita_blake.sql +1 -0
  67. package/dist/migrations/migrations/0021_chief_vindicator.sql +1 -0
  68. package/dist/migrations/migrations/0022_company_brand_color.sql +1 -0
  69. package/dist/migrations/migrations/0023_fair_lethal_legion.sql +3 -0
  70. package/dist/migrations/migrations/meta/0000_snapshot.json +1743 -0
  71. package/dist/migrations/migrations/meta/0001_snapshot.json +2441 -0
  72. package/dist/migrations/migrations/meta/0002_snapshot.json +2454 -0
  73. package/dist/migrations/migrations/meta/0003_snapshot.json +2502 -0
  74. package/dist/migrations/migrations/meta/0005_snapshot.json +2719 -0
  75. package/dist/migrations/migrations/meta/0006_snapshot.json +3048 -0
  76. package/dist/migrations/migrations/meta/0007_snapshot.json +3258 -0
  77. package/dist/migrations/migrations/meta/0008_snapshot.json +3264 -0
  78. package/dist/migrations/migrations/meta/0009_snapshot.json +3587 -0
  79. package/dist/migrations/migrations/meta/0010_snapshot.json +3929 -0
  80. package/dist/migrations/migrations/meta/0011_snapshot.json +4068 -0
  81. package/dist/migrations/migrations/meta/0012_snapshot.json +4087 -0
  82. package/dist/migrations/migrations/meta/0013_snapshot.json +4118 -0
  83. package/dist/migrations/migrations/meta/0014_snapshot.json +5187 -0
  84. package/dist/migrations/migrations/meta/0017_snapshot.json +5215 -0
  85. package/dist/migrations/migrations/meta/0018_snapshot.json +5450 -0
  86. package/dist/migrations/migrations/meta/0019_snapshot.json +5603 -0
  87. package/dist/migrations/migrations/meta/0020_snapshot.json +5603 -0
  88. package/dist/migrations/migrations/meta/0021_snapshot.json +5609 -0
  89. package/dist/migrations/migrations/meta/0023_snapshot.json +5633 -0
  90. package/dist/migrations/migrations/meta/_journal.json +174 -0
  91. package/package.json +3 -3
@@ -0,0 +1,4087 @@
1
+ {
2
+ "id": "92d53482-8dd3-4231-93d6-cf63550227d5",
3
+ "prevId": "bcd1a199-d6ea-4ef6-8501-72f0ca00b5ff",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.activity_log": {
8
+ "name": "activity_log",
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
+ "company_id": {
19
+ "name": "company_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "actor_type": {
25
+ "name": "actor_type",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "default": "'system'"
30
+ },
31
+ "actor_id": {
32
+ "name": "actor_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true
36
+ },
37
+ "action": {
38
+ "name": "action",
39
+ "type": "text",
40
+ "primaryKey": false,
41
+ "notNull": true
42
+ },
43
+ "entity_type": {
44
+ "name": "entity_type",
45
+ "type": "text",
46
+ "primaryKey": false,
47
+ "notNull": true
48
+ },
49
+ "entity_id": {
50
+ "name": "entity_id",
51
+ "type": "text",
52
+ "primaryKey": false,
53
+ "notNull": true
54
+ },
55
+ "agent_id": {
56
+ "name": "agent_id",
57
+ "type": "uuid",
58
+ "primaryKey": false,
59
+ "notNull": false
60
+ },
61
+ "run_id": {
62
+ "name": "run_id",
63
+ "type": "uuid",
64
+ "primaryKey": false,
65
+ "notNull": false
66
+ },
67
+ "details": {
68
+ "name": "details",
69
+ "type": "jsonb",
70
+ "primaryKey": false,
71
+ "notNull": false
72
+ },
73
+ "created_at": {
74
+ "name": "created_at",
75
+ "type": "timestamp with time zone",
76
+ "primaryKey": false,
77
+ "notNull": true,
78
+ "default": "now()"
79
+ }
80
+ },
81
+ "indexes": {
82
+ "activity_log_company_created_idx": {
83
+ "name": "activity_log_company_created_idx",
84
+ "columns": [
85
+ {
86
+ "expression": "company_id",
87
+ "isExpression": false,
88
+ "asc": true,
89
+ "nulls": "last"
90
+ },
91
+ {
92
+ "expression": "created_at",
93
+ "isExpression": false,
94
+ "asc": true,
95
+ "nulls": "last"
96
+ }
97
+ ],
98
+ "isUnique": false,
99
+ "concurrently": false,
100
+ "method": "btree",
101
+ "with": {}
102
+ },
103
+ "activity_log_run_id_idx": {
104
+ "name": "activity_log_run_id_idx",
105
+ "columns": [
106
+ {
107
+ "expression": "run_id",
108
+ "isExpression": false,
109
+ "asc": true,
110
+ "nulls": "last"
111
+ }
112
+ ],
113
+ "isUnique": false,
114
+ "concurrently": false,
115
+ "method": "btree",
116
+ "with": {}
117
+ },
118
+ "activity_log_entity_type_id_idx": {
119
+ "name": "activity_log_entity_type_id_idx",
120
+ "columns": [
121
+ {
122
+ "expression": "entity_type",
123
+ "isExpression": false,
124
+ "asc": true,
125
+ "nulls": "last"
126
+ },
127
+ {
128
+ "expression": "entity_id",
129
+ "isExpression": false,
130
+ "asc": true,
131
+ "nulls": "last"
132
+ }
133
+ ],
134
+ "isUnique": false,
135
+ "concurrently": false,
136
+ "method": "btree",
137
+ "with": {}
138
+ }
139
+ },
140
+ "foreignKeys": {
141
+ "activity_log_company_id_companies_id_fk": {
142
+ "name": "activity_log_company_id_companies_id_fk",
143
+ "tableFrom": "activity_log",
144
+ "tableTo": "companies",
145
+ "columnsFrom": [
146
+ "company_id"
147
+ ],
148
+ "columnsTo": [
149
+ "id"
150
+ ],
151
+ "onDelete": "no action",
152
+ "onUpdate": "no action"
153
+ },
154
+ "activity_log_agent_id_agents_id_fk": {
155
+ "name": "activity_log_agent_id_agents_id_fk",
156
+ "tableFrom": "activity_log",
157
+ "tableTo": "agents",
158
+ "columnsFrom": [
159
+ "agent_id"
160
+ ],
161
+ "columnsTo": [
162
+ "id"
163
+ ],
164
+ "onDelete": "no action",
165
+ "onUpdate": "no action"
166
+ },
167
+ "activity_log_run_id_heartbeat_runs_id_fk": {
168
+ "name": "activity_log_run_id_heartbeat_runs_id_fk",
169
+ "tableFrom": "activity_log",
170
+ "tableTo": "heartbeat_runs",
171
+ "columnsFrom": [
172
+ "run_id"
173
+ ],
174
+ "columnsTo": [
175
+ "id"
176
+ ],
177
+ "onDelete": "no action",
178
+ "onUpdate": "no action"
179
+ }
180
+ },
181
+ "compositePrimaryKeys": {},
182
+ "uniqueConstraints": {},
183
+ "policies": {},
184
+ "checkConstraints": {},
185
+ "isRLSEnabled": false
186
+ },
187
+ "public.agent_api_keys": {
188
+ "name": "agent_api_keys",
189
+ "schema": "",
190
+ "columns": {
191
+ "id": {
192
+ "name": "id",
193
+ "type": "uuid",
194
+ "primaryKey": true,
195
+ "notNull": true,
196
+ "default": "gen_random_uuid()"
197
+ },
198
+ "agent_id": {
199
+ "name": "agent_id",
200
+ "type": "uuid",
201
+ "primaryKey": false,
202
+ "notNull": true
203
+ },
204
+ "company_id": {
205
+ "name": "company_id",
206
+ "type": "uuid",
207
+ "primaryKey": false,
208
+ "notNull": true
209
+ },
210
+ "name": {
211
+ "name": "name",
212
+ "type": "text",
213
+ "primaryKey": false,
214
+ "notNull": true
215
+ },
216
+ "key_hash": {
217
+ "name": "key_hash",
218
+ "type": "text",
219
+ "primaryKey": false,
220
+ "notNull": true
221
+ },
222
+ "last_used_at": {
223
+ "name": "last_used_at",
224
+ "type": "timestamp with time zone",
225
+ "primaryKey": false,
226
+ "notNull": false
227
+ },
228
+ "revoked_at": {
229
+ "name": "revoked_at",
230
+ "type": "timestamp with time zone",
231
+ "primaryKey": false,
232
+ "notNull": false
233
+ },
234
+ "created_at": {
235
+ "name": "created_at",
236
+ "type": "timestamp with time zone",
237
+ "primaryKey": false,
238
+ "notNull": true,
239
+ "default": "now()"
240
+ }
241
+ },
242
+ "indexes": {
243
+ "agent_api_keys_key_hash_idx": {
244
+ "name": "agent_api_keys_key_hash_idx",
245
+ "columns": [
246
+ {
247
+ "expression": "key_hash",
248
+ "isExpression": false,
249
+ "asc": true,
250
+ "nulls": "last"
251
+ }
252
+ ],
253
+ "isUnique": false,
254
+ "concurrently": false,
255
+ "method": "btree",
256
+ "with": {}
257
+ },
258
+ "agent_api_keys_company_agent_idx": {
259
+ "name": "agent_api_keys_company_agent_idx",
260
+ "columns": [
261
+ {
262
+ "expression": "company_id",
263
+ "isExpression": false,
264
+ "asc": true,
265
+ "nulls": "last"
266
+ },
267
+ {
268
+ "expression": "agent_id",
269
+ "isExpression": false,
270
+ "asc": true,
271
+ "nulls": "last"
272
+ }
273
+ ],
274
+ "isUnique": false,
275
+ "concurrently": false,
276
+ "method": "btree",
277
+ "with": {}
278
+ }
279
+ },
280
+ "foreignKeys": {
281
+ "agent_api_keys_agent_id_agents_id_fk": {
282
+ "name": "agent_api_keys_agent_id_agents_id_fk",
283
+ "tableFrom": "agent_api_keys",
284
+ "tableTo": "agents",
285
+ "columnsFrom": [
286
+ "agent_id"
287
+ ],
288
+ "columnsTo": [
289
+ "id"
290
+ ],
291
+ "onDelete": "no action",
292
+ "onUpdate": "no action"
293
+ },
294
+ "agent_api_keys_company_id_companies_id_fk": {
295
+ "name": "agent_api_keys_company_id_companies_id_fk",
296
+ "tableFrom": "agent_api_keys",
297
+ "tableTo": "companies",
298
+ "columnsFrom": [
299
+ "company_id"
300
+ ],
301
+ "columnsTo": [
302
+ "id"
303
+ ],
304
+ "onDelete": "no action",
305
+ "onUpdate": "no action"
306
+ }
307
+ },
308
+ "compositePrimaryKeys": {},
309
+ "uniqueConstraints": {},
310
+ "policies": {},
311
+ "checkConstraints": {},
312
+ "isRLSEnabled": false
313
+ },
314
+ "public.agent_config_revisions": {
315
+ "name": "agent_config_revisions",
316
+ "schema": "",
317
+ "columns": {
318
+ "id": {
319
+ "name": "id",
320
+ "type": "uuid",
321
+ "primaryKey": true,
322
+ "notNull": true,
323
+ "default": "gen_random_uuid()"
324
+ },
325
+ "company_id": {
326
+ "name": "company_id",
327
+ "type": "uuid",
328
+ "primaryKey": false,
329
+ "notNull": true
330
+ },
331
+ "agent_id": {
332
+ "name": "agent_id",
333
+ "type": "uuid",
334
+ "primaryKey": false,
335
+ "notNull": true
336
+ },
337
+ "created_by_agent_id": {
338
+ "name": "created_by_agent_id",
339
+ "type": "uuid",
340
+ "primaryKey": false,
341
+ "notNull": false
342
+ },
343
+ "created_by_user_id": {
344
+ "name": "created_by_user_id",
345
+ "type": "text",
346
+ "primaryKey": false,
347
+ "notNull": false
348
+ },
349
+ "source": {
350
+ "name": "source",
351
+ "type": "text",
352
+ "primaryKey": false,
353
+ "notNull": true,
354
+ "default": "'patch'"
355
+ },
356
+ "rolled_back_from_revision_id": {
357
+ "name": "rolled_back_from_revision_id",
358
+ "type": "uuid",
359
+ "primaryKey": false,
360
+ "notNull": false
361
+ },
362
+ "changed_keys": {
363
+ "name": "changed_keys",
364
+ "type": "jsonb",
365
+ "primaryKey": false,
366
+ "notNull": true,
367
+ "default": "'[]'::jsonb"
368
+ },
369
+ "before_config": {
370
+ "name": "before_config",
371
+ "type": "jsonb",
372
+ "primaryKey": false,
373
+ "notNull": true
374
+ },
375
+ "after_config": {
376
+ "name": "after_config",
377
+ "type": "jsonb",
378
+ "primaryKey": false,
379
+ "notNull": true
380
+ },
381
+ "created_at": {
382
+ "name": "created_at",
383
+ "type": "timestamp with time zone",
384
+ "primaryKey": false,
385
+ "notNull": true,
386
+ "default": "now()"
387
+ }
388
+ },
389
+ "indexes": {
390
+ "agent_config_revisions_company_agent_created_idx": {
391
+ "name": "agent_config_revisions_company_agent_created_idx",
392
+ "columns": [
393
+ {
394
+ "expression": "company_id",
395
+ "isExpression": false,
396
+ "asc": true,
397
+ "nulls": "last"
398
+ },
399
+ {
400
+ "expression": "agent_id",
401
+ "isExpression": false,
402
+ "asc": true,
403
+ "nulls": "last"
404
+ },
405
+ {
406
+ "expression": "created_at",
407
+ "isExpression": false,
408
+ "asc": true,
409
+ "nulls": "last"
410
+ }
411
+ ],
412
+ "isUnique": false,
413
+ "concurrently": false,
414
+ "method": "btree",
415
+ "with": {}
416
+ },
417
+ "agent_config_revisions_agent_created_idx": {
418
+ "name": "agent_config_revisions_agent_created_idx",
419
+ "columns": [
420
+ {
421
+ "expression": "agent_id",
422
+ "isExpression": false,
423
+ "asc": true,
424
+ "nulls": "last"
425
+ },
426
+ {
427
+ "expression": "created_at",
428
+ "isExpression": false,
429
+ "asc": true,
430
+ "nulls": "last"
431
+ }
432
+ ],
433
+ "isUnique": false,
434
+ "concurrently": false,
435
+ "method": "btree",
436
+ "with": {}
437
+ }
438
+ },
439
+ "foreignKeys": {
440
+ "agent_config_revisions_company_id_companies_id_fk": {
441
+ "name": "agent_config_revisions_company_id_companies_id_fk",
442
+ "tableFrom": "agent_config_revisions",
443
+ "tableTo": "companies",
444
+ "columnsFrom": [
445
+ "company_id"
446
+ ],
447
+ "columnsTo": [
448
+ "id"
449
+ ],
450
+ "onDelete": "no action",
451
+ "onUpdate": "no action"
452
+ },
453
+ "agent_config_revisions_agent_id_agents_id_fk": {
454
+ "name": "agent_config_revisions_agent_id_agents_id_fk",
455
+ "tableFrom": "agent_config_revisions",
456
+ "tableTo": "agents",
457
+ "columnsFrom": [
458
+ "agent_id"
459
+ ],
460
+ "columnsTo": [
461
+ "id"
462
+ ],
463
+ "onDelete": "cascade",
464
+ "onUpdate": "no action"
465
+ },
466
+ "agent_config_revisions_created_by_agent_id_agents_id_fk": {
467
+ "name": "agent_config_revisions_created_by_agent_id_agents_id_fk",
468
+ "tableFrom": "agent_config_revisions",
469
+ "tableTo": "agents",
470
+ "columnsFrom": [
471
+ "created_by_agent_id"
472
+ ],
473
+ "columnsTo": [
474
+ "id"
475
+ ],
476
+ "onDelete": "set null",
477
+ "onUpdate": "no action"
478
+ }
479
+ },
480
+ "compositePrimaryKeys": {},
481
+ "uniqueConstraints": {},
482
+ "policies": {},
483
+ "checkConstraints": {},
484
+ "isRLSEnabled": false
485
+ },
486
+ "public.agent_runtime_state": {
487
+ "name": "agent_runtime_state",
488
+ "schema": "",
489
+ "columns": {
490
+ "agent_id": {
491
+ "name": "agent_id",
492
+ "type": "uuid",
493
+ "primaryKey": true,
494
+ "notNull": true
495
+ },
496
+ "company_id": {
497
+ "name": "company_id",
498
+ "type": "uuid",
499
+ "primaryKey": false,
500
+ "notNull": true
501
+ },
502
+ "adapter_type": {
503
+ "name": "adapter_type",
504
+ "type": "text",
505
+ "primaryKey": false,
506
+ "notNull": true
507
+ },
508
+ "session_id": {
509
+ "name": "session_id",
510
+ "type": "text",
511
+ "primaryKey": false,
512
+ "notNull": false
513
+ },
514
+ "state_json": {
515
+ "name": "state_json",
516
+ "type": "jsonb",
517
+ "primaryKey": false,
518
+ "notNull": true,
519
+ "default": "'{}'::jsonb"
520
+ },
521
+ "last_run_id": {
522
+ "name": "last_run_id",
523
+ "type": "uuid",
524
+ "primaryKey": false,
525
+ "notNull": false
526
+ },
527
+ "last_run_status": {
528
+ "name": "last_run_status",
529
+ "type": "text",
530
+ "primaryKey": false,
531
+ "notNull": false
532
+ },
533
+ "total_input_tokens": {
534
+ "name": "total_input_tokens",
535
+ "type": "bigint",
536
+ "primaryKey": false,
537
+ "notNull": true,
538
+ "default": 0
539
+ },
540
+ "total_output_tokens": {
541
+ "name": "total_output_tokens",
542
+ "type": "bigint",
543
+ "primaryKey": false,
544
+ "notNull": true,
545
+ "default": 0
546
+ },
547
+ "total_cached_input_tokens": {
548
+ "name": "total_cached_input_tokens",
549
+ "type": "bigint",
550
+ "primaryKey": false,
551
+ "notNull": true,
552
+ "default": 0
553
+ },
554
+ "total_cost_cents": {
555
+ "name": "total_cost_cents",
556
+ "type": "bigint",
557
+ "primaryKey": false,
558
+ "notNull": true,
559
+ "default": 0
560
+ },
561
+ "last_error": {
562
+ "name": "last_error",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": false
566
+ },
567
+ "created_at": {
568
+ "name": "created_at",
569
+ "type": "timestamp with time zone",
570
+ "primaryKey": false,
571
+ "notNull": true,
572
+ "default": "now()"
573
+ },
574
+ "updated_at": {
575
+ "name": "updated_at",
576
+ "type": "timestamp with time zone",
577
+ "primaryKey": false,
578
+ "notNull": true,
579
+ "default": "now()"
580
+ }
581
+ },
582
+ "indexes": {
583
+ "agent_runtime_state_company_agent_idx": {
584
+ "name": "agent_runtime_state_company_agent_idx",
585
+ "columns": [
586
+ {
587
+ "expression": "company_id",
588
+ "isExpression": false,
589
+ "asc": true,
590
+ "nulls": "last"
591
+ },
592
+ {
593
+ "expression": "agent_id",
594
+ "isExpression": false,
595
+ "asc": true,
596
+ "nulls": "last"
597
+ }
598
+ ],
599
+ "isUnique": false,
600
+ "concurrently": false,
601
+ "method": "btree",
602
+ "with": {}
603
+ },
604
+ "agent_runtime_state_company_updated_idx": {
605
+ "name": "agent_runtime_state_company_updated_idx",
606
+ "columns": [
607
+ {
608
+ "expression": "company_id",
609
+ "isExpression": false,
610
+ "asc": true,
611
+ "nulls": "last"
612
+ },
613
+ {
614
+ "expression": "updated_at",
615
+ "isExpression": false,
616
+ "asc": true,
617
+ "nulls": "last"
618
+ }
619
+ ],
620
+ "isUnique": false,
621
+ "concurrently": false,
622
+ "method": "btree",
623
+ "with": {}
624
+ }
625
+ },
626
+ "foreignKeys": {
627
+ "agent_runtime_state_agent_id_agents_id_fk": {
628
+ "name": "agent_runtime_state_agent_id_agents_id_fk",
629
+ "tableFrom": "agent_runtime_state",
630
+ "tableTo": "agents",
631
+ "columnsFrom": [
632
+ "agent_id"
633
+ ],
634
+ "columnsTo": [
635
+ "id"
636
+ ],
637
+ "onDelete": "no action",
638
+ "onUpdate": "no action"
639
+ },
640
+ "agent_runtime_state_company_id_companies_id_fk": {
641
+ "name": "agent_runtime_state_company_id_companies_id_fk",
642
+ "tableFrom": "agent_runtime_state",
643
+ "tableTo": "companies",
644
+ "columnsFrom": [
645
+ "company_id"
646
+ ],
647
+ "columnsTo": [
648
+ "id"
649
+ ],
650
+ "onDelete": "no action",
651
+ "onUpdate": "no action"
652
+ }
653
+ },
654
+ "compositePrimaryKeys": {},
655
+ "uniqueConstraints": {},
656
+ "policies": {},
657
+ "checkConstraints": {},
658
+ "isRLSEnabled": false
659
+ },
660
+ "public.agent_task_sessions": {
661
+ "name": "agent_task_sessions",
662
+ "schema": "",
663
+ "columns": {
664
+ "id": {
665
+ "name": "id",
666
+ "type": "uuid",
667
+ "primaryKey": true,
668
+ "notNull": true,
669
+ "default": "gen_random_uuid()"
670
+ },
671
+ "company_id": {
672
+ "name": "company_id",
673
+ "type": "uuid",
674
+ "primaryKey": false,
675
+ "notNull": true
676
+ },
677
+ "agent_id": {
678
+ "name": "agent_id",
679
+ "type": "uuid",
680
+ "primaryKey": false,
681
+ "notNull": true
682
+ },
683
+ "adapter_type": {
684
+ "name": "adapter_type",
685
+ "type": "text",
686
+ "primaryKey": false,
687
+ "notNull": true
688
+ },
689
+ "task_key": {
690
+ "name": "task_key",
691
+ "type": "text",
692
+ "primaryKey": false,
693
+ "notNull": true
694
+ },
695
+ "session_params_json": {
696
+ "name": "session_params_json",
697
+ "type": "jsonb",
698
+ "primaryKey": false,
699
+ "notNull": false
700
+ },
701
+ "session_display_id": {
702
+ "name": "session_display_id",
703
+ "type": "text",
704
+ "primaryKey": false,
705
+ "notNull": false
706
+ },
707
+ "last_run_id": {
708
+ "name": "last_run_id",
709
+ "type": "uuid",
710
+ "primaryKey": false,
711
+ "notNull": false
712
+ },
713
+ "last_error": {
714
+ "name": "last_error",
715
+ "type": "text",
716
+ "primaryKey": false,
717
+ "notNull": false
718
+ },
719
+ "created_at": {
720
+ "name": "created_at",
721
+ "type": "timestamp with time zone",
722
+ "primaryKey": false,
723
+ "notNull": true,
724
+ "default": "now()"
725
+ },
726
+ "updated_at": {
727
+ "name": "updated_at",
728
+ "type": "timestamp with time zone",
729
+ "primaryKey": false,
730
+ "notNull": true,
731
+ "default": "now()"
732
+ }
733
+ },
734
+ "indexes": {
735
+ "agent_task_sessions_company_agent_adapter_task_uniq": {
736
+ "name": "agent_task_sessions_company_agent_adapter_task_uniq",
737
+ "columns": [
738
+ {
739
+ "expression": "company_id",
740
+ "isExpression": false,
741
+ "asc": true,
742
+ "nulls": "last"
743
+ },
744
+ {
745
+ "expression": "agent_id",
746
+ "isExpression": false,
747
+ "asc": true,
748
+ "nulls": "last"
749
+ },
750
+ {
751
+ "expression": "adapter_type",
752
+ "isExpression": false,
753
+ "asc": true,
754
+ "nulls": "last"
755
+ },
756
+ {
757
+ "expression": "task_key",
758
+ "isExpression": false,
759
+ "asc": true,
760
+ "nulls": "last"
761
+ }
762
+ ],
763
+ "isUnique": true,
764
+ "concurrently": false,
765
+ "method": "btree",
766
+ "with": {}
767
+ },
768
+ "agent_task_sessions_company_agent_updated_idx": {
769
+ "name": "agent_task_sessions_company_agent_updated_idx",
770
+ "columns": [
771
+ {
772
+ "expression": "company_id",
773
+ "isExpression": false,
774
+ "asc": true,
775
+ "nulls": "last"
776
+ },
777
+ {
778
+ "expression": "agent_id",
779
+ "isExpression": false,
780
+ "asc": true,
781
+ "nulls": "last"
782
+ },
783
+ {
784
+ "expression": "updated_at",
785
+ "isExpression": false,
786
+ "asc": true,
787
+ "nulls": "last"
788
+ }
789
+ ],
790
+ "isUnique": false,
791
+ "concurrently": false,
792
+ "method": "btree",
793
+ "with": {}
794
+ },
795
+ "agent_task_sessions_company_task_updated_idx": {
796
+ "name": "agent_task_sessions_company_task_updated_idx",
797
+ "columns": [
798
+ {
799
+ "expression": "company_id",
800
+ "isExpression": false,
801
+ "asc": true,
802
+ "nulls": "last"
803
+ },
804
+ {
805
+ "expression": "task_key",
806
+ "isExpression": false,
807
+ "asc": true,
808
+ "nulls": "last"
809
+ },
810
+ {
811
+ "expression": "updated_at",
812
+ "isExpression": false,
813
+ "asc": true,
814
+ "nulls": "last"
815
+ }
816
+ ],
817
+ "isUnique": false,
818
+ "concurrently": false,
819
+ "method": "btree",
820
+ "with": {}
821
+ }
822
+ },
823
+ "foreignKeys": {
824
+ "agent_task_sessions_company_id_companies_id_fk": {
825
+ "name": "agent_task_sessions_company_id_companies_id_fk",
826
+ "tableFrom": "agent_task_sessions",
827
+ "tableTo": "companies",
828
+ "columnsFrom": [
829
+ "company_id"
830
+ ],
831
+ "columnsTo": [
832
+ "id"
833
+ ],
834
+ "onDelete": "no action",
835
+ "onUpdate": "no action"
836
+ },
837
+ "agent_task_sessions_agent_id_agents_id_fk": {
838
+ "name": "agent_task_sessions_agent_id_agents_id_fk",
839
+ "tableFrom": "agent_task_sessions",
840
+ "tableTo": "agents",
841
+ "columnsFrom": [
842
+ "agent_id"
843
+ ],
844
+ "columnsTo": [
845
+ "id"
846
+ ],
847
+ "onDelete": "no action",
848
+ "onUpdate": "no action"
849
+ },
850
+ "agent_task_sessions_last_run_id_heartbeat_runs_id_fk": {
851
+ "name": "agent_task_sessions_last_run_id_heartbeat_runs_id_fk",
852
+ "tableFrom": "agent_task_sessions",
853
+ "tableTo": "heartbeat_runs",
854
+ "columnsFrom": [
855
+ "last_run_id"
856
+ ],
857
+ "columnsTo": [
858
+ "id"
859
+ ],
860
+ "onDelete": "no action",
861
+ "onUpdate": "no action"
862
+ }
863
+ },
864
+ "compositePrimaryKeys": {},
865
+ "uniqueConstraints": {},
866
+ "policies": {},
867
+ "checkConstraints": {},
868
+ "isRLSEnabled": false
869
+ },
870
+ "public.agent_wakeup_requests": {
871
+ "name": "agent_wakeup_requests",
872
+ "schema": "",
873
+ "columns": {
874
+ "id": {
875
+ "name": "id",
876
+ "type": "uuid",
877
+ "primaryKey": true,
878
+ "notNull": true,
879
+ "default": "gen_random_uuid()"
880
+ },
881
+ "company_id": {
882
+ "name": "company_id",
883
+ "type": "uuid",
884
+ "primaryKey": false,
885
+ "notNull": true
886
+ },
887
+ "agent_id": {
888
+ "name": "agent_id",
889
+ "type": "uuid",
890
+ "primaryKey": false,
891
+ "notNull": true
892
+ },
893
+ "source": {
894
+ "name": "source",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": true
898
+ },
899
+ "trigger_detail": {
900
+ "name": "trigger_detail",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": false
904
+ },
905
+ "reason": {
906
+ "name": "reason",
907
+ "type": "text",
908
+ "primaryKey": false,
909
+ "notNull": false
910
+ },
911
+ "payload": {
912
+ "name": "payload",
913
+ "type": "jsonb",
914
+ "primaryKey": false,
915
+ "notNull": false
916
+ },
917
+ "status": {
918
+ "name": "status",
919
+ "type": "text",
920
+ "primaryKey": false,
921
+ "notNull": true,
922
+ "default": "'queued'"
923
+ },
924
+ "coalesced_count": {
925
+ "name": "coalesced_count",
926
+ "type": "integer",
927
+ "primaryKey": false,
928
+ "notNull": true,
929
+ "default": 0
930
+ },
931
+ "requested_by_actor_type": {
932
+ "name": "requested_by_actor_type",
933
+ "type": "text",
934
+ "primaryKey": false,
935
+ "notNull": false
936
+ },
937
+ "requested_by_actor_id": {
938
+ "name": "requested_by_actor_id",
939
+ "type": "text",
940
+ "primaryKey": false,
941
+ "notNull": false
942
+ },
943
+ "idempotency_key": {
944
+ "name": "idempotency_key",
945
+ "type": "text",
946
+ "primaryKey": false,
947
+ "notNull": false
948
+ },
949
+ "run_id": {
950
+ "name": "run_id",
951
+ "type": "uuid",
952
+ "primaryKey": false,
953
+ "notNull": false
954
+ },
955
+ "requested_at": {
956
+ "name": "requested_at",
957
+ "type": "timestamp with time zone",
958
+ "primaryKey": false,
959
+ "notNull": true,
960
+ "default": "now()"
961
+ },
962
+ "claimed_at": {
963
+ "name": "claimed_at",
964
+ "type": "timestamp with time zone",
965
+ "primaryKey": false,
966
+ "notNull": false
967
+ },
968
+ "finished_at": {
969
+ "name": "finished_at",
970
+ "type": "timestamp with time zone",
971
+ "primaryKey": false,
972
+ "notNull": false
973
+ },
974
+ "error": {
975
+ "name": "error",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": false
979
+ },
980
+ "created_at": {
981
+ "name": "created_at",
982
+ "type": "timestamp with time zone",
983
+ "primaryKey": false,
984
+ "notNull": true,
985
+ "default": "now()"
986
+ },
987
+ "updated_at": {
988
+ "name": "updated_at",
989
+ "type": "timestamp with time zone",
990
+ "primaryKey": false,
991
+ "notNull": true,
992
+ "default": "now()"
993
+ }
994
+ },
995
+ "indexes": {
996
+ "agent_wakeup_requests_company_agent_status_idx": {
997
+ "name": "agent_wakeup_requests_company_agent_status_idx",
998
+ "columns": [
999
+ {
1000
+ "expression": "company_id",
1001
+ "isExpression": false,
1002
+ "asc": true,
1003
+ "nulls": "last"
1004
+ },
1005
+ {
1006
+ "expression": "agent_id",
1007
+ "isExpression": false,
1008
+ "asc": true,
1009
+ "nulls": "last"
1010
+ },
1011
+ {
1012
+ "expression": "status",
1013
+ "isExpression": false,
1014
+ "asc": true,
1015
+ "nulls": "last"
1016
+ }
1017
+ ],
1018
+ "isUnique": false,
1019
+ "concurrently": false,
1020
+ "method": "btree",
1021
+ "with": {}
1022
+ },
1023
+ "agent_wakeup_requests_company_requested_idx": {
1024
+ "name": "agent_wakeup_requests_company_requested_idx",
1025
+ "columns": [
1026
+ {
1027
+ "expression": "company_id",
1028
+ "isExpression": false,
1029
+ "asc": true,
1030
+ "nulls": "last"
1031
+ },
1032
+ {
1033
+ "expression": "requested_at",
1034
+ "isExpression": false,
1035
+ "asc": true,
1036
+ "nulls": "last"
1037
+ }
1038
+ ],
1039
+ "isUnique": false,
1040
+ "concurrently": false,
1041
+ "method": "btree",
1042
+ "with": {}
1043
+ },
1044
+ "agent_wakeup_requests_agent_requested_idx": {
1045
+ "name": "agent_wakeup_requests_agent_requested_idx",
1046
+ "columns": [
1047
+ {
1048
+ "expression": "agent_id",
1049
+ "isExpression": false,
1050
+ "asc": true,
1051
+ "nulls": "last"
1052
+ },
1053
+ {
1054
+ "expression": "requested_at",
1055
+ "isExpression": false,
1056
+ "asc": true,
1057
+ "nulls": "last"
1058
+ }
1059
+ ],
1060
+ "isUnique": false,
1061
+ "concurrently": false,
1062
+ "method": "btree",
1063
+ "with": {}
1064
+ }
1065
+ },
1066
+ "foreignKeys": {
1067
+ "agent_wakeup_requests_company_id_companies_id_fk": {
1068
+ "name": "agent_wakeup_requests_company_id_companies_id_fk",
1069
+ "tableFrom": "agent_wakeup_requests",
1070
+ "tableTo": "companies",
1071
+ "columnsFrom": [
1072
+ "company_id"
1073
+ ],
1074
+ "columnsTo": [
1075
+ "id"
1076
+ ],
1077
+ "onDelete": "no action",
1078
+ "onUpdate": "no action"
1079
+ },
1080
+ "agent_wakeup_requests_agent_id_agents_id_fk": {
1081
+ "name": "agent_wakeup_requests_agent_id_agents_id_fk",
1082
+ "tableFrom": "agent_wakeup_requests",
1083
+ "tableTo": "agents",
1084
+ "columnsFrom": [
1085
+ "agent_id"
1086
+ ],
1087
+ "columnsTo": [
1088
+ "id"
1089
+ ],
1090
+ "onDelete": "no action",
1091
+ "onUpdate": "no action"
1092
+ }
1093
+ },
1094
+ "compositePrimaryKeys": {},
1095
+ "uniqueConstraints": {},
1096
+ "policies": {},
1097
+ "checkConstraints": {},
1098
+ "isRLSEnabled": false
1099
+ },
1100
+ "public.agents": {
1101
+ "name": "agents",
1102
+ "schema": "",
1103
+ "columns": {
1104
+ "id": {
1105
+ "name": "id",
1106
+ "type": "uuid",
1107
+ "primaryKey": true,
1108
+ "notNull": true,
1109
+ "default": "gen_random_uuid()"
1110
+ },
1111
+ "company_id": {
1112
+ "name": "company_id",
1113
+ "type": "uuid",
1114
+ "primaryKey": false,
1115
+ "notNull": true
1116
+ },
1117
+ "name": {
1118
+ "name": "name",
1119
+ "type": "text",
1120
+ "primaryKey": false,
1121
+ "notNull": true
1122
+ },
1123
+ "role": {
1124
+ "name": "role",
1125
+ "type": "text",
1126
+ "primaryKey": false,
1127
+ "notNull": true,
1128
+ "default": "'general'"
1129
+ },
1130
+ "title": {
1131
+ "name": "title",
1132
+ "type": "text",
1133
+ "primaryKey": false,
1134
+ "notNull": false
1135
+ },
1136
+ "status": {
1137
+ "name": "status",
1138
+ "type": "text",
1139
+ "primaryKey": false,
1140
+ "notNull": true,
1141
+ "default": "'idle'"
1142
+ },
1143
+ "reports_to": {
1144
+ "name": "reports_to",
1145
+ "type": "uuid",
1146
+ "primaryKey": false,
1147
+ "notNull": false
1148
+ },
1149
+ "capabilities": {
1150
+ "name": "capabilities",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ },
1155
+ "adapter_type": {
1156
+ "name": "adapter_type",
1157
+ "type": "text",
1158
+ "primaryKey": false,
1159
+ "notNull": true,
1160
+ "default": "'process'"
1161
+ },
1162
+ "adapter_config": {
1163
+ "name": "adapter_config",
1164
+ "type": "jsonb",
1165
+ "primaryKey": false,
1166
+ "notNull": true,
1167
+ "default": "'{}'::jsonb"
1168
+ },
1169
+ "runtime_config": {
1170
+ "name": "runtime_config",
1171
+ "type": "jsonb",
1172
+ "primaryKey": false,
1173
+ "notNull": true,
1174
+ "default": "'{}'::jsonb"
1175
+ },
1176
+ "budget_monthly_cents": {
1177
+ "name": "budget_monthly_cents",
1178
+ "type": "integer",
1179
+ "primaryKey": false,
1180
+ "notNull": true,
1181
+ "default": 0
1182
+ },
1183
+ "spent_monthly_cents": {
1184
+ "name": "spent_monthly_cents",
1185
+ "type": "integer",
1186
+ "primaryKey": false,
1187
+ "notNull": true,
1188
+ "default": 0
1189
+ },
1190
+ "permissions": {
1191
+ "name": "permissions",
1192
+ "type": "jsonb",
1193
+ "primaryKey": false,
1194
+ "notNull": true,
1195
+ "default": "'{}'::jsonb"
1196
+ },
1197
+ "last_heartbeat_at": {
1198
+ "name": "last_heartbeat_at",
1199
+ "type": "timestamp with time zone",
1200
+ "primaryKey": false,
1201
+ "notNull": false
1202
+ },
1203
+ "metadata": {
1204
+ "name": "metadata",
1205
+ "type": "jsonb",
1206
+ "primaryKey": false,
1207
+ "notNull": false
1208
+ },
1209
+ "created_at": {
1210
+ "name": "created_at",
1211
+ "type": "timestamp with time zone",
1212
+ "primaryKey": false,
1213
+ "notNull": true,
1214
+ "default": "now()"
1215
+ },
1216
+ "updated_at": {
1217
+ "name": "updated_at",
1218
+ "type": "timestamp with time zone",
1219
+ "primaryKey": false,
1220
+ "notNull": true,
1221
+ "default": "now()"
1222
+ }
1223
+ },
1224
+ "indexes": {
1225
+ "agents_company_status_idx": {
1226
+ "name": "agents_company_status_idx",
1227
+ "columns": [
1228
+ {
1229
+ "expression": "company_id",
1230
+ "isExpression": false,
1231
+ "asc": true,
1232
+ "nulls": "last"
1233
+ },
1234
+ {
1235
+ "expression": "status",
1236
+ "isExpression": false,
1237
+ "asc": true,
1238
+ "nulls": "last"
1239
+ }
1240
+ ],
1241
+ "isUnique": false,
1242
+ "concurrently": false,
1243
+ "method": "btree",
1244
+ "with": {}
1245
+ },
1246
+ "agents_company_reports_to_idx": {
1247
+ "name": "agents_company_reports_to_idx",
1248
+ "columns": [
1249
+ {
1250
+ "expression": "company_id",
1251
+ "isExpression": false,
1252
+ "asc": true,
1253
+ "nulls": "last"
1254
+ },
1255
+ {
1256
+ "expression": "reports_to",
1257
+ "isExpression": false,
1258
+ "asc": true,
1259
+ "nulls": "last"
1260
+ }
1261
+ ],
1262
+ "isUnique": false,
1263
+ "concurrently": false,
1264
+ "method": "btree",
1265
+ "with": {}
1266
+ }
1267
+ },
1268
+ "foreignKeys": {
1269
+ "agents_company_id_companies_id_fk": {
1270
+ "name": "agents_company_id_companies_id_fk",
1271
+ "tableFrom": "agents",
1272
+ "tableTo": "companies",
1273
+ "columnsFrom": [
1274
+ "company_id"
1275
+ ],
1276
+ "columnsTo": [
1277
+ "id"
1278
+ ],
1279
+ "onDelete": "no action",
1280
+ "onUpdate": "no action"
1281
+ },
1282
+ "agents_reports_to_agents_id_fk": {
1283
+ "name": "agents_reports_to_agents_id_fk",
1284
+ "tableFrom": "agents",
1285
+ "tableTo": "agents",
1286
+ "columnsFrom": [
1287
+ "reports_to"
1288
+ ],
1289
+ "columnsTo": [
1290
+ "id"
1291
+ ],
1292
+ "onDelete": "no action",
1293
+ "onUpdate": "no action"
1294
+ }
1295
+ },
1296
+ "compositePrimaryKeys": {},
1297
+ "uniqueConstraints": {},
1298
+ "policies": {},
1299
+ "checkConstraints": {},
1300
+ "isRLSEnabled": false
1301
+ },
1302
+ "public.approval_comments": {
1303
+ "name": "approval_comments",
1304
+ "schema": "",
1305
+ "columns": {
1306
+ "id": {
1307
+ "name": "id",
1308
+ "type": "uuid",
1309
+ "primaryKey": true,
1310
+ "notNull": true,
1311
+ "default": "gen_random_uuid()"
1312
+ },
1313
+ "company_id": {
1314
+ "name": "company_id",
1315
+ "type": "uuid",
1316
+ "primaryKey": false,
1317
+ "notNull": true
1318
+ },
1319
+ "approval_id": {
1320
+ "name": "approval_id",
1321
+ "type": "uuid",
1322
+ "primaryKey": false,
1323
+ "notNull": true
1324
+ },
1325
+ "author_agent_id": {
1326
+ "name": "author_agent_id",
1327
+ "type": "uuid",
1328
+ "primaryKey": false,
1329
+ "notNull": false
1330
+ },
1331
+ "author_user_id": {
1332
+ "name": "author_user_id",
1333
+ "type": "text",
1334
+ "primaryKey": false,
1335
+ "notNull": false
1336
+ },
1337
+ "body": {
1338
+ "name": "body",
1339
+ "type": "text",
1340
+ "primaryKey": false,
1341
+ "notNull": true
1342
+ },
1343
+ "created_at": {
1344
+ "name": "created_at",
1345
+ "type": "timestamp with time zone",
1346
+ "primaryKey": false,
1347
+ "notNull": true,
1348
+ "default": "now()"
1349
+ },
1350
+ "updated_at": {
1351
+ "name": "updated_at",
1352
+ "type": "timestamp with time zone",
1353
+ "primaryKey": false,
1354
+ "notNull": true,
1355
+ "default": "now()"
1356
+ }
1357
+ },
1358
+ "indexes": {
1359
+ "approval_comments_company_idx": {
1360
+ "name": "approval_comments_company_idx",
1361
+ "columns": [
1362
+ {
1363
+ "expression": "company_id",
1364
+ "isExpression": false,
1365
+ "asc": true,
1366
+ "nulls": "last"
1367
+ }
1368
+ ],
1369
+ "isUnique": false,
1370
+ "concurrently": false,
1371
+ "method": "btree",
1372
+ "with": {}
1373
+ },
1374
+ "approval_comments_approval_idx": {
1375
+ "name": "approval_comments_approval_idx",
1376
+ "columns": [
1377
+ {
1378
+ "expression": "approval_id",
1379
+ "isExpression": false,
1380
+ "asc": true,
1381
+ "nulls": "last"
1382
+ }
1383
+ ],
1384
+ "isUnique": false,
1385
+ "concurrently": false,
1386
+ "method": "btree",
1387
+ "with": {}
1388
+ },
1389
+ "approval_comments_approval_created_idx": {
1390
+ "name": "approval_comments_approval_created_idx",
1391
+ "columns": [
1392
+ {
1393
+ "expression": "approval_id",
1394
+ "isExpression": false,
1395
+ "asc": true,
1396
+ "nulls": "last"
1397
+ },
1398
+ {
1399
+ "expression": "created_at",
1400
+ "isExpression": false,
1401
+ "asc": true,
1402
+ "nulls": "last"
1403
+ }
1404
+ ],
1405
+ "isUnique": false,
1406
+ "concurrently": false,
1407
+ "method": "btree",
1408
+ "with": {}
1409
+ }
1410
+ },
1411
+ "foreignKeys": {
1412
+ "approval_comments_company_id_companies_id_fk": {
1413
+ "name": "approval_comments_company_id_companies_id_fk",
1414
+ "tableFrom": "approval_comments",
1415
+ "tableTo": "companies",
1416
+ "columnsFrom": [
1417
+ "company_id"
1418
+ ],
1419
+ "columnsTo": [
1420
+ "id"
1421
+ ],
1422
+ "onDelete": "no action",
1423
+ "onUpdate": "no action"
1424
+ },
1425
+ "approval_comments_approval_id_approvals_id_fk": {
1426
+ "name": "approval_comments_approval_id_approvals_id_fk",
1427
+ "tableFrom": "approval_comments",
1428
+ "tableTo": "approvals",
1429
+ "columnsFrom": [
1430
+ "approval_id"
1431
+ ],
1432
+ "columnsTo": [
1433
+ "id"
1434
+ ],
1435
+ "onDelete": "no action",
1436
+ "onUpdate": "no action"
1437
+ },
1438
+ "approval_comments_author_agent_id_agents_id_fk": {
1439
+ "name": "approval_comments_author_agent_id_agents_id_fk",
1440
+ "tableFrom": "approval_comments",
1441
+ "tableTo": "agents",
1442
+ "columnsFrom": [
1443
+ "author_agent_id"
1444
+ ],
1445
+ "columnsTo": [
1446
+ "id"
1447
+ ],
1448
+ "onDelete": "no action",
1449
+ "onUpdate": "no action"
1450
+ }
1451
+ },
1452
+ "compositePrimaryKeys": {},
1453
+ "uniqueConstraints": {},
1454
+ "policies": {},
1455
+ "checkConstraints": {},
1456
+ "isRLSEnabled": false
1457
+ },
1458
+ "public.approvals": {
1459
+ "name": "approvals",
1460
+ "schema": "",
1461
+ "columns": {
1462
+ "id": {
1463
+ "name": "id",
1464
+ "type": "uuid",
1465
+ "primaryKey": true,
1466
+ "notNull": true,
1467
+ "default": "gen_random_uuid()"
1468
+ },
1469
+ "company_id": {
1470
+ "name": "company_id",
1471
+ "type": "uuid",
1472
+ "primaryKey": false,
1473
+ "notNull": true
1474
+ },
1475
+ "type": {
1476
+ "name": "type",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": true
1480
+ },
1481
+ "requested_by_agent_id": {
1482
+ "name": "requested_by_agent_id",
1483
+ "type": "uuid",
1484
+ "primaryKey": false,
1485
+ "notNull": false
1486
+ },
1487
+ "requested_by_user_id": {
1488
+ "name": "requested_by_user_id",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": false
1492
+ },
1493
+ "status": {
1494
+ "name": "status",
1495
+ "type": "text",
1496
+ "primaryKey": false,
1497
+ "notNull": true,
1498
+ "default": "'pending'"
1499
+ },
1500
+ "payload": {
1501
+ "name": "payload",
1502
+ "type": "jsonb",
1503
+ "primaryKey": false,
1504
+ "notNull": true
1505
+ },
1506
+ "decision_note": {
1507
+ "name": "decision_note",
1508
+ "type": "text",
1509
+ "primaryKey": false,
1510
+ "notNull": false
1511
+ },
1512
+ "decided_by_user_id": {
1513
+ "name": "decided_by_user_id",
1514
+ "type": "text",
1515
+ "primaryKey": false,
1516
+ "notNull": false
1517
+ },
1518
+ "decided_at": {
1519
+ "name": "decided_at",
1520
+ "type": "timestamp with time zone",
1521
+ "primaryKey": false,
1522
+ "notNull": false
1523
+ },
1524
+ "created_at": {
1525
+ "name": "created_at",
1526
+ "type": "timestamp with time zone",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "default": "now()"
1530
+ },
1531
+ "updated_at": {
1532
+ "name": "updated_at",
1533
+ "type": "timestamp with time zone",
1534
+ "primaryKey": false,
1535
+ "notNull": true,
1536
+ "default": "now()"
1537
+ }
1538
+ },
1539
+ "indexes": {
1540
+ "approvals_company_status_type_idx": {
1541
+ "name": "approvals_company_status_type_idx",
1542
+ "columns": [
1543
+ {
1544
+ "expression": "company_id",
1545
+ "isExpression": false,
1546
+ "asc": true,
1547
+ "nulls": "last"
1548
+ },
1549
+ {
1550
+ "expression": "status",
1551
+ "isExpression": false,
1552
+ "asc": true,
1553
+ "nulls": "last"
1554
+ },
1555
+ {
1556
+ "expression": "type",
1557
+ "isExpression": false,
1558
+ "asc": true,
1559
+ "nulls": "last"
1560
+ }
1561
+ ],
1562
+ "isUnique": false,
1563
+ "concurrently": false,
1564
+ "method": "btree",
1565
+ "with": {}
1566
+ }
1567
+ },
1568
+ "foreignKeys": {
1569
+ "approvals_company_id_companies_id_fk": {
1570
+ "name": "approvals_company_id_companies_id_fk",
1571
+ "tableFrom": "approvals",
1572
+ "tableTo": "companies",
1573
+ "columnsFrom": [
1574
+ "company_id"
1575
+ ],
1576
+ "columnsTo": [
1577
+ "id"
1578
+ ],
1579
+ "onDelete": "no action",
1580
+ "onUpdate": "no action"
1581
+ },
1582
+ "approvals_requested_by_agent_id_agents_id_fk": {
1583
+ "name": "approvals_requested_by_agent_id_agents_id_fk",
1584
+ "tableFrom": "approvals",
1585
+ "tableTo": "agents",
1586
+ "columnsFrom": [
1587
+ "requested_by_agent_id"
1588
+ ],
1589
+ "columnsTo": [
1590
+ "id"
1591
+ ],
1592
+ "onDelete": "no action",
1593
+ "onUpdate": "no action"
1594
+ }
1595
+ },
1596
+ "compositePrimaryKeys": {},
1597
+ "uniqueConstraints": {},
1598
+ "policies": {},
1599
+ "checkConstraints": {},
1600
+ "isRLSEnabled": false
1601
+ },
1602
+ "public.assets": {
1603
+ "name": "assets",
1604
+ "schema": "",
1605
+ "columns": {
1606
+ "id": {
1607
+ "name": "id",
1608
+ "type": "uuid",
1609
+ "primaryKey": true,
1610
+ "notNull": true,
1611
+ "default": "gen_random_uuid()"
1612
+ },
1613
+ "company_id": {
1614
+ "name": "company_id",
1615
+ "type": "uuid",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "provider": {
1620
+ "name": "provider",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": true
1624
+ },
1625
+ "object_key": {
1626
+ "name": "object_key",
1627
+ "type": "text",
1628
+ "primaryKey": false,
1629
+ "notNull": true
1630
+ },
1631
+ "content_type": {
1632
+ "name": "content_type",
1633
+ "type": "text",
1634
+ "primaryKey": false,
1635
+ "notNull": true
1636
+ },
1637
+ "byte_size": {
1638
+ "name": "byte_size",
1639
+ "type": "integer",
1640
+ "primaryKey": false,
1641
+ "notNull": true
1642
+ },
1643
+ "sha256": {
1644
+ "name": "sha256",
1645
+ "type": "text",
1646
+ "primaryKey": false,
1647
+ "notNull": true
1648
+ },
1649
+ "original_filename": {
1650
+ "name": "original_filename",
1651
+ "type": "text",
1652
+ "primaryKey": false,
1653
+ "notNull": false
1654
+ },
1655
+ "created_by_agent_id": {
1656
+ "name": "created_by_agent_id",
1657
+ "type": "uuid",
1658
+ "primaryKey": false,
1659
+ "notNull": false
1660
+ },
1661
+ "created_by_user_id": {
1662
+ "name": "created_by_user_id",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": false
1666
+ },
1667
+ "created_at": {
1668
+ "name": "created_at",
1669
+ "type": "timestamp with time zone",
1670
+ "primaryKey": false,
1671
+ "notNull": true,
1672
+ "default": "now()"
1673
+ },
1674
+ "updated_at": {
1675
+ "name": "updated_at",
1676
+ "type": "timestamp with time zone",
1677
+ "primaryKey": false,
1678
+ "notNull": true,
1679
+ "default": "now()"
1680
+ }
1681
+ },
1682
+ "indexes": {
1683
+ "assets_company_created_idx": {
1684
+ "name": "assets_company_created_idx",
1685
+ "columns": [
1686
+ {
1687
+ "expression": "company_id",
1688
+ "isExpression": false,
1689
+ "asc": true,
1690
+ "nulls": "last"
1691
+ },
1692
+ {
1693
+ "expression": "created_at",
1694
+ "isExpression": false,
1695
+ "asc": true,
1696
+ "nulls": "last"
1697
+ }
1698
+ ],
1699
+ "isUnique": false,
1700
+ "concurrently": false,
1701
+ "method": "btree",
1702
+ "with": {}
1703
+ },
1704
+ "assets_company_provider_idx": {
1705
+ "name": "assets_company_provider_idx",
1706
+ "columns": [
1707
+ {
1708
+ "expression": "company_id",
1709
+ "isExpression": false,
1710
+ "asc": true,
1711
+ "nulls": "last"
1712
+ },
1713
+ {
1714
+ "expression": "provider",
1715
+ "isExpression": false,
1716
+ "asc": true,
1717
+ "nulls": "last"
1718
+ }
1719
+ ],
1720
+ "isUnique": false,
1721
+ "concurrently": false,
1722
+ "method": "btree",
1723
+ "with": {}
1724
+ },
1725
+ "assets_company_object_key_uq": {
1726
+ "name": "assets_company_object_key_uq",
1727
+ "columns": [
1728
+ {
1729
+ "expression": "company_id",
1730
+ "isExpression": false,
1731
+ "asc": true,
1732
+ "nulls": "last"
1733
+ },
1734
+ {
1735
+ "expression": "object_key",
1736
+ "isExpression": false,
1737
+ "asc": true,
1738
+ "nulls": "last"
1739
+ }
1740
+ ],
1741
+ "isUnique": true,
1742
+ "concurrently": false,
1743
+ "method": "btree",
1744
+ "with": {}
1745
+ }
1746
+ },
1747
+ "foreignKeys": {
1748
+ "assets_company_id_companies_id_fk": {
1749
+ "name": "assets_company_id_companies_id_fk",
1750
+ "tableFrom": "assets",
1751
+ "tableTo": "companies",
1752
+ "columnsFrom": [
1753
+ "company_id"
1754
+ ],
1755
+ "columnsTo": [
1756
+ "id"
1757
+ ],
1758
+ "onDelete": "no action",
1759
+ "onUpdate": "no action"
1760
+ },
1761
+ "assets_created_by_agent_id_agents_id_fk": {
1762
+ "name": "assets_created_by_agent_id_agents_id_fk",
1763
+ "tableFrom": "assets",
1764
+ "tableTo": "agents",
1765
+ "columnsFrom": [
1766
+ "created_by_agent_id"
1767
+ ],
1768
+ "columnsTo": [
1769
+ "id"
1770
+ ],
1771
+ "onDelete": "no action",
1772
+ "onUpdate": "no action"
1773
+ }
1774
+ },
1775
+ "compositePrimaryKeys": {},
1776
+ "uniqueConstraints": {},
1777
+ "policies": {},
1778
+ "checkConstraints": {},
1779
+ "isRLSEnabled": false
1780
+ },
1781
+ "public.companies": {
1782
+ "name": "companies",
1783
+ "schema": "",
1784
+ "columns": {
1785
+ "id": {
1786
+ "name": "id",
1787
+ "type": "uuid",
1788
+ "primaryKey": true,
1789
+ "notNull": true,
1790
+ "default": "gen_random_uuid()"
1791
+ },
1792
+ "name": {
1793
+ "name": "name",
1794
+ "type": "text",
1795
+ "primaryKey": false,
1796
+ "notNull": true
1797
+ },
1798
+ "description": {
1799
+ "name": "description",
1800
+ "type": "text",
1801
+ "primaryKey": false,
1802
+ "notNull": false
1803
+ },
1804
+ "status": {
1805
+ "name": "status",
1806
+ "type": "text",
1807
+ "primaryKey": false,
1808
+ "notNull": true,
1809
+ "default": "'active'"
1810
+ },
1811
+ "issue_prefix": {
1812
+ "name": "issue_prefix",
1813
+ "type": "text",
1814
+ "primaryKey": false,
1815
+ "notNull": true,
1816
+ "default": "'PAP'"
1817
+ },
1818
+ "issue_counter": {
1819
+ "name": "issue_counter",
1820
+ "type": "integer",
1821
+ "primaryKey": false,
1822
+ "notNull": true,
1823
+ "default": 0
1824
+ },
1825
+ "budget_monthly_cents": {
1826
+ "name": "budget_monthly_cents",
1827
+ "type": "integer",
1828
+ "primaryKey": false,
1829
+ "notNull": true,
1830
+ "default": 0
1831
+ },
1832
+ "spent_monthly_cents": {
1833
+ "name": "spent_monthly_cents",
1834
+ "type": "integer",
1835
+ "primaryKey": false,
1836
+ "notNull": true,
1837
+ "default": 0
1838
+ },
1839
+ "require_board_approval_for_new_agents": {
1840
+ "name": "require_board_approval_for_new_agents",
1841
+ "type": "boolean",
1842
+ "primaryKey": false,
1843
+ "notNull": true,
1844
+ "default": true
1845
+ },
1846
+ "created_at": {
1847
+ "name": "created_at",
1848
+ "type": "timestamp with time zone",
1849
+ "primaryKey": false,
1850
+ "notNull": true,
1851
+ "default": "now()"
1852
+ },
1853
+ "updated_at": {
1854
+ "name": "updated_at",
1855
+ "type": "timestamp with time zone",
1856
+ "primaryKey": false,
1857
+ "notNull": true,
1858
+ "default": "now()"
1859
+ }
1860
+ },
1861
+ "indexes": {},
1862
+ "foreignKeys": {},
1863
+ "compositePrimaryKeys": {},
1864
+ "uniqueConstraints": {},
1865
+ "policies": {},
1866
+ "checkConstraints": {},
1867
+ "isRLSEnabled": false
1868
+ },
1869
+ "public.company_secret_versions": {
1870
+ "name": "company_secret_versions",
1871
+ "schema": "",
1872
+ "columns": {
1873
+ "id": {
1874
+ "name": "id",
1875
+ "type": "uuid",
1876
+ "primaryKey": true,
1877
+ "notNull": true,
1878
+ "default": "gen_random_uuid()"
1879
+ },
1880
+ "secret_id": {
1881
+ "name": "secret_id",
1882
+ "type": "uuid",
1883
+ "primaryKey": false,
1884
+ "notNull": true
1885
+ },
1886
+ "version": {
1887
+ "name": "version",
1888
+ "type": "integer",
1889
+ "primaryKey": false,
1890
+ "notNull": true
1891
+ },
1892
+ "material": {
1893
+ "name": "material",
1894
+ "type": "jsonb",
1895
+ "primaryKey": false,
1896
+ "notNull": true
1897
+ },
1898
+ "value_sha256": {
1899
+ "name": "value_sha256",
1900
+ "type": "text",
1901
+ "primaryKey": false,
1902
+ "notNull": true
1903
+ },
1904
+ "created_by_agent_id": {
1905
+ "name": "created_by_agent_id",
1906
+ "type": "uuid",
1907
+ "primaryKey": false,
1908
+ "notNull": false
1909
+ },
1910
+ "created_by_user_id": {
1911
+ "name": "created_by_user_id",
1912
+ "type": "text",
1913
+ "primaryKey": false,
1914
+ "notNull": false
1915
+ },
1916
+ "created_at": {
1917
+ "name": "created_at",
1918
+ "type": "timestamp with time zone",
1919
+ "primaryKey": false,
1920
+ "notNull": true,
1921
+ "default": "now()"
1922
+ },
1923
+ "revoked_at": {
1924
+ "name": "revoked_at",
1925
+ "type": "timestamp with time zone",
1926
+ "primaryKey": false,
1927
+ "notNull": false
1928
+ }
1929
+ },
1930
+ "indexes": {
1931
+ "company_secret_versions_secret_idx": {
1932
+ "name": "company_secret_versions_secret_idx",
1933
+ "columns": [
1934
+ {
1935
+ "expression": "secret_id",
1936
+ "isExpression": false,
1937
+ "asc": true,
1938
+ "nulls": "last"
1939
+ },
1940
+ {
1941
+ "expression": "created_at",
1942
+ "isExpression": false,
1943
+ "asc": true,
1944
+ "nulls": "last"
1945
+ }
1946
+ ],
1947
+ "isUnique": false,
1948
+ "concurrently": false,
1949
+ "method": "btree",
1950
+ "with": {}
1951
+ },
1952
+ "company_secret_versions_value_sha256_idx": {
1953
+ "name": "company_secret_versions_value_sha256_idx",
1954
+ "columns": [
1955
+ {
1956
+ "expression": "value_sha256",
1957
+ "isExpression": false,
1958
+ "asc": true,
1959
+ "nulls": "last"
1960
+ }
1961
+ ],
1962
+ "isUnique": false,
1963
+ "concurrently": false,
1964
+ "method": "btree",
1965
+ "with": {}
1966
+ },
1967
+ "company_secret_versions_secret_version_uq": {
1968
+ "name": "company_secret_versions_secret_version_uq",
1969
+ "columns": [
1970
+ {
1971
+ "expression": "secret_id",
1972
+ "isExpression": false,
1973
+ "asc": true,
1974
+ "nulls": "last"
1975
+ },
1976
+ {
1977
+ "expression": "version",
1978
+ "isExpression": false,
1979
+ "asc": true,
1980
+ "nulls": "last"
1981
+ }
1982
+ ],
1983
+ "isUnique": true,
1984
+ "concurrently": false,
1985
+ "method": "btree",
1986
+ "with": {}
1987
+ }
1988
+ },
1989
+ "foreignKeys": {
1990
+ "company_secret_versions_secret_id_company_secrets_id_fk": {
1991
+ "name": "company_secret_versions_secret_id_company_secrets_id_fk",
1992
+ "tableFrom": "company_secret_versions",
1993
+ "tableTo": "company_secrets",
1994
+ "columnsFrom": [
1995
+ "secret_id"
1996
+ ],
1997
+ "columnsTo": [
1998
+ "id"
1999
+ ],
2000
+ "onDelete": "cascade",
2001
+ "onUpdate": "no action"
2002
+ },
2003
+ "company_secret_versions_created_by_agent_id_agents_id_fk": {
2004
+ "name": "company_secret_versions_created_by_agent_id_agents_id_fk",
2005
+ "tableFrom": "company_secret_versions",
2006
+ "tableTo": "agents",
2007
+ "columnsFrom": [
2008
+ "created_by_agent_id"
2009
+ ],
2010
+ "columnsTo": [
2011
+ "id"
2012
+ ],
2013
+ "onDelete": "set null",
2014
+ "onUpdate": "no action"
2015
+ }
2016
+ },
2017
+ "compositePrimaryKeys": {},
2018
+ "uniqueConstraints": {},
2019
+ "policies": {},
2020
+ "checkConstraints": {},
2021
+ "isRLSEnabled": false
2022
+ },
2023
+ "public.company_secrets": {
2024
+ "name": "company_secrets",
2025
+ "schema": "",
2026
+ "columns": {
2027
+ "id": {
2028
+ "name": "id",
2029
+ "type": "uuid",
2030
+ "primaryKey": true,
2031
+ "notNull": true,
2032
+ "default": "gen_random_uuid()"
2033
+ },
2034
+ "company_id": {
2035
+ "name": "company_id",
2036
+ "type": "uuid",
2037
+ "primaryKey": false,
2038
+ "notNull": true
2039
+ },
2040
+ "name": {
2041
+ "name": "name",
2042
+ "type": "text",
2043
+ "primaryKey": false,
2044
+ "notNull": true
2045
+ },
2046
+ "provider": {
2047
+ "name": "provider",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": true,
2051
+ "default": "'local_encrypted'"
2052
+ },
2053
+ "external_ref": {
2054
+ "name": "external_ref",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false
2058
+ },
2059
+ "latest_version": {
2060
+ "name": "latest_version",
2061
+ "type": "integer",
2062
+ "primaryKey": false,
2063
+ "notNull": true,
2064
+ "default": 1
2065
+ },
2066
+ "description": {
2067
+ "name": "description",
2068
+ "type": "text",
2069
+ "primaryKey": false,
2070
+ "notNull": false
2071
+ },
2072
+ "created_by_agent_id": {
2073
+ "name": "created_by_agent_id",
2074
+ "type": "uuid",
2075
+ "primaryKey": false,
2076
+ "notNull": false
2077
+ },
2078
+ "created_by_user_id": {
2079
+ "name": "created_by_user_id",
2080
+ "type": "text",
2081
+ "primaryKey": false,
2082
+ "notNull": false
2083
+ },
2084
+ "created_at": {
2085
+ "name": "created_at",
2086
+ "type": "timestamp with time zone",
2087
+ "primaryKey": false,
2088
+ "notNull": true,
2089
+ "default": "now()"
2090
+ },
2091
+ "updated_at": {
2092
+ "name": "updated_at",
2093
+ "type": "timestamp with time zone",
2094
+ "primaryKey": false,
2095
+ "notNull": true,
2096
+ "default": "now()"
2097
+ }
2098
+ },
2099
+ "indexes": {
2100
+ "company_secrets_company_idx": {
2101
+ "name": "company_secrets_company_idx",
2102
+ "columns": [
2103
+ {
2104
+ "expression": "company_id",
2105
+ "isExpression": false,
2106
+ "asc": true,
2107
+ "nulls": "last"
2108
+ }
2109
+ ],
2110
+ "isUnique": false,
2111
+ "concurrently": false,
2112
+ "method": "btree",
2113
+ "with": {}
2114
+ },
2115
+ "company_secrets_company_provider_idx": {
2116
+ "name": "company_secrets_company_provider_idx",
2117
+ "columns": [
2118
+ {
2119
+ "expression": "company_id",
2120
+ "isExpression": false,
2121
+ "asc": true,
2122
+ "nulls": "last"
2123
+ },
2124
+ {
2125
+ "expression": "provider",
2126
+ "isExpression": false,
2127
+ "asc": true,
2128
+ "nulls": "last"
2129
+ }
2130
+ ],
2131
+ "isUnique": false,
2132
+ "concurrently": false,
2133
+ "method": "btree",
2134
+ "with": {}
2135
+ },
2136
+ "company_secrets_company_name_uq": {
2137
+ "name": "company_secrets_company_name_uq",
2138
+ "columns": [
2139
+ {
2140
+ "expression": "company_id",
2141
+ "isExpression": false,
2142
+ "asc": true,
2143
+ "nulls": "last"
2144
+ },
2145
+ {
2146
+ "expression": "name",
2147
+ "isExpression": false,
2148
+ "asc": true,
2149
+ "nulls": "last"
2150
+ }
2151
+ ],
2152
+ "isUnique": true,
2153
+ "concurrently": false,
2154
+ "method": "btree",
2155
+ "with": {}
2156
+ }
2157
+ },
2158
+ "foreignKeys": {
2159
+ "company_secrets_company_id_companies_id_fk": {
2160
+ "name": "company_secrets_company_id_companies_id_fk",
2161
+ "tableFrom": "company_secrets",
2162
+ "tableTo": "companies",
2163
+ "columnsFrom": [
2164
+ "company_id"
2165
+ ],
2166
+ "columnsTo": [
2167
+ "id"
2168
+ ],
2169
+ "onDelete": "no action",
2170
+ "onUpdate": "no action"
2171
+ },
2172
+ "company_secrets_created_by_agent_id_agents_id_fk": {
2173
+ "name": "company_secrets_created_by_agent_id_agents_id_fk",
2174
+ "tableFrom": "company_secrets",
2175
+ "tableTo": "agents",
2176
+ "columnsFrom": [
2177
+ "created_by_agent_id"
2178
+ ],
2179
+ "columnsTo": [
2180
+ "id"
2181
+ ],
2182
+ "onDelete": "set null",
2183
+ "onUpdate": "no action"
2184
+ }
2185
+ },
2186
+ "compositePrimaryKeys": {},
2187
+ "uniqueConstraints": {},
2188
+ "policies": {},
2189
+ "checkConstraints": {},
2190
+ "isRLSEnabled": false
2191
+ },
2192
+ "public.cost_events": {
2193
+ "name": "cost_events",
2194
+ "schema": "",
2195
+ "columns": {
2196
+ "id": {
2197
+ "name": "id",
2198
+ "type": "uuid",
2199
+ "primaryKey": true,
2200
+ "notNull": true,
2201
+ "default": "gen_random_uuid()"
2202
+ },
2203
+ "company_id": {
2204
+ "name": "company_id",
2205
+ "type": "uuid",
2206
+ "primaryKey": false,
2207
+ "notNull": true
2208
+ },
2209
+ "agent_id": {
2210
+ "name": "agent_id",
2211
+ "type": "uuid",
2212
+ "primaryKey": false,
2213
+ "notNull": true
2214
+ },
2215
+ "issue_id": {
2216
+ "name": "issue_id",
2217
+ "type": "uuid",
2218
+ "primaryKey": false,
2219
+ "notNull": false
2220
+ },
2221
+ "project_id": {
2222
+ "name": "project_id",
2223
+ "type": "uuid",
2224
+ "primaryKey": false,
2225
+ "notNull": false
2226
+ },
2227
+ "goal_id": {
2228
+ "name": "goal_id",
2229
+ "type": "uuid",
2230
+ "primaryKey": false,
2231
+ "notNull": false
2232
+ },
2233
+ "billing_code": {
2234
+ "name": "billing_code",
2235
+ "type": "text",
2236
+ "primaryKey": false,
2237
+ "notNull": false
2238
+ },
2239
+ "provider": {
2240
+ "name": "provider",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": true
2244
+ },
2245
+ "model": {
2246
+ "name": "model",
2247
+ "type": "text",
2248
+ "primaryKey": false,
2249
+ "notNull": true
2250
+ },
2251
+ "input_tokens": {
2252
+ "name": "input_tokens",
2253
+ "type": "integer",
2254
+ "primaryKey": false,
2255
+ "notNull": true,
2256
+ "default": 0
2257
+ },
2258
+ "output_tokens": {
2259
+ "name": "output_tokens",
2260
+ "type": "integer",
2261
+ "primaryKey": false,
2262
+ "notNull": true,
2263
+ "default": 0
2264
+ },
2265
+ "cost_cents": {
2266
+ "name": "cost_cents",
2267
+ "type": "integer",
2268
+ "primaryKey": false,
2269
+ "notNull": true
2270
+ },
2271
+ "occurred_at": {
2272
+ "name": "occurred_at",
2273
+ "type": "timestamp with time zone",
2274
+ "primaryKey": false,
2275
+ "notNull": true
2276
+ },
2277
+ "created_at": {
2278
+ "name": "created_at",
2279
+ "type": "timestamp with time zone",
2280
+ "primaryKey": false,
2281
+ "notNull": true,
2282
+ "default": "now()"
2283
+ }
2284
+ },
2285
+ "indexes": {
2286
+ "cost_events_company_occurred_idx": {
2287
+ "name": "cost_events_company_occurred_idx",
2288
+ "columns": [
2289
+ {
2290
+ "expression": "company_id",
2291
+ "isExpression": false,
2292
+ "asc": true,
2293
+ "nulls": "last"
2294
+ },
2295
+ {
2296
+ "expression": "occurred_at",
2297
+ "isExpression": false,
2298
+ "asc": true,
2299
+ "nulls": "last"
2300
+ }
2301
+ ],
2302
+ "isUnique": false,
2303
+ "concurrently": false,
2304
+ "method": "btree",
2305
+ "with": {}
2306
+ },
2307
+ "cost_events_company_agent_occurred_idx": {
2308
+ "name": "cost_events_company_agent_occurred_idx",
2309
+ "columns": [
2310
+ {
2311
+ "expression": "company_id",
2312
+ "isExpression": false,
2313
+ "asc": true,
2314
+ "nulls": "last"
2315
+ },
2316
+ {
2317
+ "expression": "agent_id",
2318
+ "isExpression": false,
2319
+ "asc": true,
2320
+ "nulls": "last"
2321
+ },
2322
+ {
2323
+ "expression": "occurred_at",
2324
+ "isExpression": false,
2325
+ "asc": true,
2326
+ "nulls": "last"
2327
+ }
2328
+ ],
2329
+ "isUnique": false,
2330
+ "concurrently": false,
2331
+ "method": "btree",
2332
+ "with": {}
2333
+ }
2334
+ },
2335
+ "foreignKeys": {
2336
+ "cost_events_company_id_companies_id_fk": {
2337
+ "name": "cost_events_company_id_companies_id_fk",
2338
+ "tableFrom": "cost_events",
2339
+ "tableTo": "companies",
2340
+ "columnsFrom": [
2341
+ "company_id"
2342
+ ],
2343
+ "columnsTo": [
2344
+ "id"
2345
+ ],
2346
+ "onDelete": "no action",
2347
+ "onUpdate": "no action"
2348
+ },
2349
+ "cost_events_agent_id_agents_id_fk": {
2350
+ "name": "cost_events_agent_id_agents_id_fk",
2351
+ "tableFrom": "cost_events",
2352
+ "tableTo": "agents",
2353
+ "columnsFrom": [
2354
+ "agent_id"
2355
+ ],
2356
+ "columnsTo": [
2357
+ "id"
2358
+ ],
2359
+ "onDelete": "no action",
2360
+ "onUpdate": "no action"
2361
+ },
2362
+ "cost_events_issue_id_issues_id_fk": {
2363
+ "name": "cost_events_issue_id_issues_id_fk",
2364
+ "tableFrom": "cost_events",
2365
+ "tableTo": "issues",
2366
+ "columnsFrom": [
2367
+ "issue_id"
2368
+ ],
2369
+ "columnsTo": [
2370
+ "id"
2371
+ ],
2372
+ "onDelete": "no action",
2373
+ "onUpdate": "no action"
2374
+ },
2375
+ "cost_events_project_id_projects_id_fk": {
2376
+ "name": "cost_events_project_id_projects_id_fk",
2377
+ "tableFrom": "cost_events",
2378
+ "tableTo": "projects",
2379
+ "columnsFrom": [
2380
+ "project_id"
2381
+ ],
2382
+ "columnsTo": [
2383
+ "id"
2384
+ ],
2385
+ "onDelete": "no action",
2386
+ "onUpdate": "no action"
2387
+ },
2388
+ "cost_events_goal_id_goals_id_fk": {
2389
+ "name": "cost_events_goal_id_goals_id_fk",
2390
+ "tableFrom": "cost_events",
2391
+ "tableTo": "goals",
2392
+ "columnsFrom": [
2393
+ "goal_id"
2394
+ ],
2395
+ "columnsTo": [
2396
+ "id"
2397
+ ],
2398
+ "onDelete": "no action",
2399
+ "onUpdate": "no action"
2400
+ }
2401
+ },
2402
+ "compositePrimaryKeys": {},
2403
+ "uniqueConstraints": {},
2404
+ "policies": {},
2405
+ "checkConstraints": {},
2406
+ "isRLSEnabled": false
2407
+ },
2408
+ "public.goals": {
2409
+ "name": "goals",
2410
+ "schema": "",
2411
+ "columns": {
2412
+ "id": {
2413
+ "name": "id",
2414
+ "type": "uuid",
2415
+ "primaryKey": true,
2416
+ "notNull": true,
2417
+ "default": "gen_random_uuid()"
2418
+ },
2419
+ "company_id": {
2420
+ "name": "company_id",
2421
+ "type": "uuid",
2422
+ "primaryKey": false,
2423
+ "notNull": true
2424
+ },
2425
+ "title": {
2426
+ "name": "title",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "description": {
2432
+ "name": "description",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": false
2436
+ },
2437
+ "level": {
2438
+ "name": "level",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": true,
2442
+ "default": "'task'"
2443
+ },
2444
+ "status": {
2445
+ "name": "status",
2446
+ "type": "text",
2447
+ "primaryKey": false,
2448
+ "notNull": true,
2449
+ "default": "'planned'"
2450
+ },
2451
+ "parent_id": {
2452
+ "name": "parent_id",
2453
+ "type": "uuid",
2454
+ "primaryKey": false,
2455
+ "notNull": false
2456
+ },
2457
+ "owner_agent_id": {
2458
+ "name": "owner_agent_id",
2459
+ "type": "uuid",
2460
+ "primaryKey": false,
2461
+ "notNull": false
2462
+ },
2463
+ "created_at": {
2464
+ "name": "created_at",
2465
+ "type": "timestamp with time zone",
2466
+ "primaryKey": false,
2467
+ "notNull": true,
2468
+ "default": "now()"
2469
+ },
2470
+ "updated_at": {
2471
+ "name": "updated_at",
2472
+ "type": "timestamp with time zone",
2473
+ "primaryKey": false,
2474
+ "notNull": true,
2475
+ "default": "now()"
2476
+ }
2477
+ },
2478
+ "indexes": {
2479
+ "goals_company_idx": {
2480
+ "name": "goals_company_idx",
2481
+ "columns": [
2482
+ {
2483
+ "expression": "company_id",
2484
+ "isExpression": false,
2485
+ "asc": true,
2486
+ "nulls": "last"
2487
+ }
2488
+ ],
2489
+ "isUnique": false,
2490
+ "concurrently": false,
2491
+ "method": "btree",
2492
+ "with": {}
2493
+ }
2494
+ },
2495
+ "foreignKeys": {
2496
+ "goals_company_id_companies_id_fk": {
2497
+ "name": "goals_company_id_companies_id_fk",
2498
+ "tableFrom": "goals",
2499
+ "tableTo": "companies",
2500
+ "columnsFrom": [
2501
+ "company_id"
2502
+ ],
2503
+ "columnsTo": [
2504
+ "id"
2505
+ ],
2506
+ "onDelete": "no action",
2507
+ "onUpdate": "no action"
2508
+ },
2509
+ "goals_parent_id_goals_id_fk": {
2510
+ "name": "goals_parent_id_goals_id_fk",
2511
+ "tableFrom": "goals",
2512
+ "tableTo": "goals",
2513
+ "columnsFrom": [
2514
+ "parent_id"
2515
+ ],
2516
+ "columnsTo": [
2517
+ "id"
2518
+ ],
2519
+ "onDelete": "no action",
2520
+ "onUpdate": "no action"
2521
+ },
2522
+ "goals_owner_agent_id_agents_id_fk": {
2523
+ "name": "goals_owner_agent_id_agents_id_fk",
2524
+ "tableFrom": "goals",
2525
+ "tableTo": "agents",
2526
+ "columnsFrom": [
2527
+ "owner_agent_id"
2528
+ ],
2529
+ "columnsTo": [
2530
+ "id"
2531
+ ],
2532
+ "onDelete": "no action",
2533
+ "onUpdate": "no action"
2534
+ }
2535
+ },
2536
+ "compositePrimaryKeys": {},
2537
+ "uniqueConstraints": {},
2538
+ "policies": {},
2539
+ "checkConstraints": {},
2540
+ "isRLSEnabled": false
2541
+ },
2542
+ "public.heartbeat_run_events": {
2543
+ "name": "heartbeat_run_events",
2544
+ "schema": "",
2545
+ "columns": {
2546
+ "id": {
2547
+ "name": "id",
2548
+ "type": "bigserial",
2549
+ "primaryKey": true,
2550
+ "notNull": true
2551
+ },
2552
+ "company_id": {
2553
+ "name": "company_id",
2554
+ "type": "uuid",
2555
+ "primaryKey": false,
2556
+ "notNull": true
2557
+ },
2558
+ "run_id": {
2559
+ "name": "run_id",
2560
+ "type": "uuid",
2561
+ "primaryKey": false,
2562
+ "notNull": true
2563
+ },
2564
+ "agent_id": {
2565
+ "name": "agent_id",
2566
+ "type": "uuid",
2567
+ "primaryKey": false,
2568
+ "notNull": true
2569
+ },
2570
+ "seq": {
2571
+ "name": "seq",
2572
+ "type": "integer",
2573
+ "primaryKey": false,
2574
+ "notNull": true
2575
+ },
2576
+ "event_type": {
2577
+ "name": "event_type",
2578
+ "type": "text",
2579
+ "primaryKey": false,
2580
+ "notNull": true
2581
+ },
2582
+ "stream": {
2583
+ "name": "stream",
2584
+ "type": "text",
2585
+ "primaryKey": false,
2586
+ "notNull": false
2587
+ },
2588
+ "level": {
2589
+ "name": "level",
2590
+ "type": "text",
2591
+ "primaryKey": false,
2592
+ "notNull": false
2593
+ },
2594
+ "color": {
2595
+ "name": "color",
2596
+ "type": "text",
2597
+ "primaryKey": false,
2598
+ "notNull": false
2599
+ },
2600
+ "message": {
2601
+ "name": "message",
2602
+ "type": "text",
2603
+ "primaryKey": false,
2604
+ "notNull": false
2605
+ },
2606
+ "payload": {
2607
+ "name": "payload",
2608
+ "type": "jsonb",
2609
+ "primaryKey": false,
2610
+ "notNull": false
2611
+ },
2612
+ "created_at": {
2613
+ "name": "created_at",
2614
+ "type": "timestamp with time zone",
2615
+ "primaryKey": false,
2616
+ "notNull": true,
2617
+ "default": "now()"
2618
+ }
2619
+ },
2620
+ "indexes": {
2621
+ "heartbeat_run_events_run_seq_idx": {
2622
+ "name": "heartbeat_run_events_run_seq_idx",
2623
+ "columns": [
2624
+ {
2625
+ "expression": "run_id",
2626
+ "isExpression": false,
2627
+ "asc": true,
2628
+ "nulls": "last"
2629
+ },
2630
+ {
2631
+ "expression": "seq",
2632
+ "isExpression": false,
2633
+ "asc": true,
2634
+ "nulls": "last"
2635
+ }
2636
+ ],
2637
+ "isUnique": false,
2638
+ "concurrently": false,
2639
+ "method": "btree",
2640
+ "with": {}
2641
+ },
2642
+ "heartbeat_run_events_company_run_idx": {
2643
+ "name": "heartbeat_run_events_company_run_idx",
2644
+ "columns": [
2645
+ {
2646
+ "expression": "company_id",
2647
+ "isExpression": false,
2648
+ "asc": true,
2649
+ "nulls": "last"
2650
+ },
2651
+ {
2652
+ "expression": "run_id",
2653
+ "isExpression": false,
2654
+ "asc": true,
2655
+ "nulls": "last"
2656
+ }
2657
+ ],
2658
+ "isUnique": false,
2659
+ "concurrently": false,
2660
+ "method": "btree",
2661
+ "with": {}
2662
+ },
2663
+ "heartbeat_run_events_company_created_idx": {
2664
+ "name": "heartbeat_run_events_company_created_idx",
2665
+ "columns": [
2666
+ {
2667
+ "expression": "company_id",
2668
+ "isExpression": false,
2669
+ "asc": true,
2670
+ "nulls": "last"
2671
+ },
2672
+ {
2673
+ "expression": "created_at",
2674
+ "isExpression": false,
2675
+ "asc": true,
2676
+ "nulls": "last"
2677
+ }
2678
+ ],
2679
+ "isUnique": false,
2680
+ "concurrently": false,
2681
+ "method": "btree",
2682
+ "with": {}
2683
+ }
2684
+ },
2685
+ "foreignKeys": {
2686
+ "heartbeat_run_events_company_id_companies_id_fk": {
2687
+ "name": "heartbeat_run_events_company_id_companies_id_fk",
2688
+ "tableFrom": "heartbeat_run_events",
2689
+ "tableTo": "companies",
2690
+ "columnsFrom": [
2691
+ "company_id"
2692
+ ],
2693
+ "columnsTo": [
2694
+ "id"
2695
+ ],
2696
+ "onDelete": "no action",
2697
+ "onUpdate": "no action"
2698
+ },
2699
+ "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
2700
+ "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
2701
+ "tableFrom": "heartbeat_run_events",
2702
+ "tableTo": "heartbeat_runs",
2703
+ "columnsFrom": [
2704
+ "run_id"
2705
+ ],
2706
+ "columnsTo": [
2707
+ "id"
2708
+ ],
2709
+ "onDelete": "no action",
2710
+ "onUpdate": "no action"
2711
+ },
2712
+ "heartbeat_run_events_agent_id_agents_id_fk": {
2713
+ "name": "heartbeat_run_events_agent_id_agents_id_fk",
2714
+ "tableFrom": "heartbeat_run_events",
2715
+ "tableTo": "agents",
2716
+ "columnsFrom": [
2717
+ "agent_id"
2718
+ ],
2719
+ "columnsTo": [
2720
+ "id"
2721
+ ],
2722
+ "onDelete": "no action",
2723
+ "onUpdate": "no action"
2724
+ }
2725
+ },
2726
+ "compositePrimaryKeys": {},
2727
+ "uniqueConstraints": {},
2728
+ "policies": {},
2729
+ "checkConstraints": {},
2730
+ "isRLSEnabled": false
2731
+ },
2732
+ "public.heartbeat_runs": {
2733
+ "name": "heartbeat_runs",
2734
+ "schema": "",
2735
+ "columns": {
2736
+ "id": {
2737
+ "name": "id",
2738
+ "type": "uuid",
2739
+ "primaryKey": true,
2740
+ "notNull": true,
2741
+ "default": "gen_random_uuid()"
2742
+ },
2743
+ "company_id": {
2744
+ "name": "company_id",
2745
+ "type": "uuid",
2746
+ "primaryKey": false,
2747
+ "notNull": true
2748
+ },
2749
+ "agent_id": {
2750
+ "name": "agent_id",
2751
+ "type": "uuid",
2752
+ "primaryKey": false,
2753
+ "notNull": true
2754
+ },
2755
+ "invocation_source": {
2756
+ "name": "invocation_source",
2757
+ "type": "text",
2758
+ "primaryKey": false,
2759
+ "notNull": true,
2760
+ "default": "'on_demand'"
2761
+ },
2762
+ "trigger_detail": {
2763
+ "name": "trigger_detail",
2764
+ "type": "text",
2765
+ "primaryKey": false,
2766
+ "notNull": false
2767
+ },
2768
+ "status": {
2769
+ "name": "status",
2770
+ "type": "text",
2771
+ "primaryKey": false,
2772
+ "notNull": true,
2773
+ "default": "'queued'"
2774
+ },
2775
+ "started_at": {
2776
+ "name": "started_at",
2777
+ "type": "timestamp with time zone",
2778
+ "primaryKey": false,
2779
+ "notNull": false
2780
+ },
2781
+ "finished_at": {
2782
+ "name": "finished_at",
2783
+ "type": "timestamp with time zone",
2784
+ "primaryKey": false,
2785
+ "notNull": false
2786
+ },
2787
+ "error": {
2788
+ "name": "error",
2789
+ "type": "text",
2790
+ "primaryKey": false,
2791
+ "notNull": false
2792
+ },
2793
+ "wakeup_request_id": {
2794
+ "name": "wakeup_request_id",
2795
+ "type": "uuid",
2796
+ "primaryKey": false,
2797
+ "notNull": false
2798
+ },
2799
+ "exit_code": {
2800
+ "name": "exit_code",
2801
+ "type": "integer",
2802
+ "primaryKey": false,
2803
+ "notNull": false
2804
+ },
2805
+ "signal": {
2806
+ "name": "signal",
2807
+ "type": "text",
2808
+ "primaryKey": false,
2809
+ "notNull": false
2810
+ },
2811
+ "usage_json": {
2812
+ "name": "usage_json",
2813
+ "type": "jsonb",
2814
+ "primaryKey": false,
2815
+ "notNull": false
2816
+ },
2817
+ "result_json": {
2818
+ "name": "result_json",
2819
+ "type": "jsonb",
2820
+ "primaryKey": false,
2821
+ "notNull": false
2822
+ },
2823
+ "session_id_before": {
2824
+ "name": "session_id_before",
2825
+ "type": "text",
2826
+ "primaryKey": false,
2827
+ "notNull": false
2828
+ },
2829
+ "session_id_after": {
2830
+ "name": "session_id_after",
2831
+ "type": "text",
2832
+ "primaryKey": false,
2833
+ "notNull": false
2834
+ },
2835
+ "log_store": {
2836
+ "name": "log_store",
2837
+ "type": "text",
2838
+ "primaryKey": false,
2839
+ "notNull": false
2840
+ },
2841
+ "log_ref": {
2842
+ "name": "log_ref",
2843
+ "type": "text",
2844
+ "primaryKey": false,
2845
+ "notNull": false
2846
+ },
2847
+ "log_bytes": {
2848
+ "name": "log_bytes",
2849
+ "type": "bigint",
2850
+ "primaryKey": false,
2851
+ "notNull": false
2852
+ },
2853
+ "log_sha256": {
2854
+ "name": "log_sha256",
2855
+ "type": "text",
2856
+ "primaryKey": false,
2857
+ "notNull": false
2858
+ },
2859
+ "log_compressed": {
2860
+ "name": "log_compressed",
2861
+ "type": "boolean",
2862
+ "primaryKey": false,
2863
+ "notNull": true,
2864
+ "default": false
2865
+ },
2866
+ "stdout_excerpt": {
2867
+ "name": "stdout_excerpt",
2868
+ "type": "text",
2869
+ "primaryKey": false,
2870
+ "notNull": false
2871
+ },
2872
+ "stderr_excerpt": {
2873
+ "name": "stderr_excerpt",
2874
+ "type": "text",
2875
+ "primaryKey": false,
2876
+ "notNull": false
2877
+ },
2878
+ "error_code": {
2879
+ "name": "error_code",
2880
+ "type": "text",
2881
+ "primaryKey": false,
2882
+ "notNull": false
2883
+ },
2884
+ "external_run_id": {
2885
+ "name": "external_run_id",
2886
+ "type": "text",
2887
+ "primaryKey": false,
2888
+ "notNull": false
2889
+ },
2890
+ "context_snapshot": {
2891
+ "name": "context_snapshot",
2892
+ "type": "jsonb",
2893
+ "primaryKey": false,
2894
+ "notNull": false
2895
+ },
2896
+ "created_at": {
2897
+ "name": "created_at",
2898
+ "type": "timestamp with time zone",
2899
+ "primaryKey": false,
2900
+ "notNull": true,
2901
+ "default": "now()"
2902
+ },
2903
+ "updated_at": {
2904
+ "name": "updated_at",
2905
+ "type": "timestamp with time zone",
2906
+ "primaryKey": false,
2907
+ "notNull": true,
2908
+ "default": "now()"
2909
+ }
2910
+ },
2911
+ "indexes": {
2912
+ "heartbeat_runs_company_agent_started_idx": {
2913
+ "name": "heartbeat_runs_company_agent_started_idx",
2914
+ "columns": [
2915
+ {
2916
+ "expression": "company_id",
2917
+ "isExpression": false,
2918
+ "asc": true,
2919
+ "nulls": "last"
2920
+ },
2921
+ {
2922
+ "expression": "agent_id",
2923
+ "isExpression": false,
2924
+ "asc": true,
2925
+ "nulls": "last"
2926
+ },
2927
+ {
2928
+ "expression": "started_at",
2929
+ "isExpression": false,
2930
+ "asc": true,
2931
+ "nulls": "last"
2932
+ }
2933
+ ],
2934
+ "isUnique": false,
2935
+ "concurrently": false,
2936
+ "method": "btree",
2937
+ "with": {}
2938
+ }
2939
+ },
2940
+ "foreignKeys": {
2941
+ "heartbeat_runs_company_id_companies_id_fk": {
2942
+ "name": "heartbeat_runs_company_id_companies_id_fk",
2943
+ "tableFrom": "heartbeat_runs",
2944
+ "tableTo": "companies",
2945
+ "columnsFrom": [
2946
+ "company_id"
2947
+ ],
2948
+ "columnsTo": [
2949
+ "id"
2950
+ ],
2951
+ "onDelete": "no action",
2952
+ "onUpdate": "no action"
2953
+ },
2954
+ "heartbeat_runs_agent_id_agents_id_fk": {
2955
+ "name": "heartbeat_runs_agent_id_agents_id_fk",
2956
+ "tableFrom": "heartbeat_runs",
2957
+ "tableTo": "agents",
2958
+ "columnsFrom": [
2959
+ "agent_id"
2960
+ ],
2961
+ "columnsTo": [
2962
+ "id"
2963
+ ],
2964
+ "onDelete": "no action",
2965
+ "onUpdate": "no action"
2966
+ },
2967
+ "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
2968
+ "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
2969
+ "tableFrom": "heartbeat_runs",
2970
+ "tableTo": "agent_wakeup_requests",
2971
+ "columnsFrom": [
2972
+ "wakeup_request_id"
2973
+ ],
2974
+ "columnsTo": [
2975
+ "id"
2976
+ ],
2977
+ "onDelete": "no action",
2978
+ "onUpdate": "no action"
2979
+ }
2980
+ },
2981
+ "compositePrimaryKeys": {},
2982
+ "uniqueConstraints": {},
2983
+ "policies": {},
2984
+ "checkConstraints": {},
2985
+ "isRLSEnabled": false
2986
+ },
2987
+ "public.issue_approvals": {
2988
+ "name": "issue_approvals",
2989
+ "schema": "",
2990
+ "columns": {
2991
+ "company_id": {
2992
+ "name": "company_id",
2993
+ "type": "uuid",
2994
+ "primaryKey": false,
2995
+ "notNull": true
2996
+ },
2997
+ "issue_id": {
2998
+ "name": "issue_id",
2999
+ "type": "uuid",
3000
+ "primaryKey": false,
3001
+ "notNull": true
3002
+ },
3003
+ "approval_id": {
3004
+ "name": "approval_id",
3005
+ "type": "uuid",
3006
+ "primaryKey": false,
3007
+ "notNull": true
3008
+ },
3009
+ "linked_by_agent_id": {
3010
+ "name": "linked_by_agent_id",
3011
+ "type": "uuid",
3012
+ "primaryKey": false,
3013
+ "notNull": false
3014
+ },
3015
+ "linked_by_user_id": {
3016
+ "name": "linked_by_user_id",
3017
+ "type": "text",
3018
+ "primaryKey": false,
3019
+ "notNull": false
3020
+ },
3021
+ "created_at": {
3022
+ "name": "created_at",
3023
+ "type": "timestamp with time zone",
3024
+ "primaryKey": false,
3025
+ "notNull": true,
3026
+ "default": "now()"
3027
+ }
3028
+ },
3029
+ "indexes": {
3030
+ "issue_approvals_issue_idx": {
3031
+ "name": "issue_approvals_issue_idx",
3032
+ "columns": [
3033
+ {
3034
+ "expression": "issue_id",
3035
+ "isExpression": false,
3036
+ "asc": true,
3037
+ "nulls": "last"
3038
+ }
3039
+ ],
3040
+ "isUnique": false,
3041
+ "concurrently": false,
3042
+ "method": "btree",
3043
+ "with": {}
3044
+ },
3045
+ "issue_approvals_approval_idx": {
3046
+ "name": "issue_approvals_approval_idx",
3047
+ "columns": [
3048
+ {
3049
+ "expression": "approval_id",
3050
+ "isExpression": false,
3051
+ "asc": true,
3052
+ "nulls": "last"
3053
+ }
3054
+ ],
3055
+ "isUnique": false,
3056
+ "concurrently": false,
3057
+ "method": "btree",
3058
+ "with": {}
3059
+ },
3060
+ "issue_approvals_company_idx": {
3061
+ "name": "issue_approvals_company_idx",
3062
+ "columns": [
3063
+ {
3064
+ "expression": "company_id",
3065
+ "isExpression": false,
3066
+ "asc": true,
3067
+ "nulls": "last"
3068
+ }
3069
+ ],
3070
+ "isUnique": false,
3071
+ "concurrently": false,
3072
+ "method": "btree",
3073
+ "with": {}
3074
+ }
3075
+ },
3076
+ "foreignKeys": {
3077
+ "issue_approvals_company_id_companies_id_fk": {
3078
+ "name": "issue_approvals_company_id_companies_id_fk",
3079
+ "tableFrom": "issue_approvals",
3080
+ "tableTo": "companies",
3081
+ "columnsFrom": [
3082
+ "company_id"
3083
+ ],
3084
+ "columnsTo": [
3085
+ "id"
3086
+ ],
3087
+ "onDelete": "no action",
3088
+ "onUpdate": "no action"
3089
+ },
3090
+ "issue_approvals_issue_id_issues_id_fk": {
3091
+ "name": "issue_approvals_issue_id_issues_id_fk",
3092
+ "tableFrom": "issue_approvals",
3093
+ "tableTo": "issues",
3094
+ "columnsFrom": [
3095
+ "issue_id"
3096
+ ],
3097
+ "columnsTo": [
3098
+ "id"
3099
+ ],
3100
+ "onDelete": "cascade",
3101
+ "onUpdate": "no action"
3102
+ },
3103
+ "issue_approvals_approval_id_approvals_id_fk": {
3104
+ "name": "issue_approvals_approval_id_approvals_id_fk",
3105
+ "tableFrom": "issue_approvals",
3106
+ "tableTo": "approvals",
3107
+ "columnsFrom": [
3108
+ "approval_id"
3109
+ ],
3110
+ "columnsTo": [
3111
+ "id"
3112
+ ],
3113
+ "onDelete": "cascade",
3114
+ "onUpdate": "no action"
3115
+ },
3116
+ "issue_approvals_linked_by_agent_id_agents_id_fk": {
3117
+ "name": "issue_approvals_linked_by_agent_id_agents_id_fk",
3118
+ "tableFrom": "issue_approvals",
3119
+ "tableTo": "agents",
3120
+ "columnsFrom": [
3121
+ "linked_by_agent_id"
3122
+ ],
3123
+ "columnsTo": [
3124
+ "id"
3125
+ ],
3126
+ "onDelete": "set null",
3127
+ "onUpdate": "no action"
3128
+ }
3129
+ },
3130
+ "compositePrimaryKeys": {
3131
+ "issue_approvals_pk": {
3132
+ "name": "issue_approvals_pk",
3133
+ "columns": [
3134
+ "issue_id",
3135
+ "approval_id"
3136
+ ]
3137
+ }
3138
+ },
3139
+ "uniqueConstraints": {},
3140
+ "policies": {},
3141
+ "checkConstraints": {},
3142
+ "isRLSEnabled": false
3143
+ },
3144
+ "public.issue_attachments": {
3145
+ "name": "issue_attachments",
3146
+ "schema": "",
3147
+ "columns": {
3148
+ "id": {
3149
+ "name": "id",
3150
+ "type": "uuid",
3151
+ "primaryKey": true,
3152
+ "notNull": true,
3153
+ "default": "gen_random_uuid()"
3154
+ },
3155
+ "company_id": {
3156
+ "name": "company_id",
3157
+ "type": "uuid",
3158
+ "primaryKey": false,
3159
+ "notNull": true
3160
+ },
3161
+ "issue_id": {
3162
+ "name": "issue_id",
3163
+ "type": "uuid",
3164
+ "primaryKey": false,
3165
+ "notNull": true
3166
+ },
3167
+ "asset_id": {
3168
+ "name": "asset_id",
3169
+ "type": "uuid",
3170
+ "primaryKey": false,
3171
+ "notNull": true
3172
+ },
3173
+ "issue_comment_id": {
3174
+ "name": "issue_comment_id",
3175
+ "type": "uuid",
3176
+ "primaryKey": false,
3177
+ "notNull": false
3178
+ },
3179
+ "created_at": {
3180
+ "name": "created_at",
3181
+ "type": "timestamp with time zone",
3182
+ "primaryKey": false,
3183
+ "notNull": true,
3184
+ "default": "now()"
3185
+ },
3186
+ "updated_at": {
3187
+ "name": "updated_at",
3188
+ "type": "timestamp with time zone",
3189
+ "primaryKey": false,
3190
+ "notNull": true,
3191
+ "default": "now()"
3192
+ }
3193
+ },
3194
+ "indexes": {
3195
+ "issue_attachments_company_issue_idx": {
3196
+ "name": "issue_attachments_company_issue_idx",
3197
+ "columns": [
3198
+ {
3199
+ "expression": "company_id",
3200
+ "isExpression": false,
3201
+ "asc": true,
3202
+ "nulls": "last"
3203
+ },
3204
+ {
3205
+ "expression": "issue_id",
3206
+ "isExpression": false,
3207
+ "asc": true,
3208
+ "nulls": "last"
3209
+ }
3210
+ ],
3211
+ "isUnique": false,
3212
+ "concurrently": false,
3213
+ "method": "btree",
3214
+ "with": {}
3215
+ },
3216
+ "issue_attachments_issue_comment_idx": {
3217
+ "name": "issue_attachments_issue_comment_idx",
3218
+ "columns": [
3219
+ {
3220
+ "expression": "issue_comment_id",
3221
+ "isExpression": false,
3222
+ "asc": true,
3223
+ "nulls": "last"
3224
+ }
3225
+ ],
3226
+ "isUnique": false,
3227
+ "concurrently": false,
3228
+ "method": "btree",
3229
+ "with": {}
3230
+ },
3231
+ "issue_attachments_asset_uq": {
3232
+ "name": "issue_attachments_asset_uq",
3233
+ "columns": [
3234
+ {
3235
+ "expression": "asset_id",
3236
+ "isExpression": false,
3237
+ "asc": true,
3238
+ "nulls": "last"
3239
+ }
3240
+ ],
3241
+ "isUnique": true,
3242
+ "concurrently": false,
3243
+ "method": "btree",
3244
+ "with": {}
3245
+ }
3246
+ },
3247
+ "foreignKeys": {
3248
+ "issue_attachments_company_id_companies_id_fk": {
3249
+ "name": "issue_attachments_company_id_companies_id_fk",
3250
+ "tableFrom": "issue_attachments",
3251
+ "tableTo": "companies",
3252
+ "columnsFrom": [
3253
+ "company_id"
3254
+ ],
3255
+ "columnsTo": [
3256
+ "id"
3257
+ ],
3258
+ "onDelete": "no action",
3259
+ "onUpdate": "no action"
3260
+ },
3261
+ "issue_attachments_issue_id_issues_id_fk": {
3262
+ "name": "issue_attachments_issue_id_issues_id_fk",
3263
+ "tableFrom": "issue_attachments",
3264
+ "tableTo": "issues",
3265
+ "columnsFrom": [
3266
+ "issue_id"
3267
+ ],
3268
+ "columnsTo": [
3269
+ "id"
3270
+ ],
3271
+ "onDelete": "cascade",
3272
+ "onUpdate": "no action"
3273
+ },
3274
+ "issue_attachments_asset_id_assets_id_fk": {
3275
+ "name": "issue_attachments_asset_id_assets_id_fk",
3276
+ "tableFrom": "issue_attachments",
3277
+ "tableTo": "assets",
3278
+ "columnsFrom": [
3279
+ "asset_id"
3280
+ ],
3281
+ "columnsTo": [
3282
+ "id"
3283
+ ],
3284
+ "onDelete": "cascade",
3285
+ "onUpdate": "no action"
3286
+ },
3287
+ "issue_attachments_issue_comment_id_issue_comments_id_fk": {
3288
+ "name": "issue_attachments_issue_comment_id_issue_comments_id_fk",
3289
+ "tableFrom": "issue_attachments",
3290
+ "tableTo": "issue_comments",
3291
+ "columnsFrom": [
3292
+ "issue_comment_id"
3293
+ ],
3294
+ "columnsTo": [
3295
+ "id"
3296
+ ],
3297
+ "onDelete": "set null",
3298
+ "onUpdate": "no action"
3299
+ }
3300
+ },
3301
+ "compositePrimaryKeys": {},
3302
+ "uniqueConstraints": {},
3303
+ "policies": {},
3304
+ "checkConstraints": {},
3305
+ "isRLSEnabled": false
3306
+ },
3307
+ "public.issue_comments": {
3308
+ "name": "issue_comments",
3309
+ "schema": "",
3310
+ "columns": {
3311
+ "id": {
3312
+ "name": "id",
3313
+ "type": "uuid",
3314
+ "primaryKey": true,
3315
+ "notNull": true,
3316
+ "default": "gen_random_uuid()"
3317
+ },
3318
+ "company_id": {
3319
+ "name": "company_id",
3320
+ "type": "uuid",
3321
+ "primaryKey": false,
3322
+ "notNull": true
3323
+ },
3324
+ "issue_id": {
3325
+ "name": "issue_id",
3326
+ "type": "uuid",
3327
+ "primaryKey": false,
3328
+ "notNull": true
3329
+ },
3330
+ "author_agent_id": {
3331
+ "name": "author_agent_id",
3332
+ "type": "uuid",
3333
+ "primaryKey": false,
3334
+ "notNull": false
3335
+ },
3336
+ "author_user_id": {
3337
+ "name": "author_user_id",
3338
+ "type": "text",
3339
+ "primaryKey": false,
3340
+ "notNull": false
3341
+ },
3342
+ "body": {
3343
+ "name": "body",
3344
+ "type": "text",
3345
+ "primaryKey": false,
3346
+ "notNull": true
3347
+ },
3348
+ "created_at": {
3349
+ "name": "created_at",
3350
+ "type": "timestamp with time zone",
3351
+ "primaryKey": false,
3352
+ "notNull": true,
3353
+ "default": "now()"
3354
+ },
3355
+ "updated_at": {
3356
+ "name": "updated_at",
3357
+ "type": "timestamp with time zone",
3358
+ "primaryKey": false,
3359
+ "notNull": true,
3360
+ "default": "now()"
3361
+ }
3362
+ },
3363
+ "indexes": {
3364
+ "issue_comments_issue_idx": {
3365
+ "name": "issue_comments_issue_idx",
3366
+ "columns": [
3367
+ {
3368
+ "expression": "issue_id",
3369
+ "isExpression": false,
3370
+ "asc": true,
3371
+ "nulls": "last"
3372
+ }
3373
+ ],
3374
+ "isUnique": false,
3375
+ "concurrently": false,
3376
+ "method": "btree",
3377
+ "with": {}
3378
+ },
3379
+ "issue_comments_company_idx": {
3380
+ "name": "issue_comments_company_idx",
3381
+ "columns": [
3382
+ {
3383
+ "expression": "company_id",
3384
+ "isExpression": false,
3385
+ "asc": true,
3386
+ "nulls": "last"
3387
+ }
3388
+ ],
3389
+ "isUnique": false,
3390
+ "concurrently": false,
3391
+ "method": "btree",
3392
+ "with": {}
3393
+ }
3394
+ },
3395
+ "foreignKeys": {
3396
+ "issue_comments_company_id_companies_id_fk": {
3397
+ "name": "issue_comments_company_id_companies_id_fk",
3398
+ "tableFrom": "issue_comments",
3399
+ "tableTo": "companies",
3400
+ "columnsFrom": [
3401
+ "company_id"
3402
+ ],
3403
+ "columnsTo": [
3404
+ "id"
3405
+ ],
3406
+ "onDelete": "no action",
3407
+ "onUpdate": "no action"
3408
+ },
3409
+ "issue_comments_issue_id_issues_id_fk": {
3410
+ "name": "issue_comments_issue_id_issues_id_fk",
3411
+ "tableFrom": "issue_comments",
3412
+ "tableTo": "issues",
3413
+ "columnsFrom": [
3414
+ "issue_id"
3415
+ ],
3416
+ "columnsTo": [
3417
+ "id"
3418
+ ],
3419
+ "onDelete": "no action",
3420
+ "onUpdate": "no action"
3421
+ },
3422
+ "issue_comments_author_agent_id_agents_id_fk": {
3423
+ "name": "issue_comments_author_agent_id_agents_id_fk",
3424
+ "tableFrom": "issue_comments",
3425
+ "tableTo": "agents",
3426
+ "columnsFrom": [
3427
+ "author_agent_id"
3428
+ ],
3429
+ "columnsTo": [
3430
+ "id"
3431
+ ],
3432
+ "onDelete": "no action",
3433
+ "onUpdate": "no action"
3434
+ }
3435
+ },
3436
+ "compositePrimaryKeys": {},
3437
+ "uniqueConstraints": {},
3438
+ "policies": {},
3439
+ "checkConstraints": {},
3440
+ "isRLSEnabled": false
3441
+ },
3442
+ "public.issues": {
3443
+ "name": "issues",
3444
+ "schema": "",
3445
+ "columns": {
3446
+ "id": {
3447
+ "name": "id",
3448
+ "type": "uuid",
3449
+ "primaryKey": true,
3450
+ "notNull": true,
3451
+ "default": "gen_random_uuid()"
3452
+ },
3453
+ "company_id": {
3454
+ "name": "company_id",
3455
+ "type": "uuid",
3456
+ "primaryKey": false,
3457
+ "notNull": true
3458
+ },
3459
+ "project_id": {
3460
+ "name": "project_id",
3461
+ "type": "uuid",
3462
+ "primaryKey": false,
3463
+ "notNull": false
3464
+ },
3465
+ "goal_id": {
3466
+ "name": "goal_id",
3467
+ "type": "uuid",
3468
+ "primaryKey": false,
3469
+ "notNull": false
3470
+ },
3471
+ "parent_id": {
3472
+ "name": "parent_id",
3473
+ "type": "uuid",
3474
+ "primaryKey": false,
3475
+ "notNull": false
3476
+ },
3477
+ "title": {
3478
+ "name": "title",
3479
+ "type": "text",
3480
+ "primaryKey": false,
3481
+ "notNull": true
3482
+ },
3483
+ "description": {
3484
+ "name": "description",
3485
+ "type": "text",
3486
+ "primaryKey": false,
3487
+ "notNull": false
3488
+ },
3489
+ "status": {
3490
+ "name": "status",
3491
+ "type": "text",
3492
+ "primaryKey": false,
3493
+ "notNull": true,
3494
+ "default": "'backlog'"
3495
+ },
3496
+ "priority": {
3497
+ "name": "priority",
3498
+ "type": "text",
3499
+ "primaryKey": false,
3500
+ "notNull": true,
3501
+ "default": "'medium'"
3502
+ },
3503
+ "assignee_agent_id": {
3504
+ "name": "assignee_agent_id",
3505
+ "type": "uuid",
3506
+ "primaryKey": false,
3507
+ "notNull": false
3508
+ },
3509
+ "checkout_run_id": {
3510
+ "name": "checkout_run_id",
3511
+ "type": "uuid",
3512
+ "primaryKey": false,
3513
+ "notNull": false
3514
+ },
3515
+ "created_by_agent_id": {
3516
+ "name": "created_by_agent_id",
3517
+ "type": "uuid",
3518
+ "primaryKey": false,
3519
+ "notNull": false
3520
+ },
3521
+ "created_by_user_id": {
3522
+ "name": "created_by_user_id",
3523
+ "type": "text",
3524
+ "primaryKey": false,
3525
+ "notNull": false
3526
+ },
3527
+ "issue_number": {
3528
+ "name": "issue_number",
3529
+ "type": "integer",
3530
+ "primaryKey": false,
3531
+ "notNull": false
3532
+ },
3533
+ "identifier": {
3534
+ "name": "identifier",
3535
+ "type": "text",
3536
+ "primaryKey": false,
3537
+ "notNull": false
3538
+ },
3539
+ "request_depth": {
3540
+ "name": "request_depth",
3541
+ "type": "integer",
3542
+ "primaryKey": false,
3543
+ "notNull": true,
3544
+ "default": 0
3545
+ },
3546
+ "billing_code": {
3547
+ "name": "billing_code",
3548
+ "type": "text",
3549
+ "primaryKey": false,
3550
+ "notNull": false
3551
+ },
3552
+ "started_at": {
3553
+ "name": "started_at",
3554
+ "type": "timestamp with time zone",
3555
+ "primaryKey": false,
3556
+ "notNull": false
3557
+ },
3558
+ "completed_at": {
3559
+ "name": "completed_at",
3560
+ "type": "timestamp with time zone",
3561
+ "primaryKey": false,
3562
+ "notNull": false
3563
+ },
3564
+ "cancelled_at": {
3565
+ "name": "cancelled_at",
3566
+ "type": "timestamp with time zone",
3567
+ "primaryKey": false,
3568
+ "notNull": false
3569
+ },
3570
+ "hidden_at": {
3571
+ "name": "hidden_at",
3572
+ "type": "timestamp with time zone",
3573
+ "primaryKey": false,
3574
+ "notNull": false
3575
+ },
3576
+ "created_at": {
3577
+ "name": "created_at",
3578
+ "type": "timestamp with time zone",
3579
+ "primaryKey": false,
3580
+ "notNull": true,
3581
+ "default": "now()"
3582
+ },
3583
+ "updated_at": {
3584
+ "name": "updated_at",
3585
+ "type": "timestamp with time zone",
3586
+ "primaryKey": false,
3587
+ "notNull": true,
3588
+ "default": "now()"
3589
+ }
3590
+ },
3591
+ "indexes": {
3592
+ "issues_company_status_idx": {
3593
+ "name": "issues_company_status_idx",
3594
+ "columns": [
3595
+ {
3596
+ "expression": "company_id",
3597
+ "isExpression": false,
3598
+ "asc": true,
3599
+ "nulls": "last"
3600
+ },
3601
+ {
3602
+ "expression": "status",
3603
+ "isExpression": false,
3604
+ "asc": true,
3605
+ "nulls": "last"
3606
+ }
3607
+ ],
3608
+ "isUnique": false,
3609
+ "concurrently": false,
3610
+ "method": "btree",
3611
+ "with": {}
3612
+ },
3613
+ "issues_company_assignee_status_idx": {
3614
+ "name": "issues_company_assignee_status_idx",
3615
+ "columns": [
3616
+ {
3617
+ "expression": "company_id",
3618
+ "isExpression": false,
3619
+ "asc": true,
3620
+ "nulls": "last"
3621
+ },
3622
+ {
3623
+ "expression": "assignee_agent_id",
3624
+ "isExpression": false,
3625
+ "asc": true,
3626
+ "nulls": "last"
3627
+ },
3628
+ {
3629
+ "expression": "status",
3630
+ "isExpression": false,
3631
+ "asc": true,
3632
+ "nulls": "last"
3633
+ }
3634
+ ],
3635
+ "isUnique": false,
3636
+ "concurrently": false,
3637
+ "method": "btree",
3638
+ "with": {}
3639
+ },
3640
+ "issues_company_parent_idx": {
3641
+ "name": "issues_company_parent_idx",
3642
+ "columns": [
3643
+ {
3644
+ "expression": "company_id",
3645
+ "isExpression": false,
3646
+ "asc": true,
3647
+ "nulls": "last"
3648
+ },
3649
+ {
3650
+ "expression": "parent_id",
3651
+ "isExpression": false,
3652
+ "asc": true,
3653
+ "nulls": "last"
3654
+ }
3655
+ ],
3656
+ "isUnique": false,
3657
+ "concurrently": false,
3658
+ "method": "btree",
3659
+ "with": {}
3660
+ },
3661
+ "issues_company_project_idx": {
3662
+ "name": "issues_company_project_idx",
3663
+ "columns": [
3664
+ {
3665
+ "expression": "company_id",
3666
+ "isExpression": false,
3667
+ "asc": true,
3668
+ "nulls": "last"
3669
+ },
3670
+ {
3671
+ "expression": "project_id",
3672
+ "isExpression": false,
3673
+ "asc": true,
3674
+ "nulls": "last"
3675
+ }
3676
+ ],
3677
+ "isUnique": false,
3678
+ "concurrently": false,
3679
+ "method": "btree",
3680
+ "with": {}
3681
+ },
3682
+ "issues_company_identifier_idx": {
3683
+ "name": "issues_company_identifier_idx",
3684
+ "columns": [
3685
+ {
3686
+ "expression": "company_id",
3687
+ "isExpression": false,
3688
+ "asc": true,
3689
+ "nulls": "last"
3690
+ },
3691
+ {
3692
+ "expression": "identifier",
3693
+ "isExpression": false,
3694
+ "asc": true,
3695
+ "nulls": "last"
3696
+ }
3697
+ ],
3698
+ "isUnique": true,
3699
+ "concurrently": false,
3700
+ "method": "btree",
3701
+ "with": {}
3702
+ }
3703
+ },
3704
+ "foreignKeys": {
3705
+ "issues_company_id_companies_id_fk": {
3706
+ "name": "issues_company_id_companies_id_fk",
3707
+ "tableFrom": "issues",
3708
+ "tableTo": "companies",
3709
+ "columnsFrom": [
3710
+ "company_id"
3711
+ ],
3712
+ "columnsTo": [
3713
+ "id"
3714
+ ],
3715
+ "onDelete": "no action",
3716
+ "onUpdate": "no action"
3717
+ },
3718
+ "issues_project_id_projects_id_fk": {
3719
+ "name": "issues_project_id_projects_id_fk",
3720
+ "tableFrom": "issues",
3721
+ "tableTo": "projects",
3722
+ "columnsFrom": [
3723
+ "project_id"
3724
+ ],
3725
+ "columnsTo": [
3726
+ "id"
3727
+ ],
3728
+ "onDelete": "no action",
3729
+ "onUpdate": "no action"
3730
+ },
3731
+ "issues_goal_id_goals_id_fk": {
3732
+ "name": "issues_goal_id_goals_id_fk",
3733
+ "tableFrom": "issues",
3734
+ "tableTo": "goals",
3735
+ "columnsFrom": [
3736
+ "goal_id"
3737
+ ],
3738
+ "columnsTo": [
3739
+ "id"
3740
+ ],
3741
+ "onDelete": "no action",
3742
+ "onUpdate": "no action"
3743
+ },
3744
+ "issues_parent_id_issues_id_fk": {
3745
+ "name": "issues_parent_id_issues_id_fk",
3746
+ "tableFrom": "issues",
3747
+ "tableTo": "issues",
3748
+ "columnsFrom": [
3749
+ "parent_id"
3750
+ ],
3751
+ "columnsTo": [
3752
+ "id"
3753
+ ],
3754
+ "onDelete": "no action",
3755
+ "onUpdate": "no action"
3756
+ },
3757
+ "issues_assignee_agent_id_agents_id_fk": {
3758
+ "name": "issues_assignee_agent_id_agents_id_fk",
3759
+ "tableFrom": "issues",
3760
+ "tableTo": "agents",
3761
+ "columnsFrom": [
3762
+ "assignee_agent_id"
3763
+ ],
3764
+ "columnsTo": [
3765
+ "id"
3766
+ ],
3767
+ "onDelete": "no action",
3768
+ "onUpdate": "no action"
3769
+ },
3770
+ "issues_checkout_run_id_heartbeat_runs_id_fk": {
3771
+ "name": "issues_checkout_run_id_heartbeat_runs_id_fk",
3772
+ "tableFrom": "issues",
3773
+ "tableTo": "heartbeat_runs",
3774
+ "columnsFrom": [
3775
+ "checkout_run_id"
3776
+ ],
3777
+ "columnsTo": [
3778
+ "id"
3779
+ ],
3780
+ "onDelete": "set null",
3781
+ "onUpdate": "no action"
3782
+ },
3783
+ "issues_created_by_agent_id_agents_id_fk": {
3784
+ "name": "issues_created_by_agent_id_agents_id_fk",
3785
+ "tableFrom": "issues",
3786
+ "tableTo": "agents",
3787
+ "columnsFrom": [
3788
+ "created_by_agent_id"
3789
+ ],
3790
+ "columnsTo": [
3791
+ "id"
3792
+ ],
3793
+ "onDelete": "no action",
3794
+ "onUpdate": "no action"
3795
+ }
3796
+ },
3797
+ "compositePrimaryKeys": {},
3798
+ "uniqueConstraints": {},
3799
+ "policies": {},
3800
+ "checkConstraints": {},
3801
+ "isRLSEnabled": false
3802
+ },
3803
+ "public.project_goals": {
3804
+ "name": "project_goals",
3805
+ "schema": "",
3806
+ "columns": {
3807
+ "project_id": {
3808
+ "name": "project_id",
3809
+ "type": "uuid",
3810
+ "primaryKey": false,
3811
+ "notNull": true
3812
+ },
3813
+ "goal_id": {
3814
+ "name": "goal_id",
3815
+ "type": "uuid",
3816
+ "primaryKey": false,
3817
+ "notNull": true
3818
+ },
3819
+ "company_id": {
3820
+ "name": "company_id",
3821
+ "type": "uuid",
3822
+ "primaryKey": false,
3823
+ "notNull": true
3824
+ },
3825
+ "created_at": {
3826
+ "name": "created_at",
3827
+ "type": "timestamp with time zone",
3828
+ "primaryKey": false,
3829
+ "notNull": true,
3830
+ "default": "now()"
3831
+ },
3832
+ "updated_at": {
3833
+ "name": "updated_at",
3834
+ "type": "timestamp with time zone",
3835
+ "primaryKey": false,
3836
+ "notNull": true,
3837
+ "default": "now()"
3838
+ }
3839
+ },
3840
+ "indexes": {
3841
+ "project_goals_project_idx": {
3842
+ "name": "project_goals_project_idx",
3843
+ "columns": [
3844
+ {
3845
+ "expression": "project_id",
3846
+ "isExpression": false,
3847
+ "asc": true,
3848
+ "nulls": "last"
3849
+ }
3850
+ ],
3851
+ "isUnique": false,
3852
+ "concurrently": false,
3853
+ "method": "btree",
3854
+ "with": {}
3855
+ },
3856
+ "project_goals_goal_idx": {
3857
+ "name": "project_goals_goal_idx",
3858
+ "columns": [
3859
+ {
3860
+ "expression": "goal_id",
3861
+ "isExpression": false,
3862
+ "asc": true,
3863
+ "nulls": "last"
3864
+ }
3865
+ ],
3866
+ "isUnique": false,
3867
+ "concurrently": false,
3868
+ "method": "btree",
3869
+ "with": {}
3870
+ },
3871
+ "project_goals_company_idx": {
3872
+ "name": "project_goals_company_idx",
3873
+ "columns": [
3874
+ {
3875
+ "expression": "company_id",
3876
+ "isExpression": false,
3877
+ "asc": true,
3878
+ "nulls": "last"
3879
+ }
3880
+ ],
3881
+ "isUnique": false,
3882
+ "concurrently": false,
3883
+ "method": "btree",
3884
+ "with": {}
3885
+ }
3886
+ },
3887
+ "foreignKeys": {
3888
+ "project_goals_project_id_projects_id_fk": {
3889
+ "name": "project_goals_project_id_projects_id_fk",
3890
+ "tableFrom": "project_goals",
3891
+ "tableTo": "projects",
3892
+ "columnsFrom": [
3893
+ "project_id"
3894
+ ],
3895
+ "columnsTo": [
3896
+ "id"
3897
+ ],
3898
+ "onDelete": "cascade",
3899
+ "onUpdate": "no action"
3900
+ },
3901
+ "project_goals_goal_id_goals_id_fk": {
3902
+ "name": "project_goals_goal_id_goals_id_fk",
3903
+ "tableFrom": "project_goals",
3904
+ "tableTo": "goals",
3905
+ "columnsFrom": [
3906
+ "goal_id"
3907
+ ],
3908
+ "columnsTo": [
3909
+ "id"
3910
+ ],
3911
+ "onDelete": "cascade",
3912
+ "onUpdate": "no action"
3913
+ },
3914
+ "project_goals_company_id_companies_id_fk": {
3915
+ "name": "project_goals_company_id_companies_id_fk",
3916
+ "tableFrom": "project_goals",
3917
+ "tableTo": "companies",
3918
+ "columnsFrom": [
3919
+ "company_id"
3920
+ ],
3921
+ "columnsTo": [
3922
+ "id"
3923
+ ],
3924
+ "onDelete": "no action",
3925
+ "onUpdate": "no action"
3926
+ }
3927
+ },
3928
+ "compositePrimaryKeys": {
3929
+ "project_goals_project_id_goal_id_pk": {
3930
+ "name": "project_goals_project_id_goal_id_pk",
3931
+ "columns": [
3932
+ "project_id",
3933
+ "goal_id"
3934
+ ]
3935
+ }
3936
+ },
3937
+ "uniqueConstraints": {},
3938
+ "policies": {},
3939
+ "checkConstraints": {},
3940
+ "isRLSEnabled": false
3941
+ },
3942
+ "public.projects": {
3943
+ "name": "projects",
3944
+ "schema": "",
3945
+ "columns": {
3946
+ "id": {
3947
+ "name": "id",
3948
+ "type": "uuid",
3949
+ "primaryKey": true,
3950
+ "notNull": true,
3951
+ "default": "gen_random_uuid()"
3952
+ },
3953
+ "company_id": {
3954
+ "name": "company_id",
3955
+ "type": "uuid",
3956
+ "primaryKey": false,
3957
+ "notNull": true
3958
+ },
3959
+ "goal_id": {
3960
+ "name": "goal_id",
3961
+ "type": "uuid",
3962
+ "primaryKey": false,
3963
+ "notNull": false
3964
+ },
3965
+ "name": {
3966
+ "name": "name",
3967
+ "type": "text",
3968
+ "primaryKey": false,
3969
+ "notNull": true
3970
+ },
3971
+ "description": {
3972
+ "name": "description",
3973
+ "type": "text",
3974
+ "primaryKey": false,
3975
+ "notNull": false
3976
+ },
3977
+ "status": {
3978
+ "name": "status",
3979
+ "type": "text",
3980
+ "primaryKey": false,
3981
+ "notNull": true,
3982
+ "default": "'backlog'"
3983
+ },
3984
+ "lead_agent_id": {
3985
+ "name": "lead_agent_id",
3986
+ "type": "uuid",
3987
+ "primaryKey": false,
3988
+ "notNull": false
3989
+ },
3990
+ "target_date": {
3991
+ "name": "target_date",
3992
+ "type": "date",
3993
+ "primaryKey": false,
3994
+ "notNull": false
3995
+ },
3996
+ "created_at": {
3997
+ "name": "created_at",
3998
+ "type": "timestamp with time zone",
3999
+ "primaryKey": false,
4000
+ "notNull": true,
4001
+ "default": "now()"
4002
+ },
4003
+ "updated_at": {
4004
+ "name": "updated_at",
4005
+ "type": "timestamp with time zone",
4006
+ "primaryKey": false,
4007
+ "notNull": true,
4008
+ "default": "now()"
4009
+ }
4010
+ },
4011
+ "indexes": {
4012
+ "projects_company_idx": {
4013
+ "name": "projects_company_idx",
4014
+ "columns": [
4015
+ {
4016
+ "expression": "company_id",
4017
+ "isExpression": false,
4018
+ "asc": true,
4019
+ "nulls": "last"
4020
+ }
4021
+ ],
4022
+ "isUnique": false,
4023
+ "concurrently": false,
4024
+ "method": "btree",
4025
+ "with": {}
4026
+ }
4027
+ },
4028
+ "foreignKeys": {
4029
+ "projects_company_id_companies_id_fk": {
4030
+ "name": "projects_company_id_companies_id_fk",
4031
+ "tableFrom": "projects",
4032
+ "tableTo": "companies",
4033
+ "columnsFrom": [
4034
+ "company_id"
4035
+ ],
4036
+ "columnsTo": [
4037
+ "id"
4038
+ ],
4039
+ "onDelete": "no action",
4040
+ "onUpdate": "no action"
4041
+ },
4042
+ "projects_goal_id_goals_id_fk": {
4043
+ "name": "projects_goal_id_goals_id_fk",
4044
+ "tableFrom": "projects",
4045
+ "tableTo": "goals",
4046
+ "columnsFrom": [
4047
+ "goal_id"
4048
+ ],
4049
+ "columnsTo": [
4050
+ "id"
4051
+ ],
4052
+ "onDelete": "no action",
4053
+ "onUpdate": "no action"
4054
+ },
4055
+ "projects_lead_agent_id_agents_id_fk": {
4056
+ "name": "projects_lead_agent_id_agents_id_fk",
4057
+ "tableFrom": "projects",
4058
+ "tableTo": "agents",
4059
+ "columnsFrom": [
4060
+ "lead_agent_id"
4061
+ ],
4062
+ "columnsTo": [
4063
+ "id"
4064
+ ],
4065
+ "onDelete": "no action",
4066
+ "onUpdate": "no action"
4067
+ }
4068
+ },
4069
+ "compositePrimaryKeys": {},
4070
+ "uniqueConstraints": {},
4071
+ "policies": {},
4072
+ "checkConstraints": {},
4073
+ "isRLSEnabled": false
4074
+ }
4075
+ },
4076
+ "enums": {},
4077
+ "schemas": {},
4078
+ "sequences": {},
4079
+ "roles": {},
4080
+ "policies": {},
4081
+ "views": {},
4082
+ "_meta": {
4083
+ "columns": {},
4084
+ "schemas": {},
4085
+ "tables": {}
4086
+ }
4087
+ }