@paperclipai/db 0.2.2 → 0.2.3

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,3258 @@
1
+ {
2
+ "id": "e92579b9-80ac-4069-a4e4-8060ddb74d15",
3
+ "prevId": "53174520-01ee-491b-9184-293955d48d77",
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.companies": {
1603
+ "name": "companies",
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
+ "name": {
1614
+ "name": "name",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "description": {
1620
+ "name": "description",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": false
1624
+ },
1625
+ "status": {
1626
+ "name": "status",
1627
+ "type": "text",
1628
+ "primaryKey": false,
1629
+ "notNull": true,
1630
+ "default": "'active'"
1631
+ },
1632
+ "issue_prefix": {
1633
+ "name": "issue_prefix",
1634
+ "type": "text",
1635
+ "primaryKey": false,
1636
+ "notNull": true,
1637
+ "default": "'PAP'"
1638
+ },
1639
+ "issue_counter": {
1640
+ "name": "issue_counter",
1641
+ "type": "integer",
1642
+ "primaryKey": false,
1643
+ "notNull": true,
1644
+ "default": 0
1645
+ },
1646
+ "budget_monthly_cents": {
1647
+ "name": "budget_monthly_cents",
1648
+ "type": "integer",
1649
+ "primaryKey": false,
1650
+ "notNull": true,
1651
+ "default": 0
1652
+ },
1653
+ "spent_monthly_cents": {
1654
+ "name": "spent_monthly_cents",
1655
+ "type": "integer",
1656
+ "primaryKey": false,
1657
+ "notNull": true,
1658
+ "default": 0
1659
+ },
1660
+ "require_board_approval_for_new_agents": {
1661
+ "name": "require_board_approval_for_new_agents",
1662
+ "type": "boolean",
1663
+ "primaryKey": false,
1664
+ "notNull": true,
1665
+ "default": true
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
+ "foreignKeys": {},
1684
+ "compositePrimaryKeys": {},
1685
+ "uniqueConstraints": {},
1686
+ "policies": {},
1687
+ "checkConstraints": {},
1688
+ "isRLSEnabled": false
1689
+ },
1690
+ "public.cost_events": {
1691
+ "name": "cost_events",
1692
+ "schema": "",
1693
+ "columns": {
1694
+ "id": {
1695
+ "name": "id",
1696
+ "type": "uuid",
1697
+ "primaryKey": true,
1698
+ "notNull": true,
1699
+ "default": "gen_random_uuid()"
1700
+ },
1701
+ "company_id": {
1702
+ "name": "company_id",
1703
+ "type": "uuid",
1704
+ "primaryKey": false,
1705
+ "notNull": true
1706
+ },
1707
+ "agent_id": {
1708
+ "name": "agent_id",
1709
+ "type": "uuid",
1710
+ "primaryKey": false,
1711
+ "notNull": true
1712
+ },
1713
+ "issue_id": {
1714
+ "name": "issue_id",
1715
+ "type": "uuid",
1716
+ "primaryKey": false,
1717
+ "notNull": false
1718
+ },
1719
+ "project_id": {
1720
+ "name": "project_id",
1721
+ "type": "uuid",
1722
+ "primaryKey": false,
1723
+ "notNull": false
1724
+ },
1725
+ "goal_id": {
1726
+ "name": "goal_id",
1727
+ "type": "uuid",
1728
+ "primaryKey": false,
1729
+ "notNull": false
1730
+ },
1731
+ "billing_code": {
1732
+ "name": "billing_code",
1733
+ "type": "text",
1734
+ "primaryKey": false,
1735
+ "notNull": false
1736
+ },
1737
+ "provider": {
1738
+ "name": "provider",
1739
+ "type": "text",
1740
+ "primaryKey": false,
1741
+ "notNull": true
1742
+ },
1743
+ "model": {
1744
+ "name": "model",
1745
+ "type": "text",
1746
+ "primaryKey": false,
1747
+ "notNull": true
1748
+ },
1749
+ "input_tokens": {
1750
+ "name": "input_tokens",
1751
+ "type": "integer",
1752
+ "primaryKey": false,
1753
+ "notNull": true,
1754
+ "default": 0
1755
+ },
1756
+ "output_tokens": {
1757
+ "name": "output_tokens",
1758
+ "type": "integer",
1759
+ "primaryKey": false,
1760
+ "notNull": true,
1761
+ "default": 0
1762
+ },
1763
+ "cost_cents": {
1764
+ "name": "cost_cents",
1765
+ "type": "integer",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "occurred_at": {
1770
+ "name": "occurred_at",
1771
+ "type": "timestamp with time zone",
1772
+ "primaryKey": false,
1773
+ "notNull": true
1774
+ },
1775
+ "created_at": {
1776
+ "name": "created_at",
1777
+ "type": "timestamp with time zone",
1778
+ "primaryKey": false,
1779
+ "notNull": true,
1780
+ "default": "now()"
1781
+ }
1782
+ },
1783
+ "indexes": {
1784
+ "cost_events_company_occurred_idx": {
1785
+ "name": "cost_events_company_occurred_idx",
1786
+ "columns": [
1787
+ {
1788
+ "expression": "company_id",
1789
+ "isExpression": false,
1790
+ "asc": true,
1791
+ "nulls": "last"
1792
+ },
1793
+ {
1794
+ "expression": "occurred_at",
1795
+ "isExpression": false,
1796
+ "asc": true,
1797
+ "nulls": "last"
1798
+ }
1799
+ ],
1800
+ "isUnique": false,
1801
+ "concurrently": false,
1802
+ "method": "btree",
1803
+ "with": {}
1804
+ },
1805
+ "cost_events_company_agent_occurred_idx": {
1806
+ "name": "cost_events_company_agent_occurred_idx",
1807
+ "columns": [
1808
+ {
1809
+ "expression": "company_id",
1810
+ "isExpression": false,
1811
+ "asc": true,
1812
+ "nulls": "last"
1813
+ },
1814
+ {
1815
+ "expression": "agent_id",
1816
+ "isExpression": false,
1817
+ "asc": true,
1818
+ "nulls": "last"
1819
+ },
1820
+ {
1821
+ "expression": "occurred_at",
1822
+ "isExpression": false,
1823
+ "asc": true,
1824
+ "nulls": "last"
1825
+ }
1826
+ ],
1827
+ "isUnique": false,
1828
+ "concurrently": false,
1829
+ "method": "btree",
1830
+ "with": {}
1831
+ }
1832
+ },
1833
+ "foreignKeys": {
1834
+ "cost_events_company_id_companies_id_fk": {
1835
+ "name": "cost_events_company_id_companies_id_fk",
1836
+ "tableFrom": "cost_events",
1837
+ "tableTo": "companies",
1838
+ "columnsFrom": [
1839
+ "company_id"
1840
+ ],
1841
+ "columnsTo": [
1842
+ "id"
1843
+ ],
1844
+ "onDelete": "no action",
1845
+ "onUpdate": "no action"
1846
+ },
1847
+ "cost_events_agent_id_agents_id_fk": {
1848
+ "name": "cost_events_agent_id_agents_id_fk",
1849
+ "tableFrom": "cost_events",
1850
+ "tableTo": "agents",
1851
+ "columnsFrom": [
1852
+ "agent_id"
1853
+ ],
1854
+ "columnsTo": [
1855
+ "id"
1856
+ ],
1857
+ "onDelete": "no action",
1858
+ "onUpdate": "no action"
1859
+ },
1860
+ "cost_events_issue_id_issues_id_fk": {
1861
+ "name": "cost_events_issue_id_issues_id_fk",
1862
+ "tableFrom": "cost_events",
1863
+ "tableTo": "issues",
1864
+ "columnsFrom": [
1865
+ "issue_id"
1866
+ ],
1867
+ "columnsTo": [
1868
+ "id"
1869
+ ],
1870
+ "onDelete": "no action",
1871
+ "onUpdate": "no action"
1872
+ },
1873
+ "cost_events_project_id_projects_id_fk": {
1874
+ "name": "cost_events_project_id_projects_id_fk",
1875
+ "tableFrom": "cost_events",
1876
+ "tableTo": "projects",
1877
+ "columnsFrom": [
1878
+ "project_id"
1879
+ ],
1880
+ "columnsTo": [
1881
+ "id"
1882
+ ],
1883
+ "onDelete": "no action",
1884
+ "onUpdate": "no action"
1885
+ },
1886
+ "cost_events_goal_id_goals_id_fk": {
1887
+ "name": "cost_events_goal_id_goals_id_fk",
1888
+ "tableFrom": "cost_events",
1889
+ "tableTo": "goals",
1890
+ "columnsFrom": [
1891
+ "goal_id"
1892
+ ],
1893
+ "columnsTo": [
1894
+ "id"
1895
+ ],
1896
+ "onDelete": "no action",
1897
+ "onUpdate": "no action"
1898
+ }
1899
+ },
1900
+ "compositePrimaryKeys": {},
1901
+ "uniqueConstraints": {},
1902
+ "policies": {},
1903
+ "checkConstraints": {},
1904
+ "isRLSEnabled": false
1905
+ },
1906
+ "public.goals": {
1907
+ "name": "goals",
1908
+ "schema": "",
1909
+ "columns": {
1910
+ "id": {
1911
+ "name": "id",
1912
+ "type": "uuid",
1913
+ "primaryKey": true,
1914
+ "notNull": true,
1915
+ "default": "gen_random_uuid()"
1916
+ },
1917
+ "company_id": {
1918
+ "name": "company_id",
1919
+ "type": "uuid",
1920
+ "primaryKey": false,
1921
+ "notNull": true
1922
+ },
1923
+ "title": {
1924
+ "name": "title",
1925
+ "type": "text",
1926
+ "primaryKey": false,
1927
+ "notNull": true
1928
+ },
1929
+ "description": {
1930
+ "name": "description",
1931
+ "type": "text",
1932
+ "primaryKey": false,
1933
+ "notNull": false
1934
+ },
1935
+ "level": {
1936
+ "name": "level",
1937
+ "type": "text",
1938
+ "primaryKey": false,
1939
+ "notNull": true,
1940
+ "default": "'task'"
1941
+ },
1942
+ "status": {
1943
+ "name": "status",
1944
+ "type": "text",
1945
+ "primaryKey": false,
1946
+ "notNull": true,
1947
+ "default": "'planned'"
1948
+ },
1949
+ "parent_id": {
1950
+ "name": "parent_id",
1951
+ "type": "uuid",
1952
+ "primaryKey": false,
1953
+ "notNull": false
1954
+ },
1955
+ "owner_agent_id": {
1956
+ "name": "owner_agent_id",
1957
+ "type": "uuid",
1958
+ "primaryKey": false,
1959
+ "notNull": false
1960
+ },
1961
+ "created_at": {
1962
+ "name": "created_at",
1963
+ "type": "timestamp with time zone",
1964
+ "primaryKey": false,
1965
+ "notNull": true,
1966
+ "default": "now()"
1967
+ },
1968
+ "updated_at": {
1969
+ "name": "updated_at",
1970
+ "type": "timestamp with time zone",
1971
+ "primaryKey": false,
1972
+ "notNull": true,
1973
+ "default": "now()"
1974
+ }
1975
+ },
1976
+ "indexes": {
1977
+ "goals_company_idx": {
1978
+ "name": "goals_company_idx",
1979
+ "columns": [
1980
+ {
1981
+ "expression": "company_id",
1982
+ "isExpression": false,
1983
+ "asc": true,
1984
+ "nulls": "last"
1985
+ }
1986
+ ],
1987
+ "isUnique": false,
1988
+ "concurrently": false,
1989
+ "method": "btree",
1990
+ "with": {}
1991
+ }
1992
+ },
1993
+ "foreignKeys": {
1994
+ "goals_company_id_companies_id_fk": {
1995
+ "name": "goals_company_id_companies_id_fk",
1996
+ "tableFrom": "goals",
1997
+ "tableTo": "companies",
1998
+ "columnsFrom": [
1999
+ "company_id"
2000
+ ],
2001
+ "columnsTo": [
2002
+ "id"
2003
+ ],
2004
+ "onDelete": "no action",
2005
+ "onUpdate": "no action"
2006
+ },
2007
+ "goals_parent_id_goals_id_fk": {
2008
+ "name": "goals_parent_id_goals_id_fk",
2009
+ "tableFrom": "goals",
2010
+ "tableTo": "goals",
2011
+ "columnsFrom": [
2012
+ "parent_id"
2013
+ ],
2014
+ "columnsTo": [
2015
+ "id"
2016
+ ],
2017
+ "onDelete": "no action",
2018
+ "onUpdate": "no action"
2019
+ },
2020
+ "goals_owner_agent_id_agents_id_fk": {
2021
+ "name": "goals_owner_agent_id_agents_id_fk",
2022
+ "tableFrom": "goals",
2023
+ "tableTo": "agents",
2024
+ "columnsFrom": [
2025
+ "owner_agent_id"
2026
+ ],
2027
+ "columnsTo": [
2028
+ "id"
2029
+ ],
2030
+ "onDelete": "no action",
2031
+ "onUpdate": "no action"
2032
+ }
2033
+ },
2034
+ "compositePrimaryKeys": {},
2035
+ "uniqueConstraints": {},
2036
+ "policies": {},
2037
+ "checkConstraints": {},
2038
+ "isRLSEnabled": false
2039
+ },
2040
+ "public.heartbeat_run_events": {
2041
+ "name": "heartbeat_run_events",
2042
+ "schema": "",
2043
+ "columns": {
2044
+ "id": {
2045
+ "name": "id",
2046
+ "type": "bigserial",
2047
+ "primaryKey": true,
2048
+ "notNull": true
2049
+ },
2050
+ "company_id": {
2051
+ "name": "company_id",
2052
+ "type": "uuid",
2053
+ "primaryKey": false,
2054
+ "notNull": true
2055
+ },
2056
+ "run_id": {
2057
+ "name": "run_id",
2058
+ "type": "uuid",
2059
+ "primaryKey": false,
2060
+ "notNull": true
2061
+ },
2062
+ "agent_id": {
2063
+ "name": "agent_id",
2064
+ "type": "uuid",
2065
+ "primaryKey": false,
2066
+ "notNull": true
2067
+ },
2068
+ "seq": {
2069
+ "name": "seq",
2070
+ "type": "integer",
2071
+ "primaryKey": false,
2072
+ "notNull": true
2073
+ },
2074
+ "event_type": {
2075
+ "name": "event_type",
2076
+ "type": "text",
2077
+ "primaryKey": false,
2078
+ "notNull": true
2079
+ },
2080
+ "stream": {
2081
+ "name": "stream",
2082
+ "type": "text",
2083
+ "primaryKey": false,
2084
+ "notNull": false
2085
+ },
2086
+ "level": {
2087
+ "name": "level",
2088
+ "type": "text",
2089
+ "primaryKey": false,
2090
+ "notNull": false
2091
+ },
2092
+ "color": {
2093
+ "name": "color",
2094
+ "type": "text",
2095
+ "primaryKey": false,
2096
+ "notNull": false
2097
+ },
2098
+ "message": {
2099
+ "name": "message",
2100
+ "type": "text",
2101
+ "primaryKey": false,
2102
+ "notNull": false
2103
+ },
2104
+ "payload": {
2105
+ "name": "payload",
2106
+ "type": "jsonb",
2107
+ "primaryKey": false,
2108
+ "notNull": false
2109
+ },
2110
+ "created_at": {
2111
+ "name": "created_at",
2112
+ "type": "timestamp with time zone",
2113
+ "primaryKey": false,
2114
+ "notNull": true,
2115
+ "default": "now()"
2116
+ }
2117
+ },
2118
+ "indexes": {
2119
+ "heartbeat_run_events_run_seq_idx": {
2120
+ "name": "heartbeat_run_events_run_seq_idx",
2121
+ "columns": [
2122
+ {
2123
+ "expression": "run_id",
2124
+ "isExpression": false,
2125
+ "asc": true,
2126
+ "nulls": "last"
2127
+ },
2128
+ {
2129
+ "expression": "seq",
2130
+ "isExpression": false,
2131
+ "asc": true,
2132
+ "nulls": "last"
2133
+ }
2134
+ ],
2135
+ "isUnique": false,
2136
+ "concurrently": false,
2137
+ "method": "btree",
2138
+ "with": {}
2139
+ },
2140
+ "heartbeat_run_events_company_run_idx": {
2141
+ "name": "heartbeat_run_events_company_run_idx",
2142
+ "columns": [
2143
+ {
2144
+ "expression": "company_id",
2145
+ "isExpression": false,
2146
+ "asc": true,
2147
+ "nulls": "last"
2148
+ },
2149
+ {
2150
+ "expression": "run_id",
2151
+ "isExpression": false,
2152
+ "asc": true,
2153
+ "nulls": "last"
2154
+ }
2155
+ ],
2156
+ "isUnique": false,
2157
+ "concurrently": false,
2158
+ "method": "btree",
2159
+ "with": {}
2160
+ },
2161
+ "heartbeat_run_events_company_created_idx": {
2162
+ "name": "heartbeat_run_events_company_created_idx",
2163
+ "columns": [
2164
+ {
2165
+ "expression": "company_id",
2166
+ "isExpression": false,
2167
+ "asc": true,
2168
+ "nulls": "last"
2169
+ },
2170
+ {
2171
+ "expression": "created_at",
2172
+ "isExpression": false,
2173
+ "asc": true,
2174
+ "nulls": "last"
2175
+ }
2176
+ ],
2177
+ "isUnique": false,
2178
+ "concurrently": false,
2179
+ "method": "btree",
2180
+ "with": {}
2181
+ }
2182
+ },
2183
+ "foreignKeys": {
2184
+ "heartbeat_run_events_company_id_companies_id_fk": {
2185
+ "name": "heartbeat_run_events_company_id_companies_id_fk",
2186
+ "tableFrom": "heartbeat_run_events",
2187
+ "tableTo": "companies",
2188
+ "columnsFrom": [
2189
+ "company_id"
2190
+ ],
2191
+ "columnsTo": [
2192
+ "id"
2193
+ ],
2194
+ "onDelete": "no action",
2195
+ "onUpdate": "no action"
2196
+ },
2197
+ "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
2198
+ "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
2199
+ "tableFrom": "heartbeat_run_events",
2200
+ "tableTo": "heartbeat_runs",
2201
+ "columnsFrom": [
2202
+ "run_id"
2203
+ ],
2204
+ "columnsTo": [
2205
+ "id"
2206
+ ],
2207
+ "onDelete": "no action",
2208
+ "onUpdate": "no action"
2209
+ },
2210
+ "heartbeat_run_events_agent_id_agents_id_fk": {
2211
+ "name": "heartbeat_run_events_agent_id_agents_id_fk",
2212
+ "tableFrom": "heartbeat_run_events",
2213
+ "tableTo": "agents",
2214
+ "columnsFrom": [
2215
+ "agent_id"
2216
+ ],
2217
+ "columnsTo": [
2218
+ "id"
2219
+ ],
2220
+ "onDelete": "no action",
2221
+ "onUpdate": "no action"
2222
+ }
2223
+ },
2224
+ "compositePrimaryKeys": {},
2225
+ "uniqueConstraints": {},
2226
+ "policies": {},
2227
+ "checkConstraints": {},
2228
+ "isRLSEnabled": false
2229
+ },
2230
+ "public.heartbeat_runs": {
2231
+ "name": "heartbeat_runs",
2232
+ "schema": "",
2233
+ "columns": {
2234
+ "id": {
2235
+ "name": "id",
2236
+ "type": "uuid",
2237
+ "primaryKey": true,
2238
+ "notNull": true,
2239
+ "default": "gen_random_uuid()"
2240
+ },
2241
+ "company_id": {
2242
+ "name": "company_id",
2243
+ "type": "uuid",
2244
+ "primaryKey": false,
2245
+ "notNull": true
2246
+ },
2247
+ "agent_id": {
2248
+ "name": "agent_id",
2249
+ "type": "uuid",
2250
+ "primaryKey": false,
2251
+ "notNull": true
2252
+ },
2253
+ "invocation_source": {
2254
+ "name": "invocation_source",
2255
+ "type": "text",
2256
+ "primaryKey": false,
2257
+ "notNull": true,
2258
+ "default": "'on_demand'"
2259
+ },
2260
+ "trigger_detail": {
2261
+ "name": "trigger_detail",
2262
+ "type": "text",
2263
+ "primaryKey": false,
2264
+ "notNull": false
2265
+ },
2266
+ "status": {
2267
+ "name": "status",
2268
+ "type": "text",
2269
+ "primaryKey": false,
2270
+ "notNull": true,
2271
+ "default": "'queued'"
2272
+ },
2273
+ "started_at": {
2274
+ "name": "started_at",
2275
+ "type": "timestamp with time zone",
2276
+ "primaryKey": false,
2277
+ "notNull": false
2278
+ },
2279
+ "finished_at": {
2280
+ "name": "finished_at",
2281
+ "type": "timestamp with time zone",
2282
+ "primaryKey": false,
2283
+ "notNull": false
2284
+ },
2285
+ "error": {
2286
+ "name": "error",
2287
+ "type": "text",
2288
+ "primaryKey": false,
2289
+ "notNull": false
2290
+ },
2291
+ "wakeup_request_id": {
2292
+ "name": "wakeup_request_id",
2293
+ "type": "uuid",
2294
+ "primaryKey": false,
2295
+ "notNull": false
2296
+ },
2297
+ "exit_code": {
2298
+ "name": "exit_code",
2299
+ "type": "integer",
2300
+ "primaryKey": false,
2301
+ "notNull": false
2302
+ },
2303
+ "signal": {
2304
+ "name": "signal",
2305
+ "type": "text",
2306
+ "primaryKey": false,
2307
+ "notNull": false
2308
+ },
2309
+ "usage_json": {
2310
+ "name": "usage_json",
2311
+ "type": "jsonb",
2312
+ "primaryKey": false,
2313
+ "notNull": false
2314
+ },
2315
+ "result_json": {
2316
+ "name": "result_json",
2317
+ "type": "jsonb",
2318
+ "primaryKey": false,
2319
+ "notNull": false
2320
+ },
2321
+ "session_id_before": {
2322
+ "name": "session_id_before",
2323
+ "type": "text",
2324
+ "primaryKey": false,
2325
+ "notNull": false
2326
+ },
2327
+ "session_id_after": {
2328
+ "name": "session_id_after",
2329
+ "type": "text",
2330
+ "primaryKey": false,
2331
+ "notNull": false
2332
+ },
2333
+ "log_store": {
2334
+ "name": "log_store",
2335
+ "type": "text",
2336
+ "primaryKey": false,
2337
+ "notNull": false
2338
+ },
2339
+ "log_ref": {
2340
+ "name": "log_ref",
2341
+ "type": "text",
2342
+ "primaryKey": false,
2343
+ "notNull": false
2344
+ },
2345
+ "log_bytes": {
2346
+ "name": "log_bytes",
2347
+ "type": "bigint",
2348
+ "primaryKey": false,
2349
+ "notNull": false
2350
+ },
2351
+ "log_sha256": {
2352
+ "name": "log_sha256",
2353
+ "type": "text",
2354
+ "primaryKey": false,
2355
+ "notNull": false
2356
+ },
2357
+ "log_compressed": {
2358
+ "name": "log_compressed",
2359
+ "type": "boolean",
2360
+ "primaryKey": false,
2361
+ "notNull": true,
2362
+ "default": false
2363
+ },
2364
+ "stdout_excerpt": {
2365
+ "name": "stdout_excerpt",
2366
+ "type": "text",
2367
+ "primaryKey": false,
2368
+ "notNull": false
2369
+ },
2370
+ "stderr_excerpt": {
2371
+ "name": "stderr_excerpt",
2372
+ "type": "text",
2373
+ "primaryKey": false,
2374
+ "notNull": false
2375
+ },
2376
+ "error_code": {
2377
+ "name": "error_code",
2378
+ "type": "text",
2379
+ "primaryKey": false,
2380
+ "notNull": false
2381
+ },
2382
+ "external_run_id": {
2383
+ "name": "external_run_id",
2384
+ "type": "text",
2385
+ "primaryKey": false,
2386
+ "notNull": false
2387
+ },
2388
+ "context_snapshot": {
2389
+ "name": "context_snapshot",
2390
+ "type": "jsonb",
2391
+ "primaryKey": false,
2392
+ "notNull": false
2393
+ },
2394
+ "created_at": {
2395
+ "name": "created_at",
2396
+ "type": "timestamp with time zone",
2397
+ "primaryKey": false,
2398
+ "notNull": true,
2399
+ "default": "now()"
2400
+ },
2401
+ "updated_at": {
2402
+ "name": "updated_at",
2403
+ "type": "timestamp with time zone",
2404
+ "primaryKey": false,
2405
+ "notNull": true,
2406
+ "default": "now()"
2407
+ }
2408
+ },
2409
+ "indexes": {
2410
+ "heartbeat_runs_company_agent_started_idx": {
2411
+ "name": "heartbeat_runs_company_agent_started_idx",
2412
+ "columns": [
2413
+ {
2414
+ "expression": "company_id",
2415
+ "isExpression": false,
2416
+ "asc": true,
2417
+ "nulls": "last"
2418
+ },
2419
+ {
2420
+ "expression": "agent_id",
2421
+ "isExpression": false,
2422
+ "asc": true,
2423
+ "nulls": "last"
2424
+ },
2425
+ {
2426
+ "expression": "started_at",
2427
+ "isExpression": false,
2428
+ "asc": true,
2429
+ "nulls": "last"
2430
+ }
2431
+ ],
2432
+ "isUnique": false,
2433
+ "concurrently": false,
2434
+ "method": "btree",
2435
+ "with": {}
2436
+ }
2437
+ },
2438
+ "foreignKeys": {
2439
+ "heartbeat_runs_company_id_companies_id_fk": {
2440
+ "name": "heartbeat_runs_company_id_companies_id_fk",
2441
+ "tableFrom": "heartbeat_runs",
2442
+ "tableTo": "companies",
2443
+ "columnsFrom": [
2444
+ "company_id"
2445
+ ],
2446
+ "columnsTo": [
2447
+ "id"
2448
+ ],
2449
+ "onDelete": "no action",
2450
+ "onUpdate": "no action"
2451
+ },
2452
+ "heartbeat_runs_agent_id_agents_id_fk": {
2453
+ "name": "heartbeat_runs_agent_id_agents_id_fk",
2454
+ "tableFrom": "heartbeat_runs",
2455
+ "tableTo": "agents",
2456
+ "columnsFrom": [
2457
+ "agent_id"
2458
+ ],
2459
+ "columnsTo": [
2460
+ "id"
2461
+ ],
2462
+ "onDelete": "no action",
2463
+ "onUpdate": "no action"
2464
+ },
2465
+ "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
2466
+ "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
2467
+ "tableFrom": "heartbeat_runs",
2468
+ "tableTo": "agent_wakeup_requests",
2469
+ "columnsFrom": [
2470
+ "wakeup_request_id"
2471
+ ],
2472
+ "columnsTo": [
2473
+ "id"
2474
+ ],
2475
+ "onDelete": "no action",
2476
+ "onUpdate": "no action"
2477
+ }
2478
+ },
2479
+ "compositePrimaryKeys": {},
2480
+ "uniqueConstraints": {},
2481
+ "policies": {},
2482
+ "checkConstraints": {},
2483
+ "isRLSEnabled": false
2484
+ },
2485
+ "public.issue_approvals": {
2486
+ "name": "issue_approvals",
2487
+ "schema": "",
2488
+ "columns": {
2489
+ "company_id": {
2490
+ "name": "company_id",
2491
+ "type": "uuid",
2492
+ "primaryKey": false,
2493
+ "notNull": true
2494
+ },
2495
+ "issue_id": {
2496
+ "name": "issue_id",
2497
+ "type": "uuid",
2498
+ "primaryKey": false,
2499
+ "notNull": true
2500
+ },
2501
+ "approval_id": {
2502
+ "name": "approval_id",
2503
+ "type": "uuid",
2504
+ "primaryKey": false,
2505
+ "notNull": true
2506
+ },
2507
+ "linked_by_agent_id": {
2508
+ "name": "linked_by_agent_id",
2509
+ "type": "uuid",
2510
+ "primaryKey": false,
2511
+ "notNull": false
2512
+ },
2513
+ "linked_by_user_id": {
2514
+ "name": "linked_by_user_id",
2515
+ "type": "text",
2516
+ "primaryKey": false,
2517
+ "notNull": false
2518
+ },
2519
+ "created_at": {
2520
+ "name": "created_at",
2521
+ "type": "timestamp with time zone",
2522
+ "primaryKey": false,
2523
+ "notNull": true,
2524
+ "default": "now()"
2525
+ }
2526
+ },
2527
+ "indexes": {
2528
+ "issue_approvals_issue_idx": {
2529
+ "name": "issue_approvals_issue_idx",
2530
+ "columns": [
2531
+ {
2532
+ "expression": "issue_id",
2533
+ "isExpression": false,
2534
+ "asc": true,
2535
+ "nulls": "last"
2536
+ }
2537
+ ],
2538
+ "isUnique": false,
2539
+ "concurrently": false,
2540
+ "method": "btree",
2541
+ "with": {}
2542
+ },
2543
+ "issue_approvals_approval_idx": {
2544
+ "name": "issue_approvals_approval_idx",
2545
+ "columns": [
2546
+ {
2547
+ "expression": "approval_id",
2548
+ "isExpression": false,
2549
+ "asc": true,
2550
+ "nulls": "last"
2551
+ }
2552
+ ],
2553
+ "isUnique": false,
2554
+ "concurrently": false,
2555
+ "method": "btree",
2556
+ "with": {}
2557
+ },
2558
+ "issue_approvals_company_idx": {
2559
+ "name": "issue_approvals_company_idx",
2560
+ "columns": [
2561
+ {
2562
+ "expression": "company_id",
2563
+ "isExpression": false,
2564
+ "asc": true,
2565
+ "nulls": "last"
2566
+ }
2567
+ ],
2568
+ "isUnique": false,
2569
+ "concurrently": false,
2570
+ "method": "btree",
2571
+ "with": {}
2572
+ }
2573
+ },
2574
+ "foreignKeys": {
2575
+ "issue_approvals_company_id_companies_id_fk": {
2576
+ "name": "issue_approvals_company_id_companies_id_fk",
2577
+ "tableFrom": "issue_approvals",
2578
+ "tableTo": "companies",
2579
+ "columnsFrom": [
2580
+ "company_id"
2581
+ ],
2582
+ "columnsTo": [
2583
+ "id"
2584
+ ],
2585
+ "onDelete": "no action",
2586
+ "onUpdate": "no action"
2587
+ },
2588
+ "issue_approvals_issue_id_issues_id_fk": {
2589
+ "name": "issue_approvals_issue_id_issues_id_fk",
2590
+ "tableFrom": "issue_approvals",
2591
+ "tableTo": "issues",
2592
+ "columnsFrom": [
2593
+ "issue_id"
2594
+ ],
2595
+ "columnsTo": [
2596
+ "id"
2597
+ ],
2598
+ "onDelete": "cascade",
2599
+ "onUpdate": "no action"
2600
+ },
2601
+ "issue_approvals_approval_id_approvals_id_fk": {
2602
+ "name": "issue_approvals_approval_id_approvals_id_fk",
2603
+ "tableFrom": "issue_approvals",
2604
+ "tableTo": "approvals",
2605
+ "columnsFrom": [
2606
+ "approval_id"
2607
+ ],
2608
+ "columnsTo": [
2609
+ "id"
2610
+ ],
2611
+ "onDelete": "cascade",
2612
+ "onUpdate": "no action"
2613
+ },
2614
+ "issue_approvals_linked_by_agent_id_agents_id_fk": {
2615
+ "name": "issue_approvals_linked_by_agent_id_agents_id_fk",
2616
+ "tableFrom": "issue_approvals",
2617
+ "tableTo": "agents",
2618
+ "columnsFrom": [
2619
+ "linked_by_agent_id"
2620
+ ],
2621
+ "columnsTo": [
2622
+ "id"
2623
+ ],
2624
+ "onDelete": "set null",
2625
+ "onUpdate": "no action"
2626
+ }
2627
+ },
2628
+ "compositePrimaryKeys": {
2629
+ "issue_approvals_pk": {
2630
+ "name": "issue_approvals_pk",
2631
+ "columns": [
2632
+ "issue_id",
2633
+ "approval_id"
2634
+ ]
2635
+ }
2636
+ },
2637
+ "uniqueConstraints": {},
2638
+ "policies": {},
2639
+ "checkConstraints": {},
2640
+ "isRLSEnabled": false
2641
+ },
2642
+ "public.issue_comments": {
2643
+ "name": "issue_comments",
2644
+ "schema": "",
2645
+ "columns": {
2646
+ "id": {
2647
+ "name": "id",
2648
+ "type": "uuid",
2649
+ "primaryKey": true,
2650
+ "notNull": true,
2651
+ "default": "gen_random_uuid()"
2652
+ },
2653
+ "company_id": {
2654
+ "name": "company_id",
2655
+ "type": "uuid",
2656
+ "primaryKey": false,
2657
+ "notNull": true
2658
+ },
2659
+ "issue_id": {
2660
+ "name": "issue_id",
2661
+ "type": "uuid",
2662
+ "primaryKey": false,
2663
+ "notNull": true
2664
+ },
2665
+ "author_agent_id": {
2666
+ "name": "author_agent_id",
2667
+ "type": "uuid",
2668
+ "primaryKey": false,
2669
+ "notNull": false
2670
+ },
2671
+ "author_user_id": {
2672
+ "name": "author_user_id",
2673
+ "type": "text",
2674
+ "primaryKey": false,
2675
+ "notNull": false
2676
+ },
2677
+ "body": {
2678
+ "name": "body",
2679
+ "type": "text",
2680
+ "primaryKey": false,
2681
+ "notNull": true
2682
+ },
2683
+ "created_at": {
2684
+ "name": "created_at",
2685
+ "type": "timestamp with time zone",
2686
+ "primaryKey": false,
2687
+ "notNull": true,
2688
+ "default": "now()"
2689
+ },
2690
+ "updated_at": {
2691
+ "name": "updated_at",
2692
+ "type": "timestamp with time zone",
2693
+ "primaryKey": false,
2694
+ "notNull": true,
2695
+ "default": "now()"
2696
+ }
2697
+ },
2698
+ "indexes": {
2699
+ "issue_comments_issue_idx": {
2700
+ "name": "issue_comments_issue_idx",
2701
+ "columns": [
2702
+ {
2703
+ "expression": "issue_id",
2704
+ "isExpression": false,
2705
+ "asc": true,
2706
+ "nulls": "last"
2707
+ }
2708
+ ],
2709
+ "isUnique": false,
2710
+ "concurrently": false,
2711
+ "method": "btree",
2712
+ "with": {}
2713
+ },
2714
+ "issue_comments_company_idx": {
2715
+ "name": "issue_comments_company_idx",
2716
+ "columns": [
2717
+ {
2718
+ "expression": "company_id",
2719
+ "isExpression": false,
2720
+ "asc": true,
2721
+ "nulls": "last"
2722
+ }
2723
+ ],
2724
+ "isUnique": false,
2725
+ "concurrently": false,
2726
+ "method": "btree",
2727
+ "with": {}
2728
+ }
2729
+ },
2730
+ "foreignKeys": {
2731
+ "issue_comments_company_id_companies_id_fk": {
2732
+ "name": "issue_comments_company_id_companies_id_fk",
2733
+ "tableFrom": "issue_comments",
2734
+ "tableTo": "companies",
2735
+ "columnsFrom": [
2736
+ "company_id"
2737
+ ],
2738
+ "columnsTo": [
2739
+ "id"
2740
+ ],
2741
+ "onDelete": "no action",
2742
+ "onUpdate": "no action"
2743
+ },
2744
+ "issue_comments_issue_id_issues_id_fk": {
2745
+ "name": "issue_comments_issue_id_issues_id_fk",
2746
+ "tableFrom": "issue_comments",
2747
+ "tableTo": "issues",
2748
+ "columnsFrom": [
2749
+ "issue_id"
2750
+ ],
2751
+ "columnsTo": [
2752
+ "id"
2753
+ ],
2754
+ "onDelete": "no action",
2755
+ "onUpdate": "no action"
2756
+ },
2757
+ "issue_comments_author_agent_id_agents_id_fk": {
2758
+ "name": "issue_comments_author_agent_id_agents_id_fk",
2759
+ "tableFrom": "issue_comments",
2760
+ "tableTo": "agents",
2761
+ "columnsFrom": [
2762
+ "author_agent_id"
2763
+ ],
2764
+ "columnsTo": [
2765
+ "id"
2766
+ ],
2767
+ "onDelete": "no action",
2768
+ "onUpdate": "no action"
2769
+ }
2770
+ },
2771
+ "compositePrimaryKeys": {},
2772
+ "uniqueConstraints": {},
2773
+ "policies": {},
2774
+ "checkConstraints": {},
2775
+ "isRLSEnabled": false
2776
+ },
2777
+ "public.issues": {
2778
+ "name": "issues",
2779
+ "schema": "",
2780
+ "columns": {
2781
+ "id": {
2782
+ "name": "id",
2783
+ "type": "uuid",
2784
+ "primaryKey": true,
2785
+ "notNull": true,
2786
+ "default": "gen_random_uuid()"
2787
+ },
2788
+ "company_id": {
2789
+ "name": "company_id",
2790
+ "type": "uuid",
2791
+ "primaryKey": false,
2792
+ "notNull": true
2793
+ },
2794
+ "project_id": {
2795
+ "name": "project_id",
2796
+ "type": "uuid",
2797
+ "primaryKey": false,
2798
+ "notNull": false
2799
+ },
2800
+ "goal_id": {
2801
+ "name": "goal_id",
2802
+ "type": "uuid",
2803
+ "primaryKey": false,
2804
+ "notNull": false
2805
+ },
2806
+ "parent_id": {
2807
+ "name": "parent_id",
2808
+ "type": "uuid",
2809
+ "primaryKey": false,
2810
+ "notNull": false
2811
+ },
2812
+ "title": {
2813
+ "name": "title",
2814
+ "type": "text",
2815
+ "primaryKey": false,
2816
+ "notNull": true
2817
+ },
2818
+ "description": {
2819
+ "name": "description",
2820
+ "type": "text",
2821
+ "primaryKey": false,
2822
+ "notNull": false
2823
+ },
2824
+ "status": {
2825
+ "name": "status",
2826
+ "type": "text",
2827
+ "primaryKey": false,
2828
+ "notNull": true,
2829
+ "default": "'backlog'"
2830
+ },
2831
+ "priority": {
2832
+ "name": "priority",
2833
+ "type": "text",
2834
+ "primaryKey": false,
2835
+ "notNull": true,
2836
+ "default": "'medium'"
2837
+ },
2838
+ "assignee_agent_id": {
2839
+ "name": "assignee_agent_id",
2840
+ "type": "uuid",
2841
+ "primaryKey": false,
2842
+ "notNull": false
2843
+ },
2844
+ "created_by_agent_id": {
2845
+ "name": "created_by_agent_id",
2846
+ "type": "uuid",
2847
+ "primaryKey": false,
2848
+ "notNull": false
2849
+ },
2850
+ "created_by_user_id": {
2851
+ "name": "created_by_user_id",
2852
+ "type": "text",
2853
+ "primaryKey": false,
2854
+ "notNull": false
2855
+ },
2856
+ "issue_number": {
2857
+ "name": "issue_number",
2858
+ "type": "integer",
2859
+ "primaryKey": false,
2860
+ "notNull": false
2861
+ },
2862
+ "identifier": {
2863
+ "name": "identifier",
2864
+ "type": "text",
2865
+ "primaryKey": false,
2866
+ "notNull": false
2867
+ },
2868
+ "request_depth": {
2869
+ "name": "request_depth",
2870
+ "type": "integer",
2871
+ "primaryKey": false,
2872
+ "notNull": true,
2873
+ "default": 0
2874
+ },
2875
+ "billing_code": {
2876
+ "name": "billing_code",
2877
+ "type": "text",
2878
+ "primaryKey": false,
2879
+ "notNull": false
2880
+ },
2881
+ "started_at": {
2882
+ "name": "started_at",
2883
+ "type": "timestamp with time zone",
2884
+ "primaryKey": false,
2885
+ "notNull": false
2886
+ },
2887
+ "completed_at": {
2888
+ "name": "completed_at",
2889
+ "type": "timestamp with time zone",
2890
+ "primaryKey": false,
2891
+ "notNull": false
2892
+ },
2893
+ "cancelled_at": {
2894
+ "name": "cancelled_at",
2895
+ "type": "timestamp with time zone",
2896
+ "primaryKey": false,
2897
+ "notNull": false
2898
+ },
2899
+ "created_at": {
2900
+ "name": "created_at",
2901
+ "type": "timestamp with time zone",
2902
+ "primaryKey": false,
2903
+ "notNull": true,
2904
+ "default": "now()"
2905
+ },
2906
+ "updated_at": {
2907
+ "name": "updated_at",
2908
+ "type": "timestamp with time zone",
2909
+ "primaryKey": false,
2910
+ "notNull": true,
2911
+ "default": "now()"
2912
+ }
2913
+ },
2914
+ "indexes": {
2915
+ "issues_company_status_idx": {
2916
+ "name": "issues_company_status_idx",
2917
+ "columns": [
2918
+ {
2919
+ "expression": "company_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ },
2924
+ {
2925
+ "expression": "status",
2926
+ "isExpression": false,
2927
+ "asc": true,
2928
+ "nulls": "last"
2929
+ }
2930
+ ],
2931
+ "isUnique": false,
2932
+ "concurrently": false,
2933
+ "method": "btree",
2934
+ "with": {}
2935
+ },
2936
+ "issues_company_assignee_status_idx": {
2937
+ "name": "issues_company_assignee_status_idx",
2938
+ "columns": [
2939
+ {
2940
+ "expression": "company_id",
2941
+ "isExpression": false,
2942
+ "asc": true,
2943
+ "nulls": "last"
2944
+ },
2945
+ {
2946
+ "expression": "assignee_agent_id",
2947
+ "isExpression": false,
2948
+ "asc": true,
2949
+ "nulls": "last"
2950
+ },
2951
+ {
2952
+ "expression": "status",
2953
+ "isExpression": false,
2954
+ "asc": true,
2955
+ "nulls": "last"
2956
+ }
2957
+ ],
2958
+ "isUnique": false,
2959
+ "concurrently": false,
2960
+ "method": "btree",
2961
+ "with": {}
2962
+ },
2963
+ "issues_company_parent_idx": {
2964
+ "name": "issues_company_parent_idx",
2965
+ "columns": [
2966
+ {
2967
+ "expression": "company_id",
2968
+ "isExpression": false,
2969
+ "asc": true,
2970
+ "nulls": "last"
2971
+ },
2972
+ {
2973
+ "expression": "parent_id",
2974
+ "isExpression": false,
2975
+ "asc": true,
2976
+ "nulls": "last"
2977
+ }
2978
+ ],
2979
+ "isUnique": false,
2980
+ "concurrently": false,
2981
+ "method": "btree",
2982
+ "with": {}
2983
+ },
2984
+ "issues_company_project_idx": {
2985
+ "name": "issues_company_project_idx",
2986
+ "columns": [
2987
+ {
2988
+ "expression": "company_id",
2989
+ "isExpression": false,
2990
+ "asc": true,
2991
+ "nulls": "last"
2992
+ },
2993
+ {
2994
+ "expression": "project_id",
2995
+ "isExpression": false,
2996
+ "asc": true,
2997
+ "nulls": "last"
2998
+ }
2999
+ ],
3000
+ "isUnique": false,
3001
+ "concurrently": false,
3002
+ "method": "btree",
3003
+ "with": {}
3004
+ },
3005
+ "issues_company_identifier_idx": {
3006
+ "name": "issues_company_identifier_idx",
3007
+ "columns": [
3008
+ {
3009
+ "expression": "company_id",
3010
+ "isExpression": false,
3011
+ "asc": true,
3012
+ "nulls": "last"
3013
+ },
3014
+ {
3015
+ "expression": "identifier",
3016
+ "isExpression": false,
3017
+ "asc": true,
3018
+ "nulls": "last"
3019
+ }
3020
+ ],
3021
+ "isUnique": true,
3022
+ "concurrently": false,
3023
+ "method": "btree",
3024
+ "with": {}
3025
+ }
3026
+ },
3027
+ "foreignKeys": {
3028
+ "issues_company_id_companies_id_fk": {
3029
+ "name": "issues_company_id_companies_id_fk",
3030
+ "tableFrom": "issues",
3031
+ "tableTo": "companies",
3032
+ "columnsFrom": [
3033
+ "company_id"
3034
+ ],
3035
+ "columnsTo": [
3036
+ "id"
3037
+ ],
3038
+ "onDelete": "no action",
3039
+ "onUpdate": "no action"
3040
+ },
3041
+ "issues_project_id_projects_id_fk": {
3042
+ "name": "issues_project_id_projects_id_fk",
3043
+ "tableFrom": "issues",
3044
+ "tableTo": "projects",
3045
+ "columnsFrom": [
3046
+ "project_id"
3047
+ ],
3048
+ "columnsTo": [
3049
+ "id"
3050
+ ],
3051
+ "onDelete": "no action",
3052
+ "onUpdate": "no action"
3053
+ },
3054
+ "issues_goal_id_goals_id_fk": {
3055
+ "name": "issues_goal_id_goals_id_fk",
3056
+ "tableFrom": "issues",
3057
+ "tableTo": "goals",
3058
+ "columnsFrom": [
3059
+ "goal_id"
3060
+ ],
3061
+ "columnsTo": [
3062
+ "id"
3063
+ ],
3064
+ "onDelete": "no action",
3065
+ "onUpdate": "no action"
3066
+ },
3067
+ "issues_parent_id_issues_id_fk": {
3068
+ "name": "issues_parent_id_issues_id_fk",
3069
+ "tableFrom": "issues",
3070
+ "tableTo": "issues",
3071
+ "columnsFrom": [
3072
+ "parent_id"
3073
+ ],
3074
+ "columnsTo": [
3075
+ "id"
3076
+ ],
3077
+ "onDelete": "no action",
3078
+ "onUpdate": "no action"
3079
+ },
3080
+ "issues_assignee_agent_id_agents_id_fk": {
3081
+ "name": "issues_assignee_agent_id_agents_id_fk",
3082
+ "tableFrom": "issues",
3083
+ "tableTo": "agents",
3084
+ "columnsFrom": [
3085
+ "assignee_agent_id"
3086
+ ],
3087
+ "columnsTo": [
3088
+ "id"
3089
+ ],
3090
+ "onDelete": "no action",
3091
+ "onUpdate": "no action"
3092
+ },
3093
+ "issues_created_by_agent_id_agents_id_fk": {
3094
+ "name": "issues_created_by_agent_id_agents_id_fk",
3095
+ "tableFrom": "issues",
3096
+ "tableTo": "agents",
3097
+ "columnsFrom": [
3098
+ "created_by_agent_id"
3099
+ ],
3100
+ "columnsTo": [
3101
+ "id"
3102
+ ],
3103
+ "onDelete": "no action",
3104
+ "onUpdate": "no action"
3105
+ }
3106
+ },
3107
+ "compositePrimaryKeys": {},
3108
+ "uniqueConstraints": {},
3109
+ "policies": {},
3110
+ "checkConstraints": {},
3111
+ "isRLSEnabled": false
3112
+ },
3113
+ "public.projects": {
3114
+ "name": "projects",
3115
+ "schema": "",
3116
+ "columns": {
3117
+ "id": {
3118
+ "name": "id",
3119
+ "type": "uuid",
3120
+ "primaryKey": true,
3121
+ "notNull": true,
3122
+ "default": "gen_random_uuid()"
3123
+ },
3124
+ "company_id": {
3125
+ "name": "company_id",
3126
+ "type": "uuid",
3127
+ "primaryKey": false,
3128
+ "notNull": true
3129
+ },
3130
+ "goal_id": {
3131
+ "name": "goal_id",
3132
+ "type": "uuid",
3133
+ "primaryKey": false,
3134
+ "notNull": false
3135
+ },
3136
+ "name": {
3137
+ "name": "name",
3138
+ "type": "text",
3139
+ "primaryKey": false,
3140
+ "notNull": true
3141
+ },
3142
+ "description": {
3143
+ "name": "description",
3144
+ "type": "text",
3145
+ "primaryKey": false,
3146
+ "notNull": false
3147
+ },
3148
+ "status": {
3149
+ "name": "status",
3150
+ "type": "text",
3151
+ "primaryKey": false,
3152
+ "notNull": true,
3153
+ "default": "'backlog'"
3154
+ },
3155
+ "lead_agent_id": {
3156
+ "name": "lead_agent_id",
3157
+ "type": "uuid",
3158
+ "primaryKey": false,
3159
+ "notNull": false
3160
+ },
3161
+ "target_date": {
3162
+ "name": "target_date",
3163
+ "type": "date",
3164
+ "primaryKey": false,
3165
+ "notNull": false
3166
+ },
3167
+ "created_at": {
3168
+ "name": "created_at",
3169
+ "type": "timestamp with time zone",
3170
+ "primaryKey": false,
3171
+ "notNull": true,
3172
+ "default": "now()"
3173
+ },
3174
+ "updated_at": {
3175
+ "name": "updated_at",
3176
+ "type": "timestamp with time zone",
3177
+ "primaryKey": false,
3178
+ "notNull": true,
3179
+ "default": "now()"
3180
+ }
3181
+ },
3182
+ "indexes": {
3183
+ "projects_company_idx": {
3184
+ "name": "projects_company_idx",
3185
+ "columns": [
3186
+ {
3187
+ "expression": "company_id",
3188
+ "isExpression": false,
3189
+ "asc": true,
3190
+ "nulls": "last"
3191
+ }
3192
+ ],
3193
+ "isUnique": false,
3194
+ "concurrently": false,
3195
+ "method": "btree",
3196
+ "with": {}
3197
+ }
3198
+ },
3199
+ "foreignKeys": {
3200
+ "projects_company_id_companies_id_fk": {
3201
+ "name": "projects_company_id_companies_id_fk",
3202
+ "tableFrom": "projects",
3203
+ "tableTo": "companies",
3204
+ "columnsFrom": [
3205
+ "company_id"
3206
+ ],
3207
+ "columnsTo": [
3208
+ "id"
3209
+ ],
3210
+ "onDelete": "no action",
3211
+ "onUpdate": "no action"
3212
+ },
3213
+ "projects_goal_id_goals_id_fk": {
3214
+ "name": "projects_goal_id_goals_id_fk",
3215
+ "tableFrom": "projects",
3216
+ "tableTo": "goals",
3217
+ "columnsFrom": [
3218
+ "goal_id"
3219
+ ],
3220
+ "columnsTo": [
3221
+ "id"
3222
+ ],
3223
+ "onDelete": "no action",
3224
+ "onUpdate": "no action"
3225
+ },
3226
+ "projects_lead_agent_id_agents_id_fk": {
3227
+ "name": "projects_lead_agent_id_agents_id_fk",
3228
+ "tableFrom": "projects",
3229
+ "tableTo": "agents",
3230
+ "columnsFrom": [
3231
+ "lead_agent_id"
3232
+ ],
3233
+ "columnsTo": [
3234
+ "id"
3235
+ ],
3236
+ "onDelete": "no action",
3237
+ "onUpdate": "no action"
3238
+ }
3239
+ },
3240
+ "compositePrimaryKeys": {},
3241
+ "uniqueConstraints": {},
3242
+ "policies": {},
3243
+ "checkConstraints": {},
3244
+ "isRLSEnabled": false
3245
+ }
3246
+ },
3247
+ "enums": {},
3248
+ "schemas": {},
3249
+ "sequences": {},
3250
+ "roles": {},
3251
+ "policies": {},
3252
+ "views": {},
3253
+ "_meta": {
3254
+ "columns": {},
3255
+ "schemas": {},
3256
+ "tables": {}
3257
+ }
3258
+ }