@fidelios/db 0.0.2 → 0.0.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 (87) hide show
  1. package/package.json +1 -1
  2. package/dist/migrations/migrations/0000_mature_masked_marvel.sql +0 -208
  3. package/dist/migrations/migrations/0001_fast_northstar.sql +0 -87
  4. package/dist/migrations/migrations/0002_big_zaladane.sql +0 -1
  5. package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +0 -5
  6. package/dist/migrations/migrations/0004_issue_identifiers.sql +0 -28
  7. package/dist/migrations/migrations/0005_chief_luke_cage.sql +0 -19
  8. package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +0 -36
  9. package/dist/migrations/migrations/0007_new_quentin_quire.sql +0 -20
  10. package/dist/migrations/migrations/0008_amused_zzzax.sql +0 -1
  11. package/dist/migrations/migrations/0009_fast_jackal.sql +0 -36
  12. package/dist/migrations/migrations/0010_stale_justin_hammer.sql +0 -37
  13. package/dist/migrations/migrations/0011_windy_corsair.sql +0 -18
  14. package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +0 -2
  15. package/dist/migrations/migrations/0013_dashing_wasp.sql +0 -4
  16. package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +0 -135
  17. package/dist/migrations/migrations/0015_project_color_archived.sql +0 -2
  18. package/dist/migrations/migrations/0016_agent_icon.sql +0 -1
  19. package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +0 -51
  20. package/dist/migrations/migrations/0018_flat_sleepwalker.sql +0 -26
  21. package/dist/migrations/migrations/0019_public_victor_mancha.sql +0 -18
  22. package/dist/migrations/migrations/0020_white_anita_blake.sql +0 -1
  23. package/dist/migrations/migrations/0021_chief_vindicator.sql +0 -1
  24. package/dist/migrations/migrations/0022_company_brand_color.sql +0 -1
  25. package/dist/migrations/migrations/0023_fair_lethal_legion.sql +0 -3
  26. package/dist/migrations/migrations/0024_far_beast.sql +0 -2
  27. package/dist/migrations/migrations/0025_nasty_salo.sql +0 -15
  28. package/dist/migrations/migrations/0026_lying_pete_wisdom.sql +0 -39
  29. package/dist/migrations/migrations/0027_tranquil_tenebrous.sql +0 -2
  30. package/dist/migrations/migrations/0028_harsh_goliath.sql +0 -54
  31. package/dist/migrations/migrations/0029_plugin_tables.sql +0 -177
  32. package/dist/migrations/migrations/0030_rich_magneto.sql +0 -12
  33. package/dist/migrations/migrations/0031_zippy_magma.sql +0 -51
  34. package/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +0 -102
  35. package/dist/migrations/migrations/0033_shiny_black_tarantula.sql +0 -2
  36. package/dist/migrations/migrations/0034_fat_dormammu.sql +0 -2
  37. package/dist/migrations/migrations/0035_marvelous_satana.sql +0 -91
  38. package/dist/migrations/migrations/0036_cheerful_nitro.sql +0 -9
  39. package/dist/migrations/migrations/0037_friendly_eddie_brock.sql +0 -29
  40. package/dist/migrations/migrations/0038_careless_iron_monger.sql +0 -5
  41. package/dist/migrations/migrations/0039_fat_magneto.sql +0 -161
  42. package/dist/migrations/migrations/0040_eager_shotgun.sql +0 -5
  43. package/dist/migrations/migrations/0041_curly_maria_hill.sql +0 -1
  44. package/dist/migrations/migrations/0042_spotty_the_renegades.sql +0 -26
  45. package/dist/migrations/migrations/0043_reflective_captain_universe.sql +0 -6
  46. package/dist/migrations/migrations/0044_illegal_toad.sql +0 -56
  47. package/dist/migrations/migrations/0045_workable_shockwave.sql +0 -17
  48. package/dist/migrations/migrations/meta/0000_snapshot.json +0 -1743
  49. package/dist/migrations/migrations/meta/0001_snapshot.json +0 -2441
  50. package/dist/migrations/migrations/meta/0002_snapshot.json +0 -2454
  51. package/dist/migrations/migrations/meta/0003_snapshot.json +0 -2502
  52. package/dist/migrations/migrations/meta/0005_snapshot.json +0 -2719
  53. package/dist/migrations/migrations/meta/0006_snapshot.json +0 -3048
  54. package/dist/migrations/migrations/meta/0007_snapshot.json +0 -3258
  55. package/dist/migrations/migrations/meta/0008_snapshot.json +0 -3264
  56. package/dist/migrations/migrations/meta/0009_snapshot.json +0 -3587
  57. package/dist/migrations/migrations/meta/0010_snapshot.json +0 -3929
  58. package/dist/migrations/migrations/meta/0011_snapshot.json +0 -4068
  59. package/dist/migrations/migrations/meta/0012_snapshot.json +0 -4087
  60. package/dist/migrations/migrations/meta/0013_snapshot.json +0 -4118
  61. package/dist/migrations/migrations/meta/0014_snapshot.json +0 -5187
  62. package/dist/migrations/migrations/meta/0017_snapshot.json +0 -5215
  63. package/dist/migrations/migrations/meta/0018_snapshot.json +0 -5450
  64. package/dist/migrations/migrations/meta/0019_snapshot.json +0 -5603
  65. package/dist/migrations/migrations/meta/0020_snapshot.json +0 -5603
  66. package/dist/migrations/migrations/meta/0021_snapshot.json +0 -5609
  67. package/dist/migrations/migrations/meta/0023_snapshot.json +0 -5633
  68. package/dist/migrations/migrations/meta/0024_snapshot.json +0 -5693
  69. package/dist/migrations/migrations/meta/0025_snapshot.json +0 -5849
  70. package/dist/migrations/migrations/meta/0027_snapshot.json +0 -6205
  71. package/dist/migrations/migrations/meta/0028_snapshot.json +0 -6710
  72. package/dist/migrations/migrations/meta/0029_snapshot.json +0 -7899
  73. package/dist/migrations/migrations/meta/0030_snapshot.json +0 -8003
  74. package/dist/migrations/migrations/meta/0031_snapshot.json +0 -7242
  75. package/dist/migrations/migrations/meta/0032_snapshot.json +0 -7733
  76. package/dist/migrations/migrations/meta/0033_snapshot.json +0 -9038
  77. package/dist/migrations/migrations/meta/0034_snapshot.json +0 -9039
  78. package/dist/migrations/migrations/meta/0035_snapshot.json +0 -9959
  79. package/dist/migrations/migrations/meta/0036_snapshot.json +0 -10023
  80. package/dist/migrations/migrations/meta/0037_snapshot.json +0 -10263
  81. package/dist/migrations/migrations/meta/0038_snapshot.json +0 -11350
  82. package/dist/migrations/migrations/meta/0039_snapshot.json +0 -10308
  83. package/dist/migrations/migrations/meta/0040_snapshot.json +0 -10481
  84. package/dist/migrations/migrations/meta/0041_snapshot.json +0 -11393
  85. package/dist/migrations/migrations/meta/0044_snapshot.json +0 -11701
  86. package/dist/migrations/migrations/meta/0045_snapshot.json +0 -11857
  87. package/dist/migrations/migrations/meta/_journal.json +0 -328
@@ -1,3048 +0,0 @@
1
- {
2
- "id": "53174520-01ee-491b-9184-293955d48d77",
3
- "prevId": "031f44d0-b532-4484-9355-0e3048db15f3",
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_wakeup_requests": {
661
- "name": "agent_wakeup_requests",
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
- "source": {
684
- "name": "source",
685
- "type": "text",
686
- "primaryKey": false,
687
- "notNull": true
688
- },
689
- "trigger_detail": {
690
- "name": "trigger_detail",
691
- "type": "text",
692
- "primaryKey": false,
693
- "notNull": false
694
- },
695
- "reason": {
696
- "name": "reason",
697
- "type": "text",
698
- "primaryKey": false,
699
- "notNull": false
700
- },
701
- "payload": {
702
- "name": "payload",
703
- "type": "jsonb",
704
- "primaryKey": false,
705
- "notNull": false
706
- },
707
- "status": {
708
- "name": "status",
709
- "type": "text",
710
- "primaryKey": false,
711
- "notNull": true,
712
- "default": "'queued'"
713
- },
714
- "coalesced_count": {
715
- "name": "coalesced_count",
716
- "type": "integer",
717
- "primaryKey": false,
718
- "notNull": true,
719
- "default": 0
720
- },
721
- "requested_by_actor_type": {
722
- "name": "requested_by_actor_type",
723
- "type": "text",
724
- "primaryKey": false,
725
- "notNull": false
726
- },
727
- "requested_by_actor_id": {
728
- "name": "requested_by_actor_id",
729
- "type": "text",
730
- "primaryKey": false,
731
- "notNull": false
732
- },
733
- "idempotency_key": {
734
- "name": "idempotency_key",
735
- "type": "text",
736
- "primaryKey": false,
737
- "notNull": false
738
- },
739
- "run_id": {
740
- "name": "run_id",
741
- "type": "uuid",
742
- "primaryKey": false,
743
- "notNull": false
744
- },
745
- "requested_at": {
746
- "name": "requested_at",
747
- "type": "timestamp with time zone",
748
- "primaryKey": false,
749
- "notNull": true,
750
- "default": "now()"
751
- },
752
- "claimed_at": {
753
- "name": "claimed_at",
754
- "type": "timestamp with time zone",
755
- "primaryKey": false,
756
- "notNull": false
757
- },
758
- "finished_at": {
759
- "name": "finished_at",
760
- "type": "timestamp with time zone",
761
- "primaryKey": false,
762
- "notNull": false
763
- },
764
- "error": {
765
- "name": "error",
766
- "type": "text",
767
- "primaryKey": false,
768
- "notNull": false
769
- },
770
- "created_at": {
771
- "name": "created_at",
772
- "type": "timestamp with time zone",
773
- "primaryKey": false,
774
- "notNull": true,
775
- "default": "now()"
776
- },
777
- "updated_at": {
778
- "name": "updated_at",
779
- "type": "timestamp with time zone",
780
- "primaryKey": false,
781
- "notNull": true,
782
- "default": "now()"
783
- }
784
- },
785
- "indexes": {
786
- "agent_wakeup_requests_company_agent_status_idx": {
787
- "name": "agent_wakeup_requests_company_agent_status_idx",
788
- "columns": [
789
- {
790
- "expression": "company_id",
791
- "isExpression": false,
792
- "asc": true,
793
- "nulls": "last"
794
- },
795
- {
796
- "expression": "agent_id",
797
- "isExpression": false,
798
- "asc": true,
799
- "nulls": "last"
800
- },
801
- {
802
- "expression": "status",
803
- "isExpression": false,
804
- "asc": true,
805
- "nulls": "last"
806
- }
807
- ],
808
- "isUnique": false,
809
- "concurrently": false,
810
- "method": "btree",
811
- "with": {}
812
- },
813
- "agent_wakeup_requests_company_requested_idx": {
814
- "name": "agent_wakeup_requests_company_requested_idx",
815
- "columns": [
816
- {
817
- "expression": "company_id",
818
- "isExpression": false,
819
- "asc": true,
820
- "nulls": "last"
821
- },
822
- {
823
- "expression": "requested_at",
824
- "isExpression": false,
825
- "asc": true,
826
- "nulls": "last"
827
- }
828
- ],
829
- "isUnique": false,
830
- "concurrently": false,
831
- "method": "btree",
832
- "with": {}
833
- },
834
- "agent_wakeup_requests_agent_requested_idx": {
835
- "name": "agent_wakeup_requests_agent_requested_idx",
836
- "columns": [
837
- {
838
- "expression": "agent_id",
839
- "isExpression": false,
840
- "asc": true,
841
- "nulls": "last"
842
- },
843
- {
844
- "expression": "requested_at",
845
- "isExpression": false,
846
- "asc": true,
847
- "nulls": "last"
848
- }
849
- ],
850
- "isUnique": false,
851
- "concurrently": false,
852
- "method": "btree",
853
- "with": {}
854
- }
855
- },
856
- "foreignKeys": {
857
- "agent_wakeup_requests_company_id_companies_id_fk": {
858
- "name": "agent_wakeup_requests_company_id_companies_id_fk",
859
- "tableFrom": "agent_wakeup_requests",
860
- "tableTo": "companies",
861
- "columnsFrom": [
862
- "company_id"
863
- ],
864
- "columnsTo": [
865
- "id"
866
- ],
867
- "onDelete": "no action",
868
- "onUpdate": "no action"
869
- },
870
- "agent_wakeup_requests_agent_id_agents_id_fk": {
871
- "name": "agent_wakeup_requests_agent_id_agents_id_fk",
872
- "tableFrom": "agent_wakeup_requests",
873
- "tableTo": "agents",
874
- "columnsFrom": [
875
- "agent_id"
876
- ],
877
- "columnsTo": [
878
- "id"
879
- ],
880
- "onDelete": "no action",
881
- "onUpdate": "no action"
882
- }
883
- },
884
- "compositePrimaryKeys": {},
885
- "uniqueConstraints": {},
886
- "policies": {},
887
- "checkConstraints": {},
888
- "isRLSEnabled": false
889
- },
890
- "public.agents": {
891
- "name": "agents",
892
- "schema": "",
893
- "columns": {
894
- "id": {
895
- "name": "id",
896
- "type": "uuid",
897
- "primaryKey": true,
898
- "notNull": true,
899
- "default": "gen_random_uuid()"
900
- },
901
- "company_id": {
902
- "name": "company_id",
903
- "type": "uuid",
904
- "primaryKey": false,
905
- "notNull": true
906
- },
907
- "name": {
908
- "name": "name",
909
- "type": "text",
910
- "primaryKey": false,
911
- "notNull": true
912
- },
913
- "role": {
914
- "name": "role",
915
- "type": "text",
916
- "primaryKey": false,
917
- "notNull": true,
918
- "default": "'general'"
919
- },
920
- "title": {
921
- "name": "title",
922
- "type": "text",
923
- "primaryKey": false,
924
- "notNull": false
925
- },
926
- "status": {
927
- "name": "status",
928
- "type": "text",
929
- "primaryKey": false,
930
- "notNull": true,
931
- "default": "'idle'"
932
- },
933
- "reports_to": {
934
- "name": "reports_to",
935
- "type": "uuid",
936
- "primaryKey": false,
937
- "notNull": false
938
- },
939
- "capabilities": {
940
- "name": "capabilities",
941
- "type": "text",
942
- "primaryKey": false,
943
- "notNull": false
944
- },
945
- "adapter_type": {
946
- "name": "adapter_type",
947
- "type": "text",
948
- "primaryKey": false,
949
- "notNull": true,
950
- "default": "'process'"
951
- },
952
- "adapter_config": {
953
- "name": "adapter_config",
954
- "type": "jsonb",
955
- "primaryKey": false,
956
- "notNull": true,
957
- "default": "'{}'::jsonb"
958
- },
959
- "runtime_config": {
960
- "name": "runtime_config",
961
- "type": "jsonb",
962
- "primaryKey": false,
963
- "notNull": true,
964
- "default": "'{}'::jsonb"
965
- },
966
- "budget_monthly_cents": {
967
- "name": "budget_monthly_cents",
968
- "type": "integer",
969
- "primaryKey": false,
970
- "notNull": true,
971
- "default": 0
972
- },
973
- "spent_monthly_cents": {
974
- "name": "spent_monthly_cents",
975
- "type": "integer",
976
- "primaryKey": false,
977
- "notNull": true,
978
- "default": 0
979
- },
980
- "permissions": {
981
- "name": "permissions",
982
- "type": "jsonb",
983
- "primaryKey": false,
984
- "notNull": true,
985
- "default": "'{}'::jsonb"
986
- },
987
- "last_heartbeat_at": {
988
- "name": "last_heartbeat_at",
989
- "type": "timestamp with time zone",
990
- "primaryKey": false,
991
- "notNull": false
992
- },
993
- "metadata": {
994
- "name": "metadata",
995
- "type": "jsonb",
996
- "primaryKey": false,
997
- "notNull": false
998
- },
999
- "created_at": {
1000
- "name": "created_at",
1001
- "type": "timestamp with time zone",
1002
- "primaryKey": false,
1003
- "notNull": true,
1004
- "default": "now()"
1005
- },
1006
- "updated_at": {
1007
- "name": "updated_at",
1008
- "type": "timestamp with time zone",
1009
- "primaryKey": false,
1010
- "notNull": true,
1011
- "default": "now()"
1012
- }
1013
- },
1014
- "indexes": {
1015
- "agents_company_status_idx": {
1016
- "name": "agents_company_status_idx",
1017
- "columns": [
1018
- {
1019
- "expression": "company_id",
1020
- "isExpression": false,
1021
- "asc": true,
1022
- "nulls": "last"
1023
- },
1024
- {
1025
- "expression": "status",
1026
- "isExpression": false,
1027
- "asc": true,
1028
- "nulls": "last"
1029
- }
1030
- ],
1031
- "isUnique": false,
1032
- "concurrently": false,
1033
- "method": "btree",
1034
- "with": {}
1035
- },
1036
- "agents_company_reports_to_idx": {
1037
- "name": "agents_company_reports_to_idx",
1038
- "columns": [
1039
- {
1040
- "expression": "company_id",
1041
- "isExpression": false,
1042
- "asc": true,
1043
- "nulls": "last"
1044
- },
1045
- {
1046
- "expression": "reports_to",
1047
- "isExpression": false,
1048
- "asc": true,
1049
- "nulls": "last"
1050
- }
1051
- ],
1052
- "isUnique": false,
1053
- "concurrently": false,
1054
- "method": "btree",
1055
- "with": {}
1056
- }
1057
- },
1058
- "foreignKeys": {
1059
- "agents_company_id_companies_id_fk": {
1060
- "name": "agents_company_id_companies_id_fk",
1061
- "tableFrom": "agents",
1062
- "tableTo": "companies",
1063
- "columnsFrom": [
1064
- "company_id"
1065
- ],
1066
- "columnsTo": [
1067
- "id"
1068
- ],
1069
- "onDelete": "no action",
1070
- "onUpdate": "no action"
1071
- },
1072
- "agents_reports_to_agents_id_fk": {
1073
- "name": "agents_reports_to_agents_id_fk",
1074
- "tableFrom": "agents",
1075
- "tableTo": "agents",
1076
- "columnsFrom": [
1077
- "reports_to"
1078
- ],
1079
- "columnsTo": [
1080
- "id"
1081
- ],
1082
- "onDelete": "no action",
1083
- "onUpdate": "no action"
1084
- }
1085
- },
1086
- "compositePrimaryKeys": {},
1087
- "uniqueConstraints": {},
1088
- "policies": {},
1089
- "checkConstraints": {},
1090
- "isRLSEnabled": false
1091
- },
1092
- "public.approval_comments": {
1093
- "name": "approval_comments",
1094
- "schema": "",
1095
- "columns": {
1096
- "id": {
1097
- "name": "id",
1098
- "type": "uuid",
1099
- "primaryKey": true,
1100
- "notNull": true,
1101
- "default": "gen_random_uuid()"
1102
- },
1103
- "company_id": {
1104
- "name": "company_id",
1105
- "type": "uuid",
1106
- "primaryKey": false,
1107
- "notNull": true
1108
- },
1109
- "approval_id": {
1110
- "name": "approval_id",
1111
- "type": "uuid",
1112
- "primaryKey": false,
1113
- "notNull": true
1114
- },
1115
- "author_agent_id": {
1116
- "name": "author_agent_id",
1117
- "type": "uuid",
1118
- "primaryKey": false,
1119
- "notNull": false
1120
- },
1121
- "author_user_id": {
1122
- "name": "author_user_id",
1123
- "type": "text",
1124
- "primaryKey": false,
1125
- "notNull": false
1126
- },
1127
- "body": {
1128
- "name": "body",
1129
- "type": "text",
1130
- "primaryKey": false,
1131
- "notNull": true
1132
- },
1133
- "created_at": {
1134
- "name": "created_at",
1135
- "type": "timestamp with time zone",
1136
- "primaryKey": false,
1137
- "notNull": true,
1138
- "default": "now()"
1139
- },
1140
- "updated_at": {
1141
- "name": "updated_at",
1142
- "type": "timestamp with time zone",
1143
- "primaryKey": false,
1144
- "notNull": true,
1145
- "default": "now()"
1146
- }
1147
- },
1148
- "indexes": {
1149
- "approval_comments_company_idx": {
1150
- "name": "approval_comments_company_idx",
1151
- "columns": [
1152
- {
1153
- "expression": "company_id",
1154
- "isExpression": false,
1155
- "asc": true,
1156
- "nulls": "last"
1157
- }
1158
- ],
1159
- "isUnique": false,
1160
- "concurrently": false,
1161
- "method": "btree",
1162
- "with": {}
1163
- },
1164
- "approval_comments_approval_idx": {
1165
- "name": "approval_comments_approval_idx",
1166
- "columns": [
1167
- {
1168
- "expression": "approval_id",
1169
- "isExpression": false,
1170
- "asc": true,
1171
- "nulls": "last"
1172
- }
1173
- ],
1174
- "isUnique": false,
1175
- "concurrently": false,
1176
- "method": "btree",
1177
- "with": {}
1178
- },
1179
- "approval_comments_approval_created_idx": {
1180
- "name": "approval_comments_approval_created_idx",
1181
- "columns": [
1182
- {
1183
- "expression": "approval_id",
1184
- "isExpression": false,
1185
- "asc": true,
1186
- "nulls": "last"
1187
- },
1188
- {
1189
- "expression": "created_at",
1190
- "isExpression": false,
1191
- "asc": true,
1192
- "nulls": "last"
1193
- }
1194
- ],
1195
- "isUnique": false,
1196
- "concurrently": false,
1197
- "method": "btree",
1198
- "with": {}
1199
- }
1200
- },
1201
- "foreignKeys": {
1202
- "approval_comments_company_id_companies_id_fk": {
1203
- "name": "approval_comments_company_id_companies_id_fk",
1204
- "tableFrom": "approval_comments",
1205
- "tableTo": "companies",
1206
- "columnsFrom": [
1207
- "company_id"
1208
- ],
1209
- "columnsTo": [
1210
- "id"
1211
- ],
1212
- "onDelete": "no action",
1213
- "onUpdate": "no action"
1214
- },
1215
- "approval_comments_approval_id_approvals_id_fk": {
1216
- "name": "approval_comments_approval_id_approvals_id_fk",
1217
- "tableFrom": "approval_comments",
1218
- "tableTo": "approvals",
1219
- "columnsFrom": [
1220
- "approval_id"
1221
- ],
1222
- "columnsTo": [
1223
- "id"
1224
- ],
1225
- "onDelete": "no action",
1226
- "onUpdate": "no action"
1227
- },
1228
- "approval_comments_author_agent_id_agents_id_fk": {
1229
- "name": "approval_comments_author_agent_id_agents_id_fk",
1230
- "tableFrom": "approval_comments",
1231
- "tableTo": "agents",
1232
- "columnsFrom": [
1233
- "author_agent_id"
1234
- ],
1235
- "columnsTo": [
1236
- "id"
1237
- ],
1238
- "onDelete": "no action",
1239
- "onUpdate": "no action"
1240
- }
1241
- },
1242
- "compositePrimaryKeys": {},
1243
- "uniqueConstraints": {},
1244
- "policies": {},
1245
- "checkConstraints": {},
1246
- "isRLSEnabled": false
1247
- },
1248
- "public.approvals": {
1249
- "name": "approvals",
1250
- "schema": "",
1251
- "columns": {
1252
- "id": {
1253
- "name": "id",
1254
- "type": "uuid",
1255
- "primaryKey": true,
1256
- "notNull": true,
1257
- "default": "gen_random_uuid()"
1258
- },
1259
- "company_id": {
1260
- "name": "company_id",
1261
- "type": "uuid",
1262
- "primaryKey": false,
1263
- "notNull": true
1264
- },
1265
- "type": {
1266
- "name": "type",
1267
- "type": "text",
1268
- "primaryKey": false,
1269
- "notNull": true
1270
- },
1271
- "requested_by_agent_id": {
1272
- "name": "requested_by_agent_id",
1273
- "type": "uuid",
1274
- "primaryKey": false,
1275
- "notNull": false
1276
- },
1277
- "requested_by_user_id": {
1278
- "name": "requested_by_user_id",
1279
- "type": "text",
1280
- "primaryKey": false,
1281
- "notNull": false
1282
- },
1283
- "status": {
1284
- "name": "status",
1285
- "type": "text",
1286
- "primaryKey": false,
1287
- "notNull": true,
1288
- "default": "'pending'"
1289
- },
1290
- "payload": {
1291
- "name": "payload",
1292
- "type": "jsonb",
1293
- "primaryKey": false,
1294
- "notNull": true
1295
- },
1296
- "decision_note": {
1297
- "name": "decision_note",
1298
- "type": "text",
1299
- "primaryKey": false,
1300
- "notNull": false
1301
- },
1302
- "decided_by_user_id": {
1303
- "name": "decided_by_user_id",
1304
- "type": "text",
1305
- "primaryKey": false,
1306
- "notNull": false
1307
- },
1308
- "decided_at": {
1309
- "name": "decided_at",
1310
- "type": "timestamp with time zone",
1311
- "primaryKey": false,
1312
- "notNull": false
1313
- },
1314
- "created_at": {
1315
- "name": "created_at",
1316
- "type": "timestamp with time zone",
1317
- "primaryKey": false,
1318
- "notNull": true,
1319
- "default": "now()"
1320
- },
1321
- "updated_at": {
1322
- "name": "updated_at",
1323
- "type": "timestamp with time zone",
1324
- "primaryKey": false,
1325
- "notNull": true,
1326
- "default": "now()"
1327
- }
1328
- },
1329
- "indexes": {
1330
- "approvals_company_status_type_idx": {
1331
- "name": "approvals_company_status_type_idx",
1332
- "columns": [
1333
- {
1334
- "expression": "company_id",
1335
- "isExpression": false,
1336
- "asc": true,
1337
- "nulls": "last"
1338
- },
1339
- {
1340
- "expression": "status",
1341
- "isExpression": false,
1342
- "asc": true,
1343
- "nulls": "last"
1344
- },
1345
- {
1346
- "expression": "type",
1347
- "isExpression": false,
1348
- "asc": true,
1349
- "nulls": "last"
1350
- }
1351
- ],
1352
- "isUnique": false,
1353
- "concurrently": false,
1354
- "method": "btree",
1355
- "with": {}
1356
- }
1357
- },
1358
- "foreignKeys": {
1359
- "approvals_company_id_companies_id_fk": {
1360
- "name": "approvals_company_id_companies_id_fk",
1361
- "tableFrom": "approvals",
1362
- "tableTo": "companies",
1363
- "columnsFrom": [
1364
- "company_id"
1365
- ],
1366
- "columnsTo": [
1367
- "id"
1368
- ],
1369
- "onDelete": "no action",
1370
- "onUpdate": "no action"
1371
- },
1372
- "approvals_requested_by_agent_id_agents_id_fk": {
1373
- "name": "approvals_requested_by_agent_id_agents_id_fk",
1374
- "tableFrom": "approvals",
1375
- "tableTo": "agents",
1376
- "columnsFrom": [
1377
- "requested_by_agent_id"
1378
- ],
1379
- "columnsTo": [
1380
- "id"
1381
- ],
1382
- "onDelete": "no action",
1383
- "onUpdate": "no action"
1384
- }
1385
- },
1386
- "compositePrimaryKeys": {},
1387
- "uniqueConstraints": {},
1388
- "policies": {},
1389
- "checkConstraints": {},
1390
- "isRLSEnabled": false
1391
- },
1392
- "public.companies": {
1393
- "name": "companies",
1394
- "schema": "",
1395
- "columns": {
1396
- "id": {
1397
- "name": "id",
1398
- "type": "uuid",
1399
- "primaryKey": true,
1400
- "notNull": true,
1401
- "default": "gen_random_uuid()"
1402
- },
1403
- "name": {
1404
- "name": "name",
1405
- "type": "text",
1406
- "primaryKey": false,
1407
- "notNull": true
1408
- },
1409
- "description": {
1410
- "name": "description",
1411
- "type": "text",
1412
- "primaryKey": false,
1413
- "notNull": false
1414
- },
1415
- "status": {
1416
- "name": "status",
1417
- "type": "text",
1418
- "primaryKey": false,
1419
- "notNull": true,
1420
- "default": "'active'"
1421
- },
1422
- "issue_prefix": {
1423
- "name": "issue_prefix",
1424
- "type": "text",
1425
- "primaryKey": false,
1426
- "notNull": true,
1427
- "default": "'PAP'"
1428
- },
1429
- "issue_counter": {
1430
- "name": "issue_counter",
1431
- "type": "integer",
1432
- "primaryKey": false,
1433
- "notNull": true,
1434
- "default": 0
1435
- },
1436
- "budget_monthly_cents": {
1437
- "name": "budget_monthly_cents",
1438
- "type": "integer",
1439
- "primaryKey": false,
1440
- "notNull": true,
1441
- "default": 0
1442
- },
1443
- "spent_monthly_cents": {
1444
- "name": "spent_monthly_cents",
1445
- "type": "integer",
1446
- "primaryKey": false,
1447
- "notNull": true,
1448
- "default": 0
1449
- },
1450
- "require_board_approval_for_new_agents": {
1451
- "name": "require_board_approval_for_new_agents",
1452
- "type": "boolean",
1453
- "primaryKey": false,
1454
- "notNull": true,
1455
- "default": true
1456
- },
1457
- "created_at": {
1458
- "name": "created_at",
1459
- "type": "timestamp with time zone",
1460
- "primaryKey": false,
1461
- "notNull": true,
1462
- "default": "now()"
1463
- },
1464
- "updated_at": {
1465
- "name": "updated_at",
1466
- "type": "timestamp with time zone",
1467
- "primaryKey": false,
1468
- "notNull": true,
1469
- "default": "now()"
1470
- }
1471
- },
1472
- "indexes": {},
1473
- "foreignKeys": {},
1474
- "compositePrimaryKeys": {},
1475
- "uniqueConstraints": {},
1476
- "policies": {},
1477
- "checkConstraints": {},
1478
- "isRLSEnabled": false
1479
- },
1480
- "public.cost_events": {
1481
- "name": "cost_events",
1482
- "schema": "",
1483
- "columns": {
1484
- "id": {
1485
- "name": "id",
1486
- "type": "uuid",
1487
- "primaryKey": true,
1488
- "notNull": true,
1489
- "default": "gen_random_uuid()"
1490
- },
1491
- "company_id": {
1492
- "name": "company_id",
1493
- "type": "uuid",
1494
- "primaryKey": false,
1495
- "notNull": true
1496
- },
1497
- "agent_id": {
1498
- "name": "agent_id",
1499
- "type": "uuid",
1500
- "primaryKey": false,
1501
- "notNull": true
1502
- },
1503
- "issue_id": {
1504
- "name": "issue_id",
1505
- "type": "uuid",
1506
- "primaryKey": false,
1507
- "notNull": false
1508
- },
1509
- "project_id": {
1510
- "name": "project_id",
1511
- "type": "uuid",
1512
- "primaryKey": false,
1513
- "notNull": false
1514
- },
1515
- "goal_id": {
1516
- "name": "goal_id",
1517
- "type": "uuid",
1518
- "primaryKey": false,
1519
- "notNull": false
1520
- },
1521
- "billing_code": {
1522
- "name": "billing_code",
1523
- "type": "text",
1524
- "primaryKey": false,
1525
- "notNull": false
1526
- },
1527
- "provider": {
1528
- "name": "provider",
1529
- "type": "text",
1530
- "primaryKey": false,
1531
- "notNull": true
1532
- },
1533
- "model": {
1534
- "name": "model",
1535
- "type": "text",
1536
- "primaryKey": false,
1537
- "notNull": true
1538
- },
1539
- "input_tokens": {
1540
- "name": "input_tokens",
1541
- "type": "integer",
1542
- "primaryKey": false,
1543
- "notNull": true,
1544
- "default": 0
1545
- },
1546
- "output_tokens": {
1547
- "name": "output_tokens",
1548
- "type": "integer",
1549
- "primaryKey": false,
1550
- "notNull": true,
1551
- "default": 0
1552
- },
1553
- "cost_cents": {
1554
- "name": "cost_cents",
1555
- "type": "integer",
1556
- "primaryKey": false,
1557
- "notNull": true
1558
- },
1559
- "occurred_at": {
1560
- "name": "occurred_at",
1561
- "type": "timestamp with time zone",
1562
- "primaryKey": false,
1563
- "notNull": true
1564
- },
1565
- "created_at": {
1566
- "name": "created_at",
1567
- "type": "timestamp with time zone",
1568
- "primaryKey": false,
1569
- "notNull": true,
1570
- "default": "now()"
1571
- }
1572
- },
1573
- "indexes": {
1574
- "cost_events_company_occurred_idx": {
1575
- "name": "cost_events_company_occurred_idx",
1576
- "columns": [
1577
- {
1578
- "expression": "company_id",
1579
- "isExpression": false,
1580
- "asc": true,
1581
- "nulls": "last"
1582
- },
1583
- {
1584
- "expression": "occurred_at",
1585
- "isExpression": false,
1586
- "asc": true,
1587
- "nulls": "last"
1588
- }
1589
- ],
1590
- "isUnique": false,
1591
- "concurrently": false,
1592
- "method": "btree",
1593
- "with": {}
1594
- },
1595
- "cost_events_company_agent_occurred_idx": {
1596
- "name": "cost_events_company_agent_occurred_idx",
1597
- "columns": [
1598
- {
1599
- "expression": "company_id",
1600
- "isExpression": false,
1601
- "asc": true,
1602
- "nulls": "last"
1603
- },
1604
- {
1605
- "expression": "agent_id",
1606
- "isExpression": false,
1607
- "asc": true,
1608
- "nulls": "last"
1609
- },
1610
- {
1611
- "expression": "occurred_at",
1612
- "isExpression": false,
1613
- "asc": true,
1614
- "nulls": "last"
1615
- }
1616
- ],
1617
- "isUnique": false,
1618
- "concurrently": false,
1619
- "method": "btree",
1620
- "with": {}
1621
- }
1622
- },
1623
- "foreignKeys": {
1624
- "cost_events_company_id_companies_id_fk": {
1625
- "name": "cost_events_company_id_companies_id_fk",
1626
- "tableFrom": "cost_events",
1627
- "tableTo": "companies",
1628
- "columnsFrom": [
1629
- "company_id"
1630
- ],
1631
- "columnsTo": [
1632
- "id"
1633
- ],
1634
- "onDelete": "no action",
1635
- "onUpdate": "no action"
1636
- },
1637
- "cost_events_agent_id_agents_id_fk": {
1638
- "name": "cost_events_agent_id_agents_id_fk",
1639
- "tableFrom": "cost_events",
1640
- "tableTo": "agents",
1641
- "columnsFrom": [
1642
- "agent_id"
1643
- ],
1644
- "columnsTo": [
1645
- "id"
1646
- ],
1647
- "onDelete": "no action",
1648
- "onUpdate": "no action"
1649
- },
1650
- "cost_events_issue_id_issues_id_fk": {
1651
- "name": "cost_events_issue_id_issues_id_fk",
1652
- "tableFrom": "cost_events",
1653
- "tableTo": "issues",
1654
- "columnsFrom": [
1655
- "issue_id"
1656
- ],
1657
- "columnsTo": [
1658
- "id"
1659
- ],
1660
- "onDelete": "no action",
1661
- "onUpdate": "no action"
1662
- },
1663
- "cost_events_project_id_projects_id_fk": {
1664
- "name": "cost_events_project_id_projects_id_fk",
1665
- "tableFrom": "cost_events",
1666
- "tableTo": "projects",
1667
- "columnsFrom": [
1668
- "project_id"
1669
- ],
1670
- "columnsTo": [
1671
- "id"
1672
- ],
1673
- "onDelete": "no action",
1674
- "onUpdate": "no action"
1675
- },
1676
- "cost_events_goal_id_goals_id_fk": {
1677
- "name": "cost_events_goal_id_goals_id_fk",
1678
- "tableFrom": "cost_events",
1679
- "tableTo": "goals",
1680
- "columnsFrom": [
1681
- "goal_id"
1682
- ],
1683
- "columnsTo": [
1684
- "id"
1685
- ],
1686
- "onDelete": "no action",
1687
- "onUpdate": "no action"
1688
- }
1689
- },
1690
- "compositePrimaryKeys": {},
1691
- "uniqueConstraints": {},
1692
- "policies": {},
1693
- "checkConstraints": {},
1694
- "isRLSEnabled": false
1695
- },
1696
- "public.goals": {
1697
- "name": "goals",
1698
- "schema": "",
1699
- "columns": {
1700
- "id": {
1701
- "name": "id",
1702
- "type": "uuid",
1703
- "primaryKey": true,
1704
- "notNull": true,
1705
- "default": "gen_random_uuid()"
1706
- },
1707
- "company_id": {
1708
- "name": "company_id",
1709
- "type": "uuid",
1710
- "primaryKey": false,
1711
- "notNull": true
1712
- },
1713
- "title": {
1714
- "name": "title",
1715
- "type": "text",
1716
- "primaryKey": false,
1717
- "notNull": true
1718
- },
1719
- "description": {
1720
- "name": "description",
1721
- "type": "text",
1722
- "primaryKey": false,
1723
- "notNull": false
1724
- },
1725
- "level": {
1726
- "name": "level",
1727
- "type": "text",
1728
- "primaryKey": false,
1729
- "notNull": true,
1730
- "default": "'task'"
1731
- },
1732
- "status": {
1733
- "name": "status",
1734
- "type": "text",
1735
- "primaryKey": false,
1736
- "notNull": true,
1737
- "default": "'planned'"
1738
- },
1739
- "parent_id": {
1740
- "name": "parent_id",
1741
- "type": "uuid",
1742
- "primaryKey": false,
1743
- "notNull": false
1744
- },
1745
- "owner_agent_id": {
1746
- "name": "owner_agent_id",
1747
- "type": "uuid",
1748
- "primaryKey": false,
1749
- "notNull": false
1750
- },
1751
- "created_at": {
1752
- "name": "created_at",
1753
- "type": "timestamp with time zone",
1754
- "primaryKey": false,
1755
- "notNull": true,
1756
- "default": "now()"
1757
- },
1758
- "updated_at": {
1759
- "name": "updated_at",
1760
- "type": "timestamp with time zone",
1761
- "primaryKey": false,
1762
- "notNull": true,
1763
- "default": "now()"
1764
- }
1765
- },
1766
- "indexes": {
1767
- "goals_company_idx": {
1768
- "name": "goals_company_idx",
1769
- "columns": [
1770
- {
1771
- "expression": "company_id",
1772
- "isExpression": false,
1773
- "asc": true,
1774
- "nulls": "last"
1775
- }
1776
- ],
1777
- "isUnique": false,
1778
- "concurrently": false,
1779
- "method": "btree",
1780
- "with": {}
1781
- }
1782
- },
1783
- "foreignKeys": {
1784
- "goals_company_id_companies_id_fk": {
1785
- "name": "goals_company_id_companies_id_fk",
1786
- "tableFrom": "goals",
1787
- "tableTo": "companies",
1788
- "columnsFrom": [
1789
- "company_id"
1790
- ],
1791
- "columnsTo": [
1792
- "id"
1793
- ],
1794
- "onDelete": "no action",
1795
- "onUpdate": "no action"
1796
- },
1797
- "goals_parent_id_goals_id_fk": {
1798
- "name": "goals_parent_id_goals_id_fk",
1799
- "tableFrom": "goals",
1800
- "tableTo": "goals",
1801
- "columnsFrom": [
1802
- "parent_id"
1803
- ],
1804
- "columnsTo": [
1805
- "id"
1806
- ],
1807
- "onDelete": "no action",
1808
- "onUpdate": "no action"
1809
- },
1810
- "goals_owner_agent_id_agents_id_fk": {
1811
- "name": "goals_owner_agent_id_agents_id_fk",
1812
- "tableFrom": "goals",
1813
- "tableTo": "agents",
1814
- "columnsFrom": [
1815
- "owner_agent_id"
1816
- ],
1817
- "columnsTo": [
1818
- "id"
1819
- ],
1820
- "onDelete": "no action",
1821
- "onUpdate": "no action"
1822
- }
1823
- },
1824
- "compositePrimaryKeys": {},
1825
- "uniqueConstraints": {},
1826
- "policies": {},
1827
- "checkConstraints": {},
1828
- "isRLSEnabled": false
1829
- },
1830
- "public.heartbeat_run_events": {
1831
- "name": "heartbeat_run_events",
1832
- "schema": "",
1833
- "columns": {
1834
- "id": {
1835
- "name": "id",
1836
- "type": "bigserial",
1837
- "primaryKey": true,
1838
- "notNull": true
1839
- },
1840
- "company_id": {
1841
- "name": "company_id",
1842
- "type": "uuid",
1843
- "primaryKey": false,
1844
- "notNull": true
1845
- },
1846
- "run_id": {
1847
- "name": "run_id",
1848
- "type": "uuid",
1849
- "primaryKey": false,
1850
- "notNull": true
1851
- },
1852
- "agent_id": {
1853
- "name": "agent_id",
1854
- "type": "uuid",
1855
- "primaryKey": false,
1856
- "notNull": true
1857
- },
1858
- "seq": {
1859
- "name": "seq",
1860
- "type": "integer",
1861
- "primaryKey": false,
1862
- "notNull": true
1863
- },
1864
- "event_type": {
1865
- "name": "event_type",
1866
- "type": "text",
1867
- "primaryKey": false,
1868
- "notNull": true
1869
- },
1870
- "stream": {
1871
- "name": "stream",
1872
- "type": "text",
1873
- "primaryKey": false,
1874
- "notNull": false
1875
- },
1876
- "level": {
1877
- "name": "level",
1878
- "type": "text",
1879
- "primaryKey": false,
1880
- "notNull": false
1881
- },
1882
- "color": {
1883
- "name": "color",
1884
- "type": "text",
1885
- "primaryKey": false,
1886
- "notNull": false
1887
- },
1888
- "message": {
1889
- "name": "message",
1890
- "type": "text",
1891
- "primaryKey": false,
1892
- "notNull": false
1893
- },
1894
- "payload": {
1895
- "name": "payload",
1896
- "type": "jsonb",
1897
- "primaryKey": false,
1898
- "notNull": false
1899
- },
1900
- "created_at": {
1901
- "name": "created_at",
1902
- "type": "timestamp with time zone",
1903
- "primaryKey": false,
1904
- "notNull": true,
1905
- "default": "now()"
1906
- }
1907
- },
1908
- "indexes": {
1909
- "heartbeat_run_events_run_seq_idx": {
1910
- "name": "heartbeat_run_events_run_seq_idx",
1911
- "columns": [
1912
- {
1913
- "expression": "run_id",
1914
- "isExpression": false,
1915
- "asc": true,
1916
- "nulls": "last"
1917
- },
1918
- {
1919
- "expression": "seq",
1920
- "isExpression": false,
1921
- "asc": true,
1922
- "nulls": "last"
1923
- }
1924
- ],
1925
- "isUnique": false,
1926
- "concurrently": false,
1927
- "method": "btree",
1928
- "with": {}
1929
- },
1930
- "heartbeat_run_events_company_run_idx": {
1931
- "name": "heartbeat_run_events_company_run_idx",
1932
- "columns": [
1933
- {
1934
- "expression": "company_id",
1935
- "isExpression": false,
1936
- "asc": true,
1937
- "nulls": "last"
1938
- },
1939
- {
1940
- "expression": "run_id",
1941
- "isExpression": false,
1942
- "asc": true,
1943
- "nulls": "last"
1944
- }
1945
- ],
1946
- "isUnique": false,
1947
- "concurrently": false,
1948
- "method": "btree",
1949
- "with": {}
1950
- },
1951
- "heartbeat_run_events_company_created_idx": {
1952
- "name": "heartbeat_run_events_company_created_idx",
1953
- "columns": [
1954
- {
1955
- "expression": "company_id",
1956
- "isExpression": false,
1957
- "asc": true,
1958
- "nulls": "last"
1959
- },
1960
- {
1961
- "expression": "created_at",
1962
- "isExpression": false,
1963
- "asc": true,
1964
- "nulls": "last"
1965
- }
1966
- ],
1967
- "isUnique": false,
1968
- "concurrently": false,
1969
- "method": "btree",
1970
- "with": {}
1971
- }
1972
- },
1973
- "foreignKeys": {
1974
- "heartbeat_run_events_company_id_companies_id_fk": {
1975
- "name": "heartbeat_run_events_company_id_companies_id_fk",
1976
- "tableFrom": "heartbeat_run_events",
1977
- "tableTo": "companies",
1978
- "columnsFrom": [
1979
- "company_id"
1980
- ],
1981
- "columnsTo": [
1982
- "id"
1983
- ],
1984
- "onDelete": "no action",
1985
- "onUpdate": "no action"
1986
- },
1987
- "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
1988
- "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
1989
- "tableFrom": "heartbeat_run_events",
1990
- "tableTo": "heartbeat_runs",
1991
- "columnsFrom": [
1992
- "run_id"
1993
- ],
1994
- "columnsTo": [
1995
- "id"
1996
- ],
1997
- "onDelete": "no action",
1998
- "onUpdate": "no action"
1999
- },
2000
- "heartbeat_run_events_agent_id_agents_id_fk": {
2001
- "name": "heartbeat_run_events_agent_id_agents_id_fk",
2002
- "tableFrom": "heartbeat_run_events",
2003
- "tableTo": "agents",
2004
- "columnsFrom": [
2005
- "agent_id"
2006
- ],
2007
- "columnsTo": [
2008
- "id"
2009
- ],
2010
- "onDelete": "no action",
2011
- "onUpdate": "no action"
2012
- }
2013
- },
2014
- "compositePrimaryKeys": {},
2015
- "uniqueConstraints": {},
2016
- "policies": {},
2017
- "checkConstraints": {},
2018
- "isRLSEnabled": false
2019
- },
2020
- "public.heartbeat_runs": {
2021
- "name": "heartbeat_runs",
2022
- "schema": "",
2023
- "columns": {
2024
- "id": {
2025
- "name": "id",
2026
- "type": "uuid",
2027
- "primaryKey": true,
2028
- "notNull": true,
2029
- "default": "gen_random_uuid()"
2030
- },
2031
- "company_id": {
2032
- "name": "company_id",
2033
- "type": "uuid",
2034
- "primaryKey": false,
2035
- "notNull": true
2036
- },
2037
- "agent_id": {
2038
- "name": "agent_id",
2039
- "type": "uuid",
2040
- "primaryKey": false,
2041
- "notNull": true
2042
- },
2043
- "invocation_source": {
2044
- "name": "invocation_source",
2045
- "type": "text",
2046
- "primaryKey": false,
2047
- "notNull": true,
2048
- "default": "'on_demand'"
2049
- },
2050
- "trigger_detail": {
2051
- "name": "trigger_detail",
2052
- "type": "text",
2053
- "primaryKey": false,
2054
- "notNull": false
2055
- },
2056
- "status": {
2057
- "name": "status",
2058
- "type": "text",
2059
- "primaryKey": false,
2060
- "notNull": true,
2061
- "default": "'queued'"
2062
- },
2063
- "started_at": {
2064
- "name": "started_at",
2065
- "type": "timestamp with time zone",
2066
- "primaryKey": false,
2067
- "notNull": false
2068
- },
2069
- "finished_at": {
2070
- "name": "finished_at",
2071
- "type": "timestamp with time zone",
2072
- "primaryKey": false,
2073
- "notNull": false
2074
- },
2075
- "error": {
2076
- "name": "error",
2077
- "type": "text",
2078
- "primaryKey": false,
2079
- "notNull": false
2080
- },
2081
- "wakeup_request_id": {
2082
- "name": "wakeup_request_id",
2083
- "type": "uuid",
2084
- "primaryKey": false,
2085
- "notNull": false
2086
- },
2087
- "exit_code": {
2088
- "name": "exit_code",
2089
- "type": "integer",
2090
- "primaryKey": false,
2091
- "notNull": false
2092
- },
2093
- "signal": {
2094
- "name": "signal",
2095
- "type": "text",
2096
- "primaryKey": false,
2097
- "notNull": false
2098
- },
2099
- "usage_json": {
2100
- "name": "usage_json",
2101
- "type": "jsonb",
2102
- "primaryKey": false,
2103
- "notNull": false
2104
- },
2105
- "result_json": {
2106
- "name": "result_json",
2107
- "type": "jsonb",
2108
- "primaryKey": false,
2109
- "notNull": false
2110
- },
2111
- "session_id_before": {
2112
- "name": "session_id_before",
2113
- "type": "text",
2114
- "primaryKey": false,
2115
- "notNull": false
2116
- },
2117
- "session_id_after": {
2118
- "name": "session_id_after",
2119
- "type": "text",
2120
- "primaryKey": false,
2121
- "notNull": false
2122
- },
2123
- "log_store": {
2124
- "name": "log_store",
2125
- "type": "text",
2126
- "primaryKey": false,
2127
- "notNull": false
2128
- },
2129
- "log_ref": {
2130
- "name": "log_ref",
2131
- "type": "text",
2132
- "primaryKey": false,
2133
- "notNull": false
2134
- },
2135
- "log_bytes": {
2136
- "name": "log_bytes",
2137
- "type": "bigint",
2138
- "primaryKey": false,
2139
- "notNull": false
2140
- },
2141
- "log_sha256": {
2142
- "name": "log_sha256",
2143
- "type": "text",
2144
- "primaryKey": false,
2145
- "notNull": false
2146
- },
2147
- "log_compressed": {
2148
- "name": "log_compressed",
2149
- "type": "boolean",
2150
- "primaryKey": false,
2151
- "notNull": true,
2152
- "default": false
2153
- },
2154
- "stdout_excerpt": {
2155
- "name": "stdout_excerpt",
2156
- "type": "text",
2157
- "primaryKey": false,
2158
- "notNull": false
2159
- },
2160
- "stderr_excerpt": {
2161
- "name": "stderr_excerpt",
2162
- "type": "text",
2163
- "primaryKey": false,
2164
- "notNull": false
2165
- },
2166
- "error_code": {
2167
- "name": "error_code",
2168
- "type": "text",
2169
- "primaryKey": false,
2170
- "notNull": false
2171
- },
2172
- "external_run_id": {
2173
- "name": "external_run_id",
2174
- "type": "text",
2175
- "primaryKey": false,
2176
- "notNull": false
2177
- },
2178
- "context_snapshot": {
2179
- "name": "context_snapshot",
2180
- "type": "jsonb",
2181
- "primaryKey": false,
2182
- "notNull": false
2183
- },
2184
- "created_at": {
2185
- "name": "created_at",
2186
- "type": "timestamp with time zone",
2187
- "primaryKey": false,
2188
- "notNull": true,
2189
- "default": "now()"
2190
- },
2191
- "updated_at": {
2192
- "name": "updated_at",
2193
- "type": "timestamp with time zone",
2194
- "primaryKey": false,
2195
- "notNull": true,
2196
- "default": "now()"
2197
- }
2198
- },
2199
- "indexes": {
2200
- "heartbeat_runs_company_agent_started_idx": {
2201
- "name": "heartbeat_runs_company_agent_started_idx",
2202
- "columns": [
2203
- {
2204
- "expression": "company_id",
2205
- "isExpression": false,
2206
- "asc": true,
2207
- "nulls": "last"
2208
- },
2209
- {
2210
- "expression": "agent_id",
2211
- "isExpression": false,
2212
- "asc": true,
2213
- "nulls": "last"
2214
- },
2215
- {
2216
- "expression": "started_at",
2217
- "isExpression": false,
2218
- "asc": true,
2219
- "nulls": "last"
2220
- }
2221
- ],
2222
- "isUnique": false,
2223
- "concurrently": false,
2224
- "method": "btree",
2225
- "with": {}
2226
- }
2227
- },
2228
- "foreignKeys": {
2229
- "heartbeat_runs_company_id_companies_id_fk": {
2230
- "name": "heartbeat_runs_company_id_companies_id_fk",
2231
- "tableFrom": "heartbeat_runs",
2232
- "tableTo": "companies",
2233
- "columnsFrom": [
2234
- "company_id"
2235
- ],
2236
- "columnsTo": [
2237
- "id"
2238
- ],
2239
- "onDelete": "no action",
2240
- "onUpdate": "no action"
2241
- },
2242
- "heartbeat_runs_agent_id_agents_id_fk": {
2243
- "name": "heartbeat_runs_agent_id_agents_id_fk",
2244
- "tableFrom": "heartbeat_runs",
2245
- "tableTo": "agents",
2246
- "columnsFrom": [
2247
- "agent_id"
2248
- ],
2249
- "columnsTo": [
2250
- "id"
2251
- ],
2252
- "onDelete": "no action",
2253
- "onUpdate": "no action"
2254
- },
2255
- "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
2256
- "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
2257
- "tableFrom": "heartbeat_runs",
2258
- "tableTo": "agent_wakeup_requests",
2259
- "columnsFrom": [
2260
- "wakeup_request_id"
2261
- ],
2262
- "columnsTo": [
2263
- "id"
2264
- ],
2265
- "onDelete": "no action",
2266
- "onUpdate": "no action"
2267
- }
2268
- },
2269
- "compositePrimaryKeys": {},
2270
- "uniqueConstraints": {},
2271
- "policies": {},
2272
- "checkConstraints": {},
2273
- "isRLSEnabled": false
2274
- },
2275
- "public.issue_approvals": {
2276
- "name": "issue_approvals",
2277
- "schema": "",
2278
- "columns": {
2279
- "company_id": {
2280
- "name": "company_id",
2281
- "type": "uuid",
2282
- "primaryKey": false,
2283
- "notNull": true
2284
- },
2285
- "issue_id": {
2286
- "name": "issue_id",
2287
- "type": "uuid",
2288
- "primaryKey": false,
2289
- "notNull": true
2290
- },
2291
- "approval_id": {
2292
- "name": "approval_id",
2293
- "type": "uuid",
2294
- "primaryKey": false,
2295
- "notNull": true
2296
- },
2297
- "linked_by_agent_id": {
2298
- "name": "linked_by_agent_id",
2299
- "type": "uuid",
2300
- "primaryKey": false,
2301
- "notNull": false
2302
- },
2303
- "linked_by_user_id": {
2304
- "name": "linked_by_user_id",
2305
- "type": "text",
2306
- "primaryKey": false,
2307
- "notNull": false
2308
- },
2309
- "created_at": {
2310
- "name": "created_at",
2311
- "type": "timestamp with time zone",
2312
- "primaryKey": false,
2313
- "notNull": true,
2314
- "default": "now()"
2315
- }
2316
- },
2317
- "indexes": {
2318
- "issue_approvals_issue_idx": {
2319
- "name": "issue_approvals_issue_idx",
2320
- "columns": [
2321
- {
2322
- "expression": "issue_id",
2323
- "isExpression": false,
2324
- "asc": true,
2325
- "nulls": "last"
2326
- }
2327
- ],
2328
- "isUnique": false,
2329
- "concurrently": false,
2330
- "method": "btree",
2331
- "with": {}
2332
- },
2333
- "issue_approvals_approval_idx": {
2334
- "name": "issue_approvals_approval_idx",
2335
- "columns": [
2336
- {
2337
- "expression": "approval_id",
2338
- "isExpression": false,
2339
- "asc": true,
2340
- "nulls": "last"
2341
- }
2342
- ],
2343
- "isUnique": false,
2344
- "concurrently": false,
2345
- "method": "btree",
2346
- "with": {}
2347
- },
2348
- "issue_approvals_company_idx": {
2349
- "name": "issue_approvals_company_idx",
2350
- "columns": [
2351
- {
2352
- "expression": "company_id",
2353
- "isExpression": false,
2354
- "asc": true,
2355
- "nulls": "last"
2356
- }
2357
- ],
2358
- "isUnique": false,
2359
- "concurrently": false,
2360
- "method": "btree",
2361
- "with": {}
2362
- }
2363
- },
2364
- "foreignKeys": {
2365
- "issue_approvals_company_id_companies_id_fk": {
2366
- "name": "issue_approvals_company_id_companies_id_fk",
2367
- "tableFrom": "issue_approvals",
2368
- "tableTo": "companies",
2369
- "columnsFrom": [
2370
- "company_id"
2371
- ],
2372
- "columnsTo": [
2373
- "id"
2374
- ],
2375
- "onDelete": "no action",
2376
- "onUpdate": "no action"
2377
- },
2378
- "issue_approvals_issue_id_issues_id_fk": {
2379
- "name": "issue_approvals_issue_id_issues_id_fk",
2380
- "tableFrom": "issue_approvals",
2381
- "tableTo": "issues",
2382
- "columnsFrom": [
2383
- "issue_id"
2384
- ],
2385
- "columnsTo": [
2386
- "id"
2387
- ],
2388
- "onDelete": "cascade",
2389
- "onUpdate": "no action"
2390
- },
2391
- "issue_approvals_approval_id_approvals_id_fk": {
2392
- "name": "issue_approvals_approval_id_approvals_id_fk",
2393
- "tableFrom": "issue_approvals",
2394
- "tableTo": "approvals",
2395
- "columnsFrom": [
2396
- "approval_id"
2397
- ],
2398
- "columnsTo": [
2399
- "id"
2400
- ],
2401
- "onDelete": "cascade",
2402
- "onUpdate": "no action"
2403
- },
2404
- "issue_approvals_linked_by_agent_id_agents_id_fk": {
2405
- "name": "issue_approvals_linked_by_agent_id_agents_id_fk",
2406
- "tableFrom": "issue_approvals",
2407
- "tableTo": "agents",
2408
- "columnsFrom": [
2409
- "linked_by_agent_id"
2410
- ],
2411
- "columnsTo": [
2412
- "id"
2413
- ],
2414
- "onDelete": "set null",
2415
- "onUpdate": "no action"
2416
- }
2417
- },
2418
- "compositePrimaryKeys": {
2419
- "issue_approvals_pk": {
2420
- "name": "issue_approvals_pk",
2421
- "columns": [
2422
- "issue_id",
2423
- "approval_id"
2424
- ]
2425
- }
2426
- },
2427
- "uniqueConstraints": {},
2428
- "policies": {},
2429
- "checkConstraints": {},
2430
- "isRLSEnabled": false
2431
- },
2432
- "public.issue_comments": {
2433
- "name": "issue_comments",
2434
- "schema": "",
2435
- "columns": {
2436
- "id": {
2437
- "name": "id",
2438
- "type": "uuid",
2439
- "primaryKey": true,
2440
- "notNull": true,
2441
- "default": "gen_random_uuid()"
2442
- },
2443
- "company_id": {
2444
- "name": "company_id",
2445
- "type": "uuid",
2446
- "primaryKey": false,
2447
- "notNull": true
2448
- },
2449
- "issue_id": {
2450
- "name": "issue_id",
2451
- "type": "uuid",
2452
- "primaryKey": false,
2453
- "notNull": true
2454
- },
2455
- "author_agent_id": {
2456
- "name": "author_agent_id",
2457
- "type": "uuid",
2458
- "primaryKey": false,
2459
- "notNull": false
2460
- },
2461
- "author_user_id": {
2462
- "name": "author_user_id",
2463
- "type": "text",
2464
- "primaryKey": false,
2465
- "notNull": false
2466
- },
2467
- "body": {
2468
- "name": "body",
2469
- "type": "text",
2470
- "primaryKey": false,
2471
- "notNull": true
2472
- },
2473
- "created_at": {
2474
- "name": "created_at",
2475
- "type": "timestamp with time zone",
2476
- "primaryKey": false,
2477
- "notNull": true,
2478
- "default": "now()"
2479
- },
2480
- "updated_at": {
2481
- "name": "updated_at",
2482
- "type": "timestamp with time zone",
2483
- "primaryKey": false,
2484
- "notNull": true,
2485
- "default": "now()"
2486
- }
2487
- },
2488
- "indexes": {
2489
- "issue_comments_issue_idx": {
2490
- "name": "issue_comments_issue_idx",
2491
- "columns": [
2492
- {
2493
- "expression": "issue_id",
2494
- "isExpression": false,
2495
- "asc": true,
2496
- "nulls": "last"
2497
- }
2498
- ],
2499
- "isUnique": false,
2500
- "concurrently": false,
2501
- "method": "btree",
2502
- "with": {}
2503
- },
2504
- "issue_comments_company_idx": {
2505
- "name": "issue_comments_company_idx",
2506
- "columns": [
2507
- {
2508
- "expression": "company_id",
2509
- "isExpression": false,
2510
- "asc": true,
2511
- "nulls": "last"
2512
- }
2513
- ],
2514
- "isUnique": false,
2515
- "concurrently": false,
2516
- "method": "btree",
2517
- "with": {}
2518
- }
2519
- },
2520
- "foreignKeys": {
2521
- "issue_comments_company_id_companies_id_fk": {
2522
- "name": "issue_comments_company_id_companies_id_fk",
2523
- "tableFrom": "issue_comments",
2524
- "tableTo": "companies",
2525
- "columnsFrom": [
2526
- "company_id"
2527
- ],
2528
- "columnsTo": [
2529
- "id"
2530
- ],
2531
- "onDelete": "no action",
2532
- "onUpdate": "no action"
2533
- },
2534
- "issue_comments_issue_id_issues_id_fk": {
2535
- "name": "issue_comments_issue_id_issues_id_fk",
2536
- "tableFrom": "issue_comments",
2537
- "tableTo": "issues",
2538
- "columnsFrom": [
2539
- "issue_id"
2540
- ],
2541
- "columnsTo": [
2542
- "id"
2543
- ],
2544
- "onDelete": "no action",
2545
- "onUpdate": "no action"
2546
- },
2547
- "issue_comments_author_agent_id_agents_id_fk": {
2548
- "name": "issue_comments_author_agent_id_agents_id_fk",
2549
- "tableFrom": "issue_comments",
2550
- "tableTo": "agents",
2551
- "columnsFrom": [
2552
- "author_agent_id"
2553
- ],
2554
- "columnsTo": [
2555
- "id"
2556
- ],
2557
- "onDelete": "no action",
2558
- "onUpdate": "no action"
2559
- }
2560
- },
2561
- "compositePrimaryKeys": {},
2562
- "uniqueConstraints": {},
2563
- "policies": {},
2564
- "checkConstraints": {},
2565
- "isRLSEnabled": false
2566
- },
2567
- "public.issues": {
2568
- "name": "issues",
2569
- "schema": "",
2570
- "columns": {
2571
- "id": {
2572
- "name": "id",
2573
- "type": "uuid",
2574
- "primaryKey": true,
2575
- "notNull": true,
2576
- "default": "gen_random_uuid()"
2577
- },
2578
- "company_id": {
2579
- "name": "company_id",
2580
- "type": "uuid",
2581
- "primaryKey": false,
2582
- "notNull": true
2583
- },
2584
- "project_id": {
2585
- "name": "project_id",
2586
- "type": "uuid",
2587
- "primaryKey": false,
2588
- "notNull": false
2589
- },
2590
- "goal_id": {
2591
- "name": "goal_id",
2592
- "type": "uuid",
2593
- "primaryKey": false,
2594
- "notNull": false
2595
- },
2596
- "parent_id": {
2597
- "name": "parent_id",
2598
- "type": "uuid",
2599
- "primaryKey": false,
2600
- "notNull": false
2601
- },
2602
- "title": {
2603
- "name": "title",
2604
- "type": "text",
2605
- "primaryKey": false,
2606
- "notNull": true
2607
- },
2608
- "description": {
2609
- "name": "description",
2610
- "type": "text",
2611
- "primaryKey": false,
2612
- "notNull": false
2613
- },
2614
- "status": {
2615
- "name": "status",
2616
- "type": "text",
2617
- "primaryKey": false,
2618
- "notNull": true,
2619
- "default": "'backlog'"
2620
- },
2621
- "priority": {
2622
- "name": "priority",
2623
- "type": "text",
2624
- "primaryKey": false,
2625
- "notNull": true,
2626
- "default": "'medium'"
2627
- },
2628
- "assignee_agent_id": {
2629
- "name": "assignee_agent_id",
2630
- "type": "uuid",
2631
- "primaryKey": false,
2632
- "notNull": false
2633
- },
2634
- "created_by_agent_id": {
2635
- "name": "created_by_agent_id",
2636
- "type": "uuid",
2637
- "primaryKey": false,
2638
- "notNull": false
2639
- },
2640
- "created_by_user_id": {
2641
- "name": "created_by_user_id",
2642
- "type": "text",
2643
- "primaryKey": false,
2644
- "notNull": false
2645
- },
2646
- "issue_number": {
2647
- "name": "issue_number",
2648
- "type": "integer",
2649
- "primaryKey": false,
2650
- "notNull": false
2651
- },
2652
- "identifier": {
2653
- "name": "identifier",
2654
- "type": "text",
2655
- "primaryKey": false,
2656
- "notNull": false
2657
- },
2658
- "request_depth": {
2659
- "name": "request_depth",
2660
- "type": "integer",
2661
- "primaryKey": false,
2662
- "notNull": true,
2663
- "default": 0
2664
- },
2665
- "billing_code": {
2666
- "name": "billing_code",
2667
- "type": "text",
2668
- "primaryKey": false,
2669
- "notNull": false
2670
- },
2671
- "started_at": {
2672
- "name": "started_at",
2673
- "type": "timestamp with time zone",
2674
- "primaryKey": false,
2675
- "notNull": false
2676
- },
2677
- "completed_at": {
2678
- "name": "completed_at",
2679
- "type": "timestamp with time zone",
2680
- "primaryKey": false,
2681
- "notNull": false
2682
- },
2683
- "cancelled_at": {
2684
- "name": "cancelled_at",
2685
- "type": "timestamp with time zone",
2686
- "primaryKey": false,
2687
- "notNull": false
2688
- },
2689
- "created_at": {
2690
- "name": "created_at",
2691
- "type": "timestamp with time zone",
2692
- "primaryKey": false,
2693
- "notNull": true,
2694
- "default": "now()"
2695
- },
2696
- "updated_at": {
2697
- "name": "updated_at",
2698
- "type": "timestamp with time zone",
2699
- "primaryKey": false,
2700
- "notNull": true,
2701
- "default": "now()"
2702
- }
2703
- },
2704
- "indexes": {
2705
- "issues_company_status_idx": {
2706
- "name": "issues_company_status_idx",
2707
- "columns": [
2708
- {
2709
- "expression": "company_id",
2710
- "isExpression": false,
2711
- "asc": true,
2712
- "nulls": "last"
2713
- },
2714
- {
2715
- "expression": "status",
2716
- "isExpression": false,
2717
- "asc": true,
2718
- "nulls": "last"
2719
- }
2720
- ],
2721
- "isUnique": false,
2722
- "concurrently": false,
2723
- "method": "btree",
2724
- "with": {}
2725
- },
2726
- "issues_company_assignee_status_idx": {
2727
- "name": "issues_company_assignee_status_idx",
2728
- "columns": [
2729
- {
2730
- "expression": "company_id",
2731
- "isExpression": false,
2732
- "asc": true,
2733
- "nulls": "last"
2734
- },
2735
- {
2736
- "expression": "assignee_agent_id",
2737
- "isExpression": false,
2738
- "asc": true,
2739
- "nulls": "last"
2740
- },
2741
- {
2742
- "expression": "status",
2743
- "isExpression": false,
2744
- "asc": true,
2745
- "nulls": "last"
2746
- }
2747
- ],
2748
- "isUnique": false,
2749
- "concurrently": false,
2750
- "method": "btree",
2751
- "with": {}
2752
- },
2753
- "issues_company_parent_idx": {
2754
- "name": "issues_company_parent_idx",
2755
- "columns": [
2756
- {
2757
- "expression": "company_id",
2758
- "isExpression": false,
2759
- "asc": true,
2760
- "nulls": "last"
2761
- },
2762
- {
2763
- "expression": "parent_id",
2764
- "isExpression": false,
2765
- "asc": true,
2766
- "nulls": "last"
2767
- }
2768
- ],
2769
- "isUnique": false,
2770
- "concurrently": false,
2771
- "method": "btree",
2772
- "with": {}
2773
- },
2774
- "issues_company_project_idx": {
2775
- "name": "issues_company_project_idx",
2776
- "columns": [
2777
- {
2778
- "expression": "company_id",
2779
- "isExpression": false,
2780
- "asc": true,
2781
- "nulls": "last"
2782
- },
2783
- {
2784
- "expression": "project_id",
2785
- "isExpression": false,
2786
- "asc": true,
2787
- "nulls": "last"
2788
- }
2789
- ],
2790
- "isUnique": false,
2791
- "concurrently": false,
2792
- "method": "btree",
2793
- "with": {}
2794
- },
2795
- "issues_company_identifier_idx": {
2796
- "name": "issues_company_identifier_idx",
2797
- "columns": [
2798
- {
2799
- "expression": "company_id",
2800
- "isExpression": false,
2801
- "asc": true,
2802
- "nulls": "last"
2803
- },
2804
- {
2805
- "expression": "identifier",
2806
- "isExpression": false,
2807
- "asc": true,
2808
- "nulls": "last"
2809
- }
2810
- ],
2811
- "isUnique": true,
2812
- "concurrently": false,
2813
- "method": "btree",
2814
- "with": {}
2815
- }
2816
- },
2817
- "foreignKeys": {
2818
- "issues_company_id_companies_id_fk": {
2819
- "name": "issues_company_id_companies_id_fk",
2820
- "tableFrom": "issues",
2821
- "tableTo": "companies",
2822
- "columnsFrom": [
2823
- "company_id"
2824
- ],
2825
- "columnsTo": [
2826
- "id"
2827
- ],
2828
- "onDelete": "no action",
2829
- "onUpdate": "no action"
2830
- },
2831
- "issues_project_id_projects_id_fk": {
2832
- "name": "issues_project_id_projects_id_fk",
2833
- "tableFrom": "issues",
2834
- "tableTo": "projects",
2835
- "columnsFrom": [
2836
- "project_id"
2837
- ],
2838
- "columnsTo": [
2839
- "id"
2840
- ],
2841
- "onDelete": "no action",
2842
- "onUpdate": "no action"
2843
- },
2844
- "issues_goal_id_goals_id_fk": {
2845
- "name": "issues_goal_id_goals_id_fk",
2846
- "tableFrom": "issues",
2847
- "tableTo": "goals",
2848
- "columnsFrom": [
2849
- "goal_id"
2850
- ],
2851
- "columnsTo": [
2852
- "id"
2853
- ],
2854
- "onDelete": "no action",
2855
- "onUpdate": "no action"
2856
- },
2857
- "issues_parent_id_issues_id_fk": {
2858
- "name": "issues_parent_id_issues_id_fk",
2859
- "tableFrom": "issues",
2860
- "tableTo": "issues",
2861
- "columnsFrom": [
2862
- "parent_id"
2863
- ],
2864
- "columnsTo": [
2865
- "id"
2866
- ],
2867
- "onDelete": "no action",
2868
- "onUpdate": "no action"
2869
- },
2870
- "issues_assignee_agent_id_agents_id_fk": {
2871
- "name": "issues_assignee_agent_id_agents_id_fk",
2872
- "tableFrom": "issues",
2873
- "tableTo": "agents",
2874
- "columnsFrom": [
2875
- "assignee_agent_id"
2876
- ],
2877
- "columnsTo": [
2878
- "id"
2879
- ],
2880
- "onDelete": "no action",
2881
- "onUpdate": "no action"
2882
- },
2883
- "issues_created_by_agent_id_agents_id_fk": {
2884
- "name": "issues_created_by_agent_id_agents_id_fk",
2885
- "tableFrom": "issues",
2886
- "tableTo": "agents",
2887
- "columnsFrom": [
2888
- "created_by_agent_id"
2889
- ],
2890
- "columnsTo": [
2891
- "id"
2892
- ],
2893
- "onDelete": "no action",
2894
- "onUpdate": "no action"
2895
- }
2896
- },
2897
- "compositePrimaryKeys": {},
2898
- "uniqueConstraints": {},
2899
- "policies": {},
2900
- "checkConstraints": {},
2901
- "isRLSEnabled": false
2902
- },
2903
- "public.projects": {
2904
- "name": "projects",
2905
- "schema": "",
2906
- "columns": {
2907
- "id": {
2908
- "name": "id",
2909
- "type": "uuid",
2910
- "primaryKey": true,
2911
- "notNull": true,
2912
- "default": "gen_random_uuid()"
2913
- },
2914
- "company_id": {
2915
- "name": "company_id",
2916
- "type": "uuid",
2917
- "primaryKey": false,
2918
- "notNull": true
2919
- },
2920
- "goal_id": {
2921
- "name": "goal_id",
2922
- "type": "uuid",
2923
- "primaryKey": false,
2924
- "notNull": false
2925
- },
2926
- "name": {
2927
- "name": "name",
2928
- "type": "text",
2929
- "primaryKey": false,
2930
- "notNull": true
2931
- },
2932
- "description": {
2933
- "name": "description",
2934
- "type": "text",
2935
- "primaryKey": false,
2936
- "notNull": false
2937
- },
2938
- "status": {
2939
- "name": "status",
2940
- "type": "text",
2941
- "primaryKey": false,
2942
- "notNull": true,
2943
- "default": "'backlog'"
2944
- },
2945
- "lead_agent_id": {
2946
- "name": "lead_agent_id",
2947
- "type": "uuid",
2948
- "primaryKey": false,
2949
- "notNull": false
2950
- },
2951
- "target_date": {
2952
- "name": "target_date",
2953
- "type": "date",
2954
- "primaryKey": false,
2955
- "notNull": false
2956
- },
2957
- "created_at": {
2958
- "name": "created_at",
2959
- "type": "timestamp with time zone",
2960
- "primaryKey": false,
2961
- "notNull": true,
2962
- "default": "now()"
2963
- },
2964
- "updated_at": {
2965
- "name": "updated_at",
2966
- "type": "timestamp with time zone",
2967
- "primaryKey": false,
2968
- "notNull": true,
2969
- "default": "now()"
2970
- }
2971
- },
2972
- "indexes": {
2973
- "projects_company_idx": {
2974
- "name": "projects_company_idx",
2975
- "columns": [
2976
- {
2977
- "expression": "company_id",
2978
- "isExpression": false,
2979
- "asc": true,
2980
- "nulls": "last"
2981
- }
2982
- ],
2983
- "isUnique": false,
2984
- "concurrently": false,
2985
- "method": "btree",
2986
- "with": {}
2987
- }
2988
- },
2989
- "foreignKeys": {
2990
- "projects_company_id_companies_id_fk": {
2991
- "name": "projects_company_id_companies_id_fk",
2992
- "tableFrom": "projects",
2993
- "tableTo": "companies",
2994
- "columnsFrom": [
2995
- "company_id"
2996
- ],
2997
- "columnsTo": [
2998
- "id"
2999
- ],
3000
- "onDelete": "no action",
3001
- "onUpdate": "no action"
3002
- },
3003
- "projects_goal_id_goals_id_fk": {
3004
- "name": "projects_goal_id_goals_id_fk",
3005
- "tableFrom": "projects",
3006
- "tableTo": "goals",
3007
- "columnsFrom": [
3008
- "goal_id"
3009
- ],
3010
- "columnsTo": [
3011
- "id"
3012
- ],
3013
- "onDelete": "no action",
3014
- "onUpdate": "no action"
3015
- },
3016
- "projects_lead_agent_id_agents_id_fk": {
3017
- "name": "projects_lead_agent_id_agents_id_fk",
3018
- "tableFrom": "projects",
3019
- "tableTo": "agents",
3020
- "columnsFrom": [
3021
- "lead_agent_id"
3022
- ],
3023
- "columnsTo": [
3024
- "id"
3025
- ],
3026
- "onDelete": "no action",
3027
- "onUpdate": "no action"
3028
- }
3029
- },
3030
- "compositePrimaryKeys": {},
3031
- "uniqueConstraints": {},
3032
- "policies": {},
3033
- "checkConstraints": {},
3034
- "isRLSEnabled": false
3035
- }
3036
- },
3037
- "enums": {},
3038
- "schemas": {},
3039
- "sequences": {},
3040
- "roles": {},
3041
- "policies": {},
3042
- "views": {},
3043
- "_meta": {
3044
- "columns": {},
3045
- "schemas": {},
3046
- "tables": {}
3047
- }
3048
- }