@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,2719 +0,0 @@
1
- {
2
- "id": "031f44d0-b532-4484-9355-0e3048db15f3",
3
- "prevId": "2f8c7ee4-0178-4e71-9897-0584a0e050dc",
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_runtime_state": {
315
- "name": "agent_runtime_state",
316
- "schema": "",
317
- "columns": {
318
- "agent_id": {
319
- "name": "agent_id",
320
- "type": "uuid",
321
- "primaryKey": true,
322
- "notNull": true
323
- },
324
- "company_id": {
325
- "name": "company_id",
326
- "type": "uuid",
327
- "primaryKey": false,
328
- "notNull": true
329
- },
330
- "adapter_type": {
331
- "name": "adapter_type",
332
- "type": "text",
333
- "primaryKey": false,
334
- "notNull": true
335
- },
336
- "session_id": {
337
- "name": "session_id",
338
- "type": "text",
339
- "primaryKey": false,
340
- "notNull": false
341
- },
342
- "state_json": {
343
- "name": "state_json",
344
- "type": "jsonb",
345
- "primaryKey": false,
346
- "notNull": true,
347
- "default": "'{}'::jsonb"
348
- },
349
- "last_run_id": {
350
- "name": "last_run_id",
351
- "type": "uuid",
352
- "primaryKey": false,
353
- "notNull": false
354
- },
355
- "last_run_status": {
356
- "name": "last_run_status",
357
- "type": "text",
358
- "primaryKey": false,
359
- "notNull": false
360
- },
361
- "total_input_tokens": {
362
- "name": "total_input_tokens",
363
- "type": "bigint",
364
- "primaryKey": false,
365
- "notNull": true,
366
- "default": 0
367
- },
368
- "total_output_tokens": {
369
- "name": "total_output_tokens",
370
- "type": "bigint",
371
- "primaryKey": false,
372
- "notNull": true,
373
- "default": 0
374
- },
375
- "total_cached_input_tokens": {
376
- "name": "total_cached_input_tokens",
377
- "type": "bigint",
378
- "primaryKey": false,
379
- "notNull": true,
380
- "default": 0
381
- },
382
- "total_cost_cents": {
383
- "name": "total_cost_cents",
384
- "type": "bigint",
385
- "primaryKey": false,
386
- "notNull": true,
387
- "default": 0
388
- },
389
- "last_error": {
390
- "name": "last_error",
391
- "type": "text",
392
- "primaryKey": false,
393
- "notNull": false
394
- },
395
- "created_at": {
396
- "name": "created_at",
397
- "type": "timestamp with time zone",
398
- "primaryKey": false,
399
- "notNull": true,
400
- "default": "now()"
401
- },
402
- "updated_at": {
403
- "name": "updated_at",
404
- "type": "timestamp with time zone",
405
- "primaryKey": false,
406
- "notNull": true,
407
- "default": "now()"
408
- }
409
- },
410
- "indexes": {
411
- "agent_runtime_state_company_agent_idx": {
412
- "name": "agent_runtime_state_company_agent_idx",
413
- "columns": [
414
- {
415
- "expression": "company_id",
416
- "isExpression": false,
417
- "asc": true,
418
- "nulls": "last"
419
- },
420
- {
421
- "expression": "agent_id",
422
- "isExpression": false,
423
- "asc": true,
424
- "nulls": "last"
425
- }
426
- ],
427
- "isUnique": false,
428
- "concurrently": false,
429
- "method": "btree",
430
- "with": {}
431
- },
432
- "agent_runtime_state_company_updated_idx": {
433
- "name": "agent_runtime_state_company_updated_idx",
434
- "columns": [
435
- {
436
- "expression": "company_id",
437
- "isExpression": false,
438
- "asc": true,
439
- "nulls": "last"
440
- },
441
- {
442
- "expression": "updated_at",
443
- "isExpression": false,
444
- "asc": true,
445
- "nulls": "last"
446
- }
447
- ],
448
- "isUnique": false,
449
- "concurrently": false,
450
- "method": "btree",
451
- "with": {}
452
- }
453
- },
454
- "foreignKeys": {
455
- "agent_runtime_state_agent_id_agents_id_fk": {
456
- "name": "agent_runtime_state_agent_id_agents_id_fk",
457
- "tableFrom": "agent_runtime_state",
458
- "tableTo": "agents",
459
- "columnsFrom": [
460
- "agent_id"
461
- ],
462
- "columnsTo": [
463
- "id"
464
- ],
465
- "onDelete": "no action",
466
- "onUpdate": "no action"
467
- },
468
- "agent_runtime_state_company_id_companies_id_fk": {
469
- "name": "agent_runtime_state_company_id_companies_id_fk",
470
- "tableFrom": "agent_runtime_state",
471
- "tableTo": "companies",
472
- "columnsFrom": [
473
- "company_id"
474
- ],
475
- "columnsTo": [
476
- "id"
477
- ],
478
- "onDelete": "no action",
479
- "onUpdate": "no action"
480
- }
481
- },
482
- "compositePrimaryKeys": {},
483
- "uniqueConstraints": {},
484
- "policies": {},
485
- "checkConstraints": {},
486
- "isRLSEnabled": false
487
- },
488
- "public.agent_wakeup_requests": {
489
- "name": "agent_wakeup_requests",
490
- "schema": "",
491
- "columns": {
492
- "id": {
493
- "name": "id",
494
- "type": "uuid",
495
- "primaryKey": true,
496
- "notNull": true,
497
- "default": "gen_random_uuid()"
498
- },
499
- "company_id": {
500
- "name": "company_id",
501
- "type": "uuid",
502
- "primaryKey": false,
503
- "notNull": true
504
- },
505
- "agent_id": {
506
- "name": "agent_id",
507
- "type": "uuid",
508
- "primaryKey": false,
509
- "notNull": true
510
- },
511
- "source": {
512
- "name": "source",
513
- "type": "text",
514
- "primaryKey": false,
515
- "notNull": true
516
- },
517
- "trigger_detail": {
518
- "name": "trigger_detail",
519
- "type": "text",
520
- "primaryKey": false,
521
- "notNull": false
522
- },
523
- "reason": {
524
- "name": "reason",
525
- "type": "text",
526
- "primaryKey": false,
527
- "notNull": false
528
- },
529
- "payload": {
530
- "name": "payload",
531
- "type": "jsonb",
532
- "primaryKey": false,
533
- "notNull": false
534
- },
535
- "status": {
536
- "name": "status",
537
- "type": "text",
538
- "primaryKey": false,
539
- "notNull": true,
540
- "default": "'queued'"
541
- },
542
- "coalesced_count": {
543
- "name": "coalesced_count",
544
- "type": "integer",
545
- "primaryKey": false,
546
- "notNull": true,
547
- "default": 0
548
- },
549
- "requested_by_actor_type": {
550
- "name": "requested_by_actor_type",
551
- "type": "text",
552
- "primaryKey": false,
553
- "notNull": false
554
- },
555
- "requested_by_actor_id": {
556
- "name": "requested_by_actor_id",
557
- "type": "text",
558
- "primaryKey": false,
559
- "notNull": false
560
- },
561
- "idempotency_key": {
562
- "name": "idempotency_key",
563
- "type": "text",
564
- "primaryKey": false,
565
- "notNull": false
566
- },
567
- "run_id": {
568
- "name": "run_id",
569
- "type": "uuid",
570
- "primaryKey": false,
571
- "notNull": false
572
- },
573
- "requested_at": {
574
- "name": "requested_at",
575
- "type": "timestamp with time zone",
576
- "primaryKey": false,
577
- "notNull": true,
578
- "default": "now()"
579
- },
580
- "claimed_at": {
581
- "name": "claimed_at",
582
- "type": "timestamp with time zone",
583
- "primaryKey": false,
584
- "notNull": false
585
- },
586
- "finished_at": {
587
- "name": "finished_at",
588
- "type": "timestamp with time zone",
589
- "primaryKey": false,
590
- "notNull": false
591
- },
592
- "error": {
593
- "name": "error",
594
- "type": "text",
595
- "primaryKey": false,
596
- "notNull": false
597
- },
598
- "created_at": {
599
- "name": "created_at",
600
- "type": "timestamp with time zone",
601
- "primaryKey": false,
602
- "notNull": true,
603
- "default": "now()"
604
- },
605
- "updated_at": {
606
- "name": "updated_at",
607
- "type": "timestamp with time zone",
608
- "primaryKey": false,
609
- "notNull": true,
610
- "default": "now()"
611
- }
612
- },
613
- "indexes": {
614
- "agent_wakeup_requests_company_agent_status_idx": {
615
- "name": "agent_wakeup_requests_company_agent_status_idx",
616
- "columns": [
617
- {
618
- "expression": "company_id",
619
- "isExpression": false,
620
- "asc": true,
621
- "nulls": "last"
622
- },
623
- {
624
- "expression": "agent_id",
625
- "isExpression": false,
626
- "asc": true,
627
- "nulls": "last"
628
- },
629
- {
630
- "expression": "status",
631
- "isExpression": false,
632
- "asc": true,
633
- "nulls": "last"
634
- }
635
- ],
636
- "isUnique": false,
637
- "concurrently": false,
638
- "method": "btree",
639
- "with": {}
640
- },
641
- "agent_wakeup_requests_company_requested_idx": {
642
- "name": "agent_wakeup_requests_company_requested_idx",
643
- "columns": [
644
- {
645
- "expression": "company_id",
646
- "isExpression": false,
647
- "asc": true,
648
- "nulls": "last"
649
- },
650
- {
651
- "expression": "requested_at",
652
- "isExpression": false,
653
- "asc": true,
654
- "nulls": "last"
655
- }
656
- ],
657
- "isUnique": false,
658
- "concurrently": false,
659
- "method": "btree",
660
- "with": {}
661
- },
662
- "agent_wakeup_requests_agent_requested_idx": {
663
- "name": "agent_wakeup_requests_agent_requested_idx",
664
- "columns": [
665
- {
666
- "expression": "agent_id",
667
- "isExpression": false,
668
- "asc": true,
669
- "nulls": "last"
670
- },
671
- {
672
- "expression": "requested_at",
673
- "isExpression": false,
674
- "asc": true,
675
- "nulls": "last"
676
- }
677
- ],
678
- "isUnique": false,
679
- "concurrently": false,
680
- "method": "btree",
681
- "with": {}
682
- }
683
- },
684
- "foreignKeys": {
685
- "agent_wakeup_requests_company_id_companies_id_fk": {
686
- "name": "agent_wakeup_requests_company_id_companies_id_fk",
687
- "tableFrom": "agent_wakeup_requests",
688
- "tableTo": "companies",
689
- "columnsFrom": [
690
- "company_id"
691
- ],
692
- "columnsTo": [
693
- "id"
694
- ],
695
- "onDelete": "no action",
696
- "onUpdate": "no action"
697
- },
698
- "agent_wakeup_requests_agent_id_agents_id_fk": {
699
- "name": "agent_wakeup_requests_agent_id_agents_id_fk",
700
- "tableFrom": "agent_wakeup_requests",
701
- "tableTo": "agents",
702
- "columnsFrom": [
703
- "agent_id"
704
- ],
705
- "columnsTo": [
706
- "id"
707
- ],
708
- "onDelete": "no action",
709
- "onUpdate": "no action"
710
- }
711
- },
712
- "compositePrimaryKeys": {},
713
- "uniqueConstraints": {},
714
- "policies": {},
715
- "checkConstraints": {},
716
- "isRLSEnabled": false
717
- },
718
- "public.agents": {
719
- "name": "agents",
720
- "schema": "",
721
- "columns": {
722
- "id": {
723
- "name": "id",
724
- "type": "uuid",
725
- "primaryKey": true,
726
- "notNull": true,
727
- "default": "gen_random_uuid()"
728
- },
729
- "company_id": {
730
- "name": "company_id",
731
- "type": "uuid",
732
- "primaryKey": false,
733
- "notNull": true
734
- },
735
- "name": {
736
- "name": "name",
737
- "type": "text",
738
- "primaryKey": false,
739
- "notNull": true
740
- },
741
- "role": {
742
- "name": "role",
743
- "type": "text",
744
- "primaryKey": false,
745
- "notNull": true,
746
- "default": "'general'"
747
- },
748
- "title": {
749
- "name": "title",
750
- "type": "text",
751
- "primaryKey": false,
752
- "notNull": false
753
- },
754
- "status": {
755
- "name": "status",
756
- "type": "text",
757
- "primaryKey": false,
758
- "notNull": true,
759
- "default": "'idle'"
760
- },
761
- "reports_to": {
762
- "name": "reports_to",
763
- "type": "uuid",
764
- "primaryKey": false,
765
- "notNull": false
766
- },
767
- "capabilities": {
768
- "name": "capabilities",
769
- "type": "text",
770
- "primaryKey": false,
771
- "notNull": false
772
- },
773
- "adapter_type": {
774
- "name": "adapter_type",
775
- "type": "text",
776
- "primaryKey": false,
777
- "notNull": true,
778
- "default": "'process'"
779
- },
780
- "adapter_config": {
781
- "name": "adapter_config",
782
- "type": "jsonb",
783
- "primaryKey": false,
784
- "notNull": true,
785
- "default": "'{}'::jsonb"
786
- },
787
- "runtime_config": {
788
- "name": "runtime_config",
789
- "type": "jsonb",
790
- "primaryKey": false,
791
- "notNull": true,
792
- "default": "'{}'::jsonb"
793
- },
794
- "budget_monthly_cents": {
795
- "name": "budget_monthly_cents",
796
- "type": "integer",
797
- "primaryKey": false,
798
- "notNull": true,
799
- "default": 0
800
- },
801
- "spent_monthly_cents": {
802
- "name": "spent_monthly_cents",
803
- "type": "integer",
804
- "primaryKey": false,
805
- "notNull": true,
806
- "default": 0
807
- },
808
- "permissions": {
809
- "name": "permissions",
810
- "type": "jsonb",
811
- "primaryKey": false,
812
- "notNull": true,
813
- "default": "'{}'::jsonb"
814
- },
815
- "last_heartbeat_at": {
816
- "name": "last_heartbeat_at",
817
- "type": "timestamp with time zone",
818
- "primaryKey": false,
819
- "notNull": false
820
- },
821
- "metadata": {
822
- "name": "metadata",
823
- "type": "jsonb",
824
- "primaryKey": false,
825
- "notNull": false
826
- },
827
- "created_at": {
828
- "name": "created_at",
829
- "type": "timestamp with time zone",
830
- "primaryKey": false,
831
- "notNull": true,
832
- "default": "now()"
833
- },
834
- "updated_at": {
835
- "name": "updated_at",
836
- "type": "timestamp with time zone",
837
- "primaryKey": false,
838
- "notNull": true,
839
- "default": "now()"
840
- }
841
- },
842
- "indexes": {
843
- "agents_company_status_idx": {
844
- "name": "agents_company_status_idx",
845
- "columns": [
846
- {
847
- "expression": "company_id",
848
- "isExpression": false,
849
- "asc": true,
850
- "nulls": "last"
851
- },
852
- {
853
- "expression": "status",
854
- "isExpression": false,
855
- "asc": true,
856
- "nulls": "last"
857
- }
858
- ],
859
- "isUnique": false,
860
- "concurrently": false,
861
- "method": "btree",
862
- "with": {}
863
- },
864
- "agents_company_reports_to_idx": {
865
- "name": "agents_company_reports_to_idx",
866
- "columns": [
867
- {
868
- "expression": "company_id",
869
- "isExpression": false,
870
- "asc": true,
871
- "nulls": "last"
872
- },
873
- {
874
- "expression": "reports_to",
875
- "isExpression": false,
876
- "asc": true,
877
- "nulls": "last"
878
- }
879
- ],
880
- "isUnique": false,
881
- "concurrently": false,
882
- "method": "btree",
883
- "with": {}
884
- }
885
- },
886
- "foreignKeys": {
887
- "agents_company_id_companies_id_fk": {
888
- "name": "agents_company_id_companies_id_fk",
889
- "tableFrom": "agents",
890
- "tableTo": "companies",
891
- "columnsFrom": [
892
- "company_id"
893
- ],
894
- "columnsTo": [
895
- "id"
896
- ],
897
- "onDelete": "no action",
898
- "onUpdate": "no action"
899
- },
900
- "agents_reports_to_agents_id_fk": {
901
- "name": "agents_reports_to_agents_id_fk",
902
- "tableFrom": "agents",
903
- "tableTo": "agents",
904
- "columnsFrom": [
905
- "reports_to"
906
- ],
907
- "columnsTo": [
908
- "id"
909
- ],
910
- "onDelete": "no action",
911
- "onUpdate": "no action"
912
- }
913
- },
914
- "compositePrimaryKeys": {},
915
- "uniqueConstraints": {},
916
- "policies": {},
917
- "checkConstraints": {},
918
- "isRLSEnabled": false
919
- },
920
- "public.approval_comments": {
921
- "name": "approval_comments",
922
- "schema": "",
923
- "columns": {
924
- "id": {
925
- "name": "id",
926
- "type": "uuid",
927
- "primaryKey": true,
928
- "notNull": true,
929
- "default": "gen_random_uuid()"
930
- },
931
- "company_id": {
932
- "name": "company_id",
933
- "type": "uuid",
934
- "primaryKey": false,
935
- "notNull": true
936
- },
937
- "approval_id": {
938
- "name": "approval_id",
939
- "type": "uuid",
940
- "primaryKey": false,
941
- "notNull": true
942
- },
943
- "author_agent_id": {
944
- "name": "author_agent_id",
945
- "type": "uuid",
946
- "primaryKey": false,
947
- "notNull": false
948
- },
949
- "author_user_id": {
950
- "name": "author_user_id",
951
- "type": "text",
952
- "primaryKey": false,
953
- "notNull": false
954
- },
955
- "body": {
956
- "name": "body",
957
- "type": "text",
958
- "primaryKey": false,
959
- "notNull": true
960
- },
961
- "created_at": {
962
- "name": "created_at",
963
- "type": "timestamp with time zone",
964
- "primaryKey": false,
965
- "notNull": true,
966
- "default": "now()"
967
- },
968
- "updated_at": {
969
- "name": "updated_at",
970
- "type": "timestamp with time zone",
971
- "primaryKey": false,
972
- "notNull": true,
973
- "default": "now()"
974
- }
975
- },
976
- "indexes": {
977
- "approval_comments_company_idx": {
978
- "name": "approval_comments_company_idx",
979
- "columns": [
980
- {
981
- "expression": "company_id",
982
- "isExpression": false,
983
- "asc": true,
984
- "nulls": "last"
985
- }
986
- ],
987
- "isUnique": false,
988
- "concurrently": false,
989
- "method": "btree",
990
- "with": {}
991
- },
992
- "approval_comments_approval_idx": {
993
- "name": "approval_comments_approval_idx",
994
- "columns": [
995
- {
996
- "expression": "approval_id",
997
- "isExpression": false,
998
- "asc": true,
999
- "nulls": "last"
1000
- }
1001
- ],
1002
- "isUnique": false,
1003
- "concurrently": false,
1004
- "method": "btree",
1005
- "with": {}
1006
- },
1007
- "approval_comments_approval_created_idx": {
1008
- "name": "approval_comments_approval_created_idx",
1009
- "columns": [
1010
- {
1011
- "expression": "approval_id",
1012
- "isExpression": false,
1013
- "asc": true,
1014
- "nulls": "last"
1015
- },
1016
- {
1017
- "expression": "created_at",
1018
- "isExpression": false,
1019
- "asc": true,
1020
- "nulls": "last"
1021
- }
1022
- ],
1023
- "isUnique": false,
1024
- "concurrently": false,
1025
- "method": "btree",
1026
- "with": {}
1027
- }
1028
- },
1029
- "foreignKeys": {
1030
- "approval_comments_company_id_companies_id_fk": {
1031
- "name": "approval_comments_company_id_companies_id_fk",
1032
- "tableFrom": "approval_comments",
1033
- "tableTo": "companies",
1034
- "columnsFrom": [
1035
- "company_id"
1036
- ],
1037
- "columnsTo": [
1038
- "id"
1039
- ],
1040
- "onDelete": "no action",
1041
- "onUpdate": "no action"
1042
- },
1043
- "approval_comments_approval_id_approvals_id_fk": {
1044
- "name": "approval_comments_approval_id_approvals_id_fk",
1045
- "tableFrom": "approval_comments",
1046
- "tableTo": "approvals",
1047
- "columnsFrom": [
1048
- "approval_id"
1049
- ],
1050
- "columnsTo": [
1051
- "id"
1052
- ],
1053
- "onDelete": "no action",
1054
- "onUpdate": "no action"
1055
- },
1056
- "approval_comments_author_agent_id_agents_id_fk": {
1057
- "name": "approval_comments_author_agent_id_agents_id_fk",
1058
- "tableFrom": "approval_comments",
1059
- "tableTo": "agents",
1060
- "columnsFrom": [
1061
- "author_agent_id"
1062
- ],
1063
- "columnsTo": [
1064
- "id"
1065
- ],
1066
- "onDelete": "no action",
1067
- "onUpdate": "no action"
1068
- }
1069
- },
1070
- "compositePrimaryKeys": {},
1071
- "uniqueConstraints": {},
1072
- "policies": {},
1073
- "checkConstraints": {},
1074
- "isRLSEnabled": false
1075
- },
1076
- "public.approvals": {
1077
- "name": "approvals",
1078
- "schema": "",
1079
- "columns": {
1080
- "id": {
1081
- "name": "id",
1082
- "type": "uuid",
1083
- "primaryKey": true,
1084
- "notNull": true,
1085
- "default": "gen_random_uuid()"
1086
- },
1087
- "company_id": {
1088
- "name": "company_id",
1089
- "type": "uuid",
1090
- "primaryKey": false,
1091
- "notNull": true
1092
- },
1093
- "type": {
1094
- "name": "type",
1095
- "type": "text",
1096
- "primaryKey": false,
1097
- "notNull": true
1098
- },
1099
- "requested_by_agent_id": {
1100
- "name": "requested_by_agent_id",
1101
- "type": "uuid",
1102
- "primaryKey": false,
1103
- "notNull": false
1104
- },
1105
- "requested_by_user_id": {
1106
- "name": "requested_by_user_id",
1107
- "type": "text",
1108
- "primaryKey": false,
1109
- "notNull": false
1110
- },
1111
- "status": {
1112
- "name": "status",
1113
- "type": "text",
1114
- "primaryKey": false,
1115
- "notNull": true,
1116
- "default": "'pending'"
1117
- },
1118
- "payload": {
1119
- "name": "payload",
1120
- "type": "jsonb",
1121
- "primaryKey": false,
1122
- "notNull": true
1123
- },
1124
- "decision_note": {
1125
- "name": "decision_note",
1126
- "type": "text",
1127
- "primaryKey": false,
1128
- "notNull": false
1129
- },
1130
- "decided_by_user_id": {
1131
- "name": "decided_by_user_id",
1132
- "type": "text",
1133
- "primaryKey": false,
1134
- "notNull": false
1135
- },
1136
- "decided_at": {
1137
- "name": "decided_at",
1138
- "type": "timestamp with time zone",
1139
- "primaryKey": false,
1140
- "notNull": false
1141
- },
1142
- "created_at": {
1143
- "name": "created_at",
1144
- "type": "timestamp with time zone",
1145
- "primaryKey": false,
1146
- "notNull": true,
1147
- "default": "now()"
1148
- },
1149
- "updated_at": {
1150
- "name": "updated_at",
1151
- "type": "timestamp with time zone",
1152
- "primaryKey": false,
1153
- "notNull": true,
1154
- "default": "now()"
1155
- }
1156
- },
1157
- "indexes": {
1158
- "approvals_company_status_type_idx": {
1159
- "name": "approvals_company_status_type_idx",
1160
- "columns": [
1161
- {
1162
- "expression": "company_id",
1163
- "isExpression": false,
1164
- "asc": true,
1165
- "nulls": "last"
1166
- },
1167
- {
1168
- "expression": "status",
1169
- "isExpression": false,
1170
- "asc": true,
1171
- "nulls": "last"
1172
- },
1173
- {
1174
- "expression": "type",
1175
- "isExpression": false,
1176
- "asc": true,
1177
- "nulls": "last"
1178
- }
1179
- ],
1180
- "isUnique": false,
1181
- "concurrently": false,
1182
- "method": "btree",
1183
- "with": {}
1184
- }
1185
- },
1186
- "foreignKeys": {
1187
- "approvals_company_id_companies_id_fk": {
1188
- "name": "approvals_company_id_companies_id_fk",
1189
- "tableFrom": "approvals",
1190
- "tableTo": "companies",
1191
- "columnsFrom": [
1192
- "company_id"
1193
- ],
1194
- "columnsTo": [
1195
- "id"
1196
- ],
1197
- "onDelete": "no action",
1198
- "onUpdate": "no action"
1199
- },
1200
- "approvals_requested_by_agent_id_agents_id_fk": {
1201
- "name": "approvals_requested_by_agent_id_agents_id_fk",
1202
- "tableFrom": "approvals",
1203
- "tableTo": "agents",
1204
- "columnsFrom": [
1205
- "requested_by_agent_id"
1206
- ],
1207
- "columnsTo": [
1208
- "id"
1209
- ],
1210
- "onDelete": "no action",
1211
- "onUpdate": "no action"
1212
- }
1213
- },
1214
- "compositePrimaryKeys": {},
1215
- "uniqueConstraints": {},
1216
- "policies": {},
1217
- "checkConstraints": {},
1218
- "isRLSEnabled": false
1219
- },
1220
- "public.companies": {
1221
- "name": "companies",
1222
- "schema": "",
1223
- "columns": {
1224
- "id": {
1225
- "name": "id",
1226
- "type": "uuid",
1227
- "primaryKey": true,
1228
- "notNull": true,
1229
- "default": "gen_random_uuid()"
1230
- },
1231
- "name": {
1232
- "name": "name",
1233
- "type": "text",
1234
- "primaryKey": false,
1235
- "notNull": true
1236
- },
1237
- "description": {
1238
- "name": "description",
1239
- "type": "text",
1240
- "primaryKey": false,
1241
- "notNull": false
1242
- },
1243
- "status": {
1244
- "name": "status",
1245
- "type": "text",
1246
- "primaryKey": false,
1247
- "notNull": true,
1248
- "default": "'active'"
1249
- },
1250
- "issue_prefix": {
1251
- "name": "issue_prefix",
1252
- "type": "text",
1253
- "primaryKey": false,
1254
- "notNull": true,
1255
- "default": "'PAP'"
1256
- },
1257
- "issue_counter": {
1258
- "name": "issue_counter",
1259
- "type": "integer",
1260
- "primaryKey": false,
1261
- "notNull": true,
1262
- "default": 0
1263
- },
1264
- "budget_monthly_cents": {
1265
- "name": "budget_monthly_cents",
1266
- "type": "integer",
1267
- "primaryKey": false,
1268
- "notNull": true,
1269
- "default": 0
1270
- },
1271
- "spent_monthly_cents": {
1272
- "name": "spent_monthly_cents",
1273
- "type": "integer",
1274
- "primaryKey": false,
1275
- "notNull": true,
1276
- "default": 0
1277
- },
1278
- "require_board_approval_for_new_agents": {
1279
- "name": "require_board_approval_for_new_agents",
1280
- "type": "boolean",
1281
- "primaryKey": false,
1282
- "notNull": true,
1283
- "default": true
1284
- },
1285
- "created_at": {
1286
- "name": "created_at",
1287
- "type": "timestamp with time zone",
1288
- "primaryKey": false,
1289
- "notNull": true,
1290
- "default": "now()"
1291
- },
1292
- "updated_at": {
1293
- "name": "updated_at",
1294
- "type": "timestamp with time zone",
1295
- "primaryKey": false,
1296
- "notNull": true,
1297
- "default": "now()"
1298
- }
1299
- },
1300
- "indexes": {},
1301
- "foreignKeys": {},
1302
- "compositePrimaryKeys": {},
1303
- "uniqueConstraints": {},
1304
- "policies": {},
1305
- "checkConstraints": {},
1306
- "isRLSEnabled": false
1307
- },
1308
- "public.cost_events": {
1309
- "name": "cost_events",
1310
- "schema": "",
1311
- "columns": {
1312
- "id": {
1313
- "name": "id",
1314
- "type": "uuid",
1315
- "primaryKey": true,
1316
- "notNull": true,
1317
- "default": "gen_random_uuid()"
1318
- },
1319
- "company_id": {
1320
- "name": "company_id",
1321
- "type": "uuid",
1322
- "primaryKey": false,
1323
- "notNull": true
1324
- },
1325
- "agent_id": {
1326
- "name": "agent_id",
1327
- "type": "uuid",
1328
- "primaryKey": false,
1329
- "notNull": true
1330
- },
1331
- "issue_id": {
1332
- "name": "issue_id",
1333
- "type": "uuid",
1334
- "primaryKey": false,
1335
- "notNull": false
1336
- },
1337
- "project_id": {
1338
- "name": "project_id",
1339
- "type": "uuid",
1340
- "primaryKey": false,
1341
- "notNull": false
1342
- },
1343
- "goal_id": {
1344
- "name": "goal_id",
1345
- "type": "uuid",
1346
- "primaryKey": false,
1347
- "notNull": false
1348
- },
1349
- "billing_code": {
1350
- "name": "billing_code",
1351
- "type": "text",
1352
- "primaryKey": false,
1353
- "notNull": false
1354
- },
1355
- "provider": {
1356
- "name": "provider",
1357
- "type": "text",
1358
- "primaryKey": false,
1359
- "notNull": true
1360
- },
1361
- "model": {
1362
- "name": "model",
1363
- "type": "text",
1364
- "primaryKey": false,
1365
- "notNull": true
1366
- },
1367
- "input_tokens": {
1368
- "name": "input_tokens",
1369
- "type": "integer",
1370
- "primaryKey": false,
1371
- "notNull": true,
1372
- "default": 0
1373
- },
1374
- "output_tokens": {
1375
- "name": "output_tokens",
1376
- "type": "integer",
1377
- "primaryKey": false,
1378
- "notNull": true,
1379
- "default": 0
1380
- },
1381
- "cost_cents": {
1382
- "name": "cost_cents",
1383
- "type": "integer",
1384
- "primaryKey": false,
1385
- "notNull": true
1386
- },
1387
- "occurred_at": {
1388
- "name": "occurred_at",
1389
- "type": "timestamp with time zone",
1390
- "primaryKey": false,
1391
- "notNull": true
1392
- },
1393
- "created_at": {
1394
- "name": "created_at",
1395
- "type": "timestamp with time zone",
1396
- "primaryKey": false,
1397
- "notNull": true,
1398
- "default": "now()"
1399
- }
1400
- },
1401
- "indexes": {
1402
- "cost_events_company_occurred_idx": {
1403
- "name": "cost_events_company_occurred_idx",
1404
- "columns": [
1405
- {
1406
- "expression": "company_id",
1407
- "isExpression": false,
1408
- "asc": true,
1409
- "nulls": "last"
1410
- },
1411
- {
1412
- "expression": "occurred_at",
1413
- "isExpression": false,
1414
- "asc": true,
1415
- "nulls": "last"
1416
- }
1417
- ],
1418
- "isUnique": false,
1419
- "concurrently": false,
1420
- "method": "btree",
1421
- "with": {}
1422
- },
1423
- "cost_events_company_agent_occurred_idx": {
1424
- "name": "cost_events_company_agent_occurred_idx",
1425
- "columns": [
1426
- {
1427
- "expression": "company_id",
1428
- "isExpression": false,
1429
- "asc": true,
1430
- "nulls": "last"
1431
- },
1432
- {
1433
- "expression": "agent_id",
1434
- "isExpression": false,
1435
- "asc": true,
1436
- "nulls": "last"
1437
- },
1438
- {
1439
- "expression": "occurred_at",
1440
- "isExpression": false,
1441
- "asc": true,
1442
- "nulls": "last"
1443
- }
1444
- ],
1445
- "isUnique": false,
1446
- "concurrently": false,
1447
- "method": "btree",
1448
- "with": {}
1449
- }
1450
- },
1451
- "foreignKeys": {
1452
- "cost_events_company_id_companies_id_fk": {
1453
- "name": "cost_events_company_id_companies_id_fk",
1454
- "tableFrom": "cost_events",
1455
- "tableTo": "companies",
1456
- "columnsFrom": [
1457
- "company_id"
1458
- ],
1459
- "columnsTo": [
1460
- "id"
1461
- ],
1462
- "onDelete": "no action",
1463
- "onUpdate": "no action"
1464
- },
1465
- "cost_events_agent_id_agents_id_fk": {
1466
- "name": "cost_events_agent_id_agents_id_fk",
1467
- "tableFrom": "cost_events",
1468
- "tableTo": "agents",
1469
- "columnsFrom": [
1470
- "agent_id"
1471
- ],
1472
- "columnsTo": [
1473
- "id"
1474
- ],
1475
- "onDelete": "no action",
1476
- "onUpdate": "no action"
1477
- },
1478
- "cost_events_issue_id_issues_id_fk": {
1479
- "name": "cost_events_issue_id_issues_id_fk",
1480
- "tableFrom": "cost_events",
1481
- "tableTo": "issues",
1482
- "columnsFrom": [
1483
- "issue_id"
1484
- ],
1485
- "columnsTo": [
1486
- "id"
1487
- ],
1488
- "onDelete": "no action",
1489
- "onUpdate": "no action"
1490
- },
1491
- "cost_events_project_id_projects_id_fk": {
1492
- "name": "cost_events_project_id_projects_id_fk",
1493
- "tableFrom": "cost_events",
1494
- "tableTo": "projects",
1495
- "columnsFrom": [
1496
- "project_id"
1497
- ],
1498
- "columnsTo": [
1499
- "id"
1500
- ],
1501
- "onDelete": "no action",
1502
- "onUpdate": "no action"
1503
- },
1504
- "cost_events_goal_id_goals_id_fk": {
1505
- "name": "cost_events_goal_id_goals_id_fk",
1506
- "tableFrom": "cost_events",
1507
- "tableTo": "goals",
1508
- "columnsFrom": [
1509
- "goal_id"
1510
- ],
1511
- "columnsTo": [
1512
- "id"
1513
- ],
1514
- "onDelete": "no action",
1515
- "onUpdate": "no action"
1516
- }
1517
- },
1518
- "compositePrimaryKeys": {},
1519
- "uniqueConstraints": {},
1520
- "policies": {},
1521
- "checkConstraints": {},
1522
- "isRLSEnabled": false
1523
- },
1524
- "public.goals": {
1525
- "name": "goals",
1526
- "schema": "",
1527
- "columns": {
1528
- "id": {
1529
- "name": "id",
1530
- "type": "uuid",
1531
- "primaryKey": true,
1532
- "notNull": true,
1533
- "default": "gen_random_uuid()"
1534
- },
1535
- "company_id": {
1536
- "name": "company_id",
1537
- "type": "uuid",
1538
- "primaryKey": false,
1539
- "notNull": true
1540
- },
1541
- "title": {
1542
- "name": "title",
1543
- "type": "text",
1544
- "primaryKey": false,
1545
- "notNull": true
1546
- },
1547
- "description": {
1548
- "name": "description",
1549
- "type": "text",
1550
- "primaryKey": false,
1551
- "notNull": false
1552
- },
1553
- "level": {
1554
- "name": "level",
1555
- "type": "text",
1556
- "primaryKey": false,
1557
- "notNull": true,
1558
- "default": "'task'"
1559
- },
1560
- "status": {
1561
- "name": "status",
1562
- "type": "text",
1563
- "primaryKey": false,
1564
- "notNull": true,
1565
- "default": "'planned'"
1566
- },
1567
- "parent_id": {
1568
- "name": "parent_id",
1569
- "type": "uuid",
1570
- "primaryKey": false,
1571
- "notNull": false
1572
- },
1573
- "owner_agent_id": {
1574
- "name": "owner_agent_id",
1575
- "type": "uuid",
1576
- "primaryKey": false,
1577
- "notNull": false
1578
- },
1579
- "created_at": {
1580
- "name": "created_at",
1581
- "type": "timestamp with time zone",
1582
- "primaryKey": false,
1583
- "notNull": true,
1584
- "default": "now()"
1585
- },
1586
- "updated_at": {
1587
- "name": "updated_at",
1588
- "type": "timestamp with time zone",
1589
- "primaryKey": false,
1590
- "notNull": true,
1591
- "default": "now()"
1592
- }
1593
- },
1594
- "indexes": {
1595
- "goals_company_idx": {
1596
- "name": "goals_company_idx",
1597
- "columns": [
1598
- {
1599
- "expression": "company_id",
1600
- "isExpression": false,
1601
- "asc": true,
1602
- "nulls": "last"
1603
- }
1604
- ],
1605
- "isUnique": false,
1606
- "concurrently": false,
1607
- "method": "btree",
1608
- "with": {}
1609
- }
1610
- },
1611
- "foreignKeys": {
1612
- "goals_company_id_companies_id_fk": {
1613
- "name": "goals_company_id_companies_id_fk",
1614
- "tableFrom": "goals",
1615
- "tableTo": "companies",
1616
- "columnsFrom": [
1617
- "company_id"
1618
- ],
1619
- "columnsTo": [
1620
- "id"
1621
- ],
1622
- "onDelete": "no action",
1623
- "onUpdate": "no action"
1624
- },
1625
- "goals_parent_id_goals_id_fk": {
1626
- "name": "goals_parent_id_goals_id_fk",
1627
- "tableFrom": "goals",
1628
- "tableTo": "goals",
1629
- "columnsFrom": [
1630
- "parent_id"
1631
- ],
1632
- "columnsTo": [
1633
- "id"
1634
- ],
1635
- "onDelete": "no action",
1636
- "onUpdate": "no action"
1637
- },
1638
- "goals_owner_agent_id_agents_id_fk": {
1639
- "name": "goals_owner_agent_id_agents_id_fk",
1640
- "tableFrom": "goals",
1641
- "tableTo": "agents",
1642
- "columnsFrom": [
1643
- "owner_agent_id"
1644
- ],
1645
- "columnsTo": [
1646
- "id"
1647
- ],
1648
- "onDelete": "no action",
1649
- "onUpdate": "no action"
1650
- }
1651
- },
1652
- "compositePrimaryKeys": {},
1653
- "uniqueConstraints": {},
1654
- "policies": {},
1655
- "checkConstraints": {},
1656
- "isRLSEnabled": false
1657
- },
1658
- "public.heartbeat_run_events": {
1659
- "name": "heartbeat_run_events",
1660
- "schema": "",
1661
- "columns": {
1662
- "id": {
1663
- "name": "id",
1664
- "type": "bigserial",
1665
- "primaryKey": true,
1666
- "notNull": true
1667
- },
1668
- "company_id": {
1669
- "name": "company_id",
1670
- "type": "uuid",
1671
- "primaryKey": false,
1672
- "notNull": true
1673
- },
1674
- "run_id": {
1675
- "name": "run_id",
1676
- "type": "uuid",
1677
- "primaryKey": false,
1678
- "notNull": true
1679
- },
1680
- "agent_id": {
1681
- "name": "agent_id",
1682
- "type": "uuid",
1683
- "primaryKey": false,
1684
- "notNull": true
1685
- },
1686
- "seq": {
1687
- "name": "seq",
1688
- "type": "integer",
1689
- "primaryKey": false,
1690
- "notNull": true
1691
- },
1692
- "event_type": {
1693
- "name": "event_type",
1694
- "type": "text",
1695
- "primaryKey": false,
1696
- "notNull": true
1697
- },
1698
- "stream": {
1699
- "name": "stream",
1700
- "type": "text",
1701
- "primaryKey": false,
1702
- "notNull": false
1703
- },
1704
- "level": {
1705
- "name": "level",
1706
- "type": "text",
1707
- "primaryKey": false,
1708
- "notNull": false
1709
- },
1710
- "color": {
1711
- "name": "color",
1712
- "type": "text",
1713
- "primaryKey": false,
1714
- "notNull": false
1715
- },
1716
- "message": {
1717
- "name": "message",
1718
- "type": "text",
1719
- "primaryKey": false,
1720
- "notNull": false
1721
- },
1722
- "payload": {
1723
- "name": "payload",
1724
- "type": "jsonb",
1725
- "primaryKey": false,
1726
- "notNull": false
1727
- },
1728
- "created_at": {
1729
- "name": "created_at",
1730
- "type": "timestamp with time zone",
1731
- "primaryKey": false,
1732
- "notNull": true,
1733
- "default": "now()"
1734
- }
1735
- },
1736
- "indexes": {
1737
- "heartbeat_run_events_run_seq_idx": {
1738
- "name": "heartbeat_run_events_run_seq_idx",
1739
- "columns": [
1740
- {
1741
- "expression": "run_id",
1742
- "isExpression": false,
1743
- "asc": true,
1744
- "nulls": "last"
1745
- },
1746
- {
1747
- "expression": "seq",
1748
- "isExpression": false,
1749
- "asc": true,
1750
- "nulls": "last"
1751
- }
1752
- ],
1753
- "isUnique": false,
1754
- "concurrently": false,
1755
- "method": "btree",
1756
- "with": {}
1757
- },
1758
- "heartbeat_run_events_company_run_idx": {
1759
- "name": "heartbeat_run_events_company_run_idx",
1760
- "columns": [
1761
- {
1762
- "expression": "company_id",
1763
- "isExpression": false,
1764
- "asc": true,
1765
- "nulls": "last"
1766
- },
1767
- {
1768
- "expression": "run_id",
1769
- "isExpression": false,
1770
- "asc": true,
1771
- "nulls": "last"
1772
- }
1773
- ],
1774
- "isUnique": false,
1775
- "concurrently": false,
1776
- "method": "btree",
1777
- "with": {}
1778
- },
1779
- "heartbeat_run_events_company_created_idx": {
1780
- "name": "heartbeat_run_events_company_created_idx",
1781
- "columns": [
1782
- {
1783
- "expression": "company_id",
1784
- "isExpression": false,
1785
- "asc": true,
1786
- "nulls": "last"
1787
- },
1788
- {
1789
- "expression": "created_at",
1790
- "isExpression": false,
1791
- "asc": true,
1792
- "nulls": "last"
1793
- }
1794
- ],
1795
- "isUnique": false,
1796
- "concurrently": false,
1797
- "method": "btree",
1798
- "with": {}
1799
- }
1800
- },
1801
- "foreignKeys": {
1802
- "heartbeat_run_events_company_id_companies_id_fk": {
1803
- "name": "heartbeat_run_events_company_id_companies_id_fk",
1804
- "tableFrom": "heartbeat_run_events",
1805
- "tableTo": "companies",
1806
- "columnsFrom": [
1807
- "company_id"
1808
- ],
1809
- "columnsTo": [
1810
- "id"
1811
- ],
1812
- "onDelete": "no action",
1813
- "onUpdate": "no action"
1814
- },
1815
- "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
1816
- "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
1817
- "tableFrom": "heartbeat_run_events",
1818
- "tableTo": "heartbeat_runs",
1819
- "columnsFrom": [
1820
- "run_id"
1821
- ],
1822
- "columnsTo": [
1823
- "id"
1824
- ],
1825
- "onDelete": "no action",
1826
- "onUpdate": "no action"
1827
- },
1828
- "heartbeat_run_events_agent_id_agents_id_fk": {
1829
- "name": "heartbeat_run_events_agent_id_agents_id_fk",
1830
- "tableFrom": "heartbeat_run_events",
1831
- "tableTo": "agents",
1832
- "columnsFrom": [
1833
- "agent_id"
1834
- ],
1835
- "columnsTo": [
1836
- "id"
1837
- ],
1838
- "onDelete": "no action",
1839
- "onUpdate": "no action"
1840
- }
1841
- },
1842
- "compositePrimaryKeys": {},
1843
- "uniqueConstraints": {},
1844
- "policies": {},
1845
- "checkConstraints": {},
1846
- "isRLSEnabled": false
1847
- },
1848
- "public.heartbeat_runs": {
1849
- "name": "heartbeat_runs",
1850
- "schema": "",
1851
- "columns": {
1852
- "id": {
1853
- "name": "id",
1854
- "type": "uuid",
1855
- "primaryKey": true,
1856
- "notNull": true,
1857
- "default": "gen_random_uuid()"
1858
- },
1859
- "company_id": {
1860
- "name": "company_id",
1861
- "type": "uuid",
1862
- "primaryKey": false,
1863
- "notNull": true
1864
- },
1865
- "agent_id": {
1866
- "name": "agent_id",
1867
- "type": "uuid",
1868
- "primaryKey": false,
1869
- "notNull": true
1870
- },
1871
- "invocation_source": {
1872
- "name": "invocation_source",
1873
- "type": "text",
1874
- "primaryKey": false,
1875
- "notNull": true,
1876
- "default": "'on_demand'"
1877
- },
1878
- "trigger_detail": {
1879
- "name": "trigger_detail",
1880
- "type": "text",
1881
- "primaryKey": false,
1882
- "notNull": false
1883
- },
1884
- "status": {
1885
- "name": "status",
1886
- "type": "text",
1887
- "primaryKey": false,
1888
- "notNull": true,
1889
- "default": "'queued'"
1890
- },
1891
- "started_at": {
1892
- "name": "started_at",
1893
- "type": "timestamp with time zone",
1894
- "primaryKey": false,
1895
- "notNull": false
1896
- },
1897
- "finished_at": {
1898
- "name": "finished_at",
1899
- "type": "timestamp with time zone",
1900
- "primaryKey": false,
1901
- "notNull": false
1902
- },
1903
- "error": {
1904
- "name": "error",
1905
- "type": "text",
1906
- "primaryKey": false,
1907
- "notNull": false
1908
- },
1909
- "wakeup_request_id": {
1910
- "name": "wakeup_request_id",
1911
- "type": "uuid",
1912
- "primaryKey": false,
1913
- "notNull": false
1914
- },
1915
- "exit_code": {
1916
- "name": "exit_code",
1917
- "type": "integer",
1918
- "primaryKey": false,
1919
- "notNull": false
1920
- },
1921
- "signal": {
1922
- "name": "signal",
1923
- "type": "text",
1924
- "primaryKey": false,
1925
- "notNull": false
1926
- },
1927
- "usage_json": {
1928
- "name": "usage_json",
1929
- "type": "jsonb",
1930
- "primaryKey": false,
1931
- "notNull": false
1932
- },
1933
- "result_json": {
1934
- "name": "result_json",
1935
- "type": "jsonb",
1936
- "primaryKey": false,
1937
- "notNull": false
1938
- },
1939
- "session_id_before": {
1940
- "name": "session_id_before",
1941
- "type": "text",
1942
- "primaryKey": false,
1943
- "notNull": false
1944
- },
1945
- "session_id_after": {
1946
- "name": "session_id_after",
1947
- "type": "text",
1948
- "primaryKey": false,
1949
- "notNull": false
1950
- },
1951
- "log_store": {
1952
- "name": "log_store",
1953
- "type": "text",
1954
- "primaryKey": false,
1955
- "notNull": false
1956
- },
1957
- "log_ref": {
1958
- "name": "log_ref",
1959
- "type": "text",
1960
- "primaryKey": false,
1961
- "notNull": false
1962
- },
1963
- "log_bytes": {
1964
- "name": "log_bytes",
1965
- "type": "bigint",
1966
- "primaryKey": false,
1967
- "notNull": false
1968
- },
1969
- "log_sha256": {
1970
- "name": "log_sha256",
1971
- "type": "text",
1972
- "primaryKey": false,
1973
- "notNull": false
1974
- },
1975
- "log_compressed": {
1976
- "name": "log_compressed",
1977
- "type": "boolean",
1978
- "primaryKey": false,
1979
- "notNull": true,
1980
- "default": false
1981
- },
1982
- "stdout_excerpt": {
1983
- "name": "stdout_excerpt",
1984
- "type": "text",
1985
- "primaryKey": false,
1986
- "notNull": false
1987
- },
1988
- "stderr_excerpt": {
1989
- "name": "stderr_excerpt",
1990
- "type": "text",
1991
- "primaryKey": false,
1992
- "notNull": false
1993
- },
1994
- "error_code": {
1995
- "name": "error_code",
1996
- "type": "text",
1997
- "primaryKey": false,
1998
- "notNull": false
1999
- },
2000
- "external_run_id": {
2001
- "name": "external_run_id",
2002
- "type": "text",
2003
- "primaryKey": false,
2004
- "notNull": false
2005
- },
2006
- "context_snapshot": {
2007
- "name": "context_snapshot",
2008
- "type": "jsonb",
2009
- "primaryKey": false,
2010
- "notNull": false
2011
- },
2012
- "created_at": {
2013
- "name": "created_at",
2014
- "type": "timestamp with time zone",
2015
- "primaryKey": false,
2016
- "notNull": true,
2017
- "default": "now()"
2018
- },
2019
- "updated_at": {
2020
- "name": "updated_at",
2021
- "type": "timestamp with time zone",
2022
- "primaryKey": false,
2023
- "notNull": true,
2024
- "default": "now()"
2025
- }
2026
- },
2027
- "indexes": {
2028
- "heartbeat_runs_company_agent_started_idx": {
2029
- "name": "heartbeat_runs_company_agent_started_idx",
2030
- "columns": [
2031
- {
2032
- "expression": "company_id",
2033
- "isExpression": false,
2034
- "asc": true,
2035
- "nulls": "last"
2036
- },
2037
- {
2038
- "expression": "agent_id",
2039
- "isExpression": false,
2040
- "asc": true,
2041
- "nulls": "last"
2042
- },
2043
- {
2044
- "expression": "started_at",
2045
- "isExpression": false,
2046
- "asc": true,
2047
- "nulls": "last"
2048
- }
2049
- ],
2050
- "isUnique": false,
2051
- "concurrently": false,
2052
- "method": "btree",
2053
- "with": {}
2054
- }
2055
- },
2056
- "foreignKeys": {
2057
- "heartbeat_runs_company_id_companies_id_fk": {
2058
- "name": "heartbeat_runs_company_id_companies_id_fk",
2059
- "tableFrom": "heartbeat_runs",
2060
- "tableTo": "companies",
2061
- "columnsFrom": [
2062
- "company_id"
2063
- ],
2064
- "columnsTo": [
2065
- "id"
2066
- ],
2067
- "onDelete": "no action",
2068
- "onUpdate": "no action"
2069
- },
2070
- "heartbeat_runs_agent_id_agents_id_fk": {
2071
- "name": "heartbeat_runs_agent_id_agents_id_fk",
2072
- "tableFrom": "heartbeat_runs",
2073
- "tableTo": "agents",
2074
- "columnsFrom": [
2075
- "agent_id"
2076
- ],
2077
- "columnsTo": [
2078
- "id"
2079
- ],
2080
- "onDelete": "no action",
2081
- "onUpdate": "no action"
2082
- },
2083
- "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
2084
- "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
2085
- "tableFrom": "heartbeat_runs",
2086
- "tableTo": "agent_wakeup_requests",
2087
- "columnsFrom": [
2088
- "wakeup_request_id"
2089
- ],
2090
- "columnsTo": [
2091
- "id"
2092
- ],
2093
- "onDelete": "no action",
2094
- "onUpdate": "no action"
2095
- }
2096
- },
2097
- "compositePrimaryKeys": {},
2098
- "uniqueConstraints": {},
2099
- "policies": {},
2100
- "checkConstraints": {},
2101
- "isRLSEnabled": false
2102
- },
2103
- "public.issue_comments": {
2104
- "name": "issue_comments",
2105
- "schema": "",
2106
- "columns": {
2107
- "id": {
2108
- "name": "id",
2109
- "type": "uuid",
2110
- "primaryKey": true,
2111
- "notNull": true,
2112
- "default": "gen_random_uuid()"
2113
- },
2114
- "company_id": {
2115
- "name": "company_id",
2116
- "type": "uuid",
2117
- "primaryKey": false,
2118
- "notNull": true
2119
- },
2120
- "issue_id": {
2121
- "name": "issue_id",
2122
- "type": "uuid",
2123
- "primaryKey": false,
2124
- "notNull": true
2125
- },
2126
- "author_agent_id": {
2127
- "name": "author_agent_id",
2128
- "type": "uuid",
2129
- "primaryKey": false,
2130
- "notNull": false
2131
- },
2132
- "author_user_id": {
2133
- "name": "author_user_id",
2134
- "type": "text",
2135
- "primaryKey": false,
2136
- "notNull": false
2137
- },
2138
- "body": {
2139
- "name": "body",
2140
- "type": "text",
2141
- "primaryKey": false,
2142
- "notNull": true
2143
- },
2144
- "created_at": {
2145
- "name": "created_at",
2146
- "type": "timestamp with time zone",
2147
- "primaryKey": false,
2148
- "notNull": true,
2149
- "default": "now()"
2150
- },
2151
- "updated_at": {
2152
- "name": "updated_at",
2153
- "type": "timestamp with time zone",
2154
- "primaryKey": false,
2155
- "notNull": true,
2156
- "default": "now()"
2157
- }
2158
- },
2159
- "indexes": {
2160
- "issue_comments_issue_idx": {
2161
- "name": "issue_comments_issue_idx",
2162
- "columns": [
2163
- {
2164
- "expression": "issue_id",
2165
- "isExpression": false,
2166
- "asc": true,
2167
- "nulls": "last"
2168
- }
2169
- ],
2170
- "isUnique": false,
2171
- "concurrently": false,
2172
- "method": "btree",
2173
- "with": {}
2174
- },
2175
- "issue_comments_company_idx": {
2176
- "name": "issue_comments_company_idx",
2177
- "columns": [
2178
- {
2179
- "expression": "company_id",
2180
- "isExpression": false,
2181
- "asc": true,
2182
- "nulls": "last"
2183
- }
2184
- ],
2185
- "isUnique": false,
2186
- "concurrently": false,
2187
- "method": "btree",
2188
- "with": {}
2189
- }
2190
- },
2191
- "foreignKeys": {
2192
- "issue_comments_company_id_companies_id_fk": {
2193
- "name": "issue_comments_company_id_companies_id_fk",
2194
- "tableFrom": "issue_comments",
2195
- "tableTo": "companies",
2196
- "columnsFrom": [
2197
- "company_id"
2198
- ],
2199
- "columnsTo": [
2200
- "id"
2201
- ],
2202
- "onDelete": "no action",
2203
- "onUpdate": "no action"
2204
- },
2205
- "issue_comments_issue_id_issues_id_fk": {
2206
- "name": "issue_comments_issue_id_issues_id_fk",
2207
- "tableFrom": "issue_comments",
2208
- "tableTo": "issues",
2209
- "columnsFrom": [
2210
- "issue_id"
2211
- ],
2212
- "columnsTo": [
2213
- "id"
2214
- ],
2215
- "onDelete": "no action",
2216
- "onUpdate": "no action"
2217
- },
2218
- "issue_comments_author_agent_id_agents_id_fk": {
2219
- "name": "issue_comments_author_agent_id_agents_id_fk",
2220
- "tableFrom": "issue_comments",
2221
- "tableTo": "agents",
2222
- "columnsFrom": [
2223
- "author_agent_id"
2224
- ],
2225
- "columnsTo": [
2226
- "id"
2227
- ],
2228
- "onDelete": "no action",
2229
- "onUpdate": "no action"
2230
- }
2231
- },
2232
- "compositePrimaryKeys": {},
2233
- "uniqueConstraints": {},
2234
- "policies": {},
2235
- "checkConstraints": {},
2236
- "isRLSEnabled": false
2237
- },
2238
- "public.issues": {
2239
- "name": "issues",
2240
- "schema": "",
2241
- "columns": {
2242
- "id": {
2243
- "name": "id",
2244
- "type": "uuid",
2245
- "primaryKey": true,
2246
- "notNull": true,
2247
- "default": "gen_random_uuid()"
2248
- },
2249
- "company_id": {
2250
- "name": "company_id",
2251
- "type": "uuid",
2252
- "primaryKey": false,
2253
- "notNull": true
2254
- },
2255
- "project_id": {
2256
- "name": "project_id",
2257
- "type": "uuid",
2258
- "primaryKey": false,
2259
- "notNull": false
2260
- },
2261
- "goal_id": {
2262
- "name": "goal_id",
2263
- "type": "uuid",
2264
- "primaryKey": false,
2265
- "notNull": false
2266
- },
2267
- "parent_id": {
2268
- "name": "parent_id",
2269
- "type": "uuid",
2270
- "primaryKey": false,
2271
- "notNull": false
2272
- },
2273
- "title": {
2274
- "name": "title",
2275
- "type": "text",
2276
- "primaryKey": false,
2277
- "notNull": true
2278
- },
2279
- "description": {
2280
- "name": "description",
2281
- "type": "text",
2282
- "primaryKey": false,
2283
- "notNull": false
2284
- },
2285
- "status": {
2286
- "name": "status",
2287
- "type": "text",
2288
- "primaryKey": false,
2289
- "notNull": true,
2290
- "default": "'backlog'"
2291
- },
2292
- "priority": {
2293
- "name": "priority",
2294
- "type": "text",
2295
- "primaryKey": false,
2296
- "notNull": true,
2297
- "default": "'medium'"
2298
- },
2299
- "assignee_agent_id": {
2300
- "name": "assignee_agent_id",
2301
- "type": "uuid",
2302
- "primaryKey": false,
2303
- "notNull": false
2304
- },
2305
- "created_by_agent_id": {
2306
- "name": "created_by_agent_id",
2307
- "type": "uuid",
2308
- "primaryKey": false,
2309
- "notNull": false
2310
- },
2311
- "created_by_user_id": {
2312
- "name": "created_by_user_id",
2313
- "type": "text",
2314
- "primaryKey": false,
2315
- "notNull": false
2316
- },
2317
- "issue_number": {
2318
- "name": "issue_number",
2319
- "type": "integer",
2320
- "primaryKey": false,
2321
- "notNull": false
2322
- },
2323
- "identifier": {
2324
- "name": "identifier",
2325
- "type": "text",
2326
- "primaryKey": false,
2327
- "notNull": false
2328
- },
2329
- "request_depth": {
2330
- "name": "request_depth",
2331
- "type": "integer",
2332
- "primaryKey": false,
2333
- "notNull": true,
2334
- "default": 0
2335
- },
2336
- "billing_code": {
2337
- "name": "billing_code",
2338
- "type": "text",
2339
- "primaryKey": false,
2340
- "notNull": false
2341
- },
2342
- "started_at": {
2343
- "name": "started_at",
2344
- "type": "timestamp with time zone",
2345
- "primaryKey": false,
2346
- "notNull": false
2347
- },
2348
- "completed_at": {
2349
- "name": "completed_at",
2350
- "type": "timestamp with time zone",
2351
- "primaryKey": false,
2352
- "notNull": false
2353
- },
2354
- "cancelled_at": {
2355
- "name": "cancelled_at",
2356
- "type": "timestamp with time zone",
2357
- "primaryKey": false,
2358
- "notNull": false
2359
- },
2360
- "created_at": {
2361
- "name": "created_at",
2362
- "type": "timestamp with time zone",
2363
- "primaryKey": false,
2364
- "notNull": true,
2365
- "default": "now()"
2366
- },
2367
- "updated_at": {
2368
- "name": "updated_at",
2369
- "type": "timestamp with time zone",
2370
- "primaryKey": false,
2371
- "notNull": true,
2372
- "default": "now()"
2373
- }
2374
- },
2375
- "indexes": {
2376
- "issues_company_status_idx": {
2377
- "name": "issues_company_status_idx",
2378
- "columns": [
2379
- {
2380
- "expression": "company_id",
2381
- "isExpression": false,
2382
- "asc": true,
2383
- "nulls": "last"
2384
- },
2385
- {
2386
- "expression": "status",
2387
- "isExpression": false,
2388
- "asc": true,
2389
- "nulls": "last"
2390
- }
2391
- ],
2392
- "isUnique": false,
2393
- "concurrently": false,
2394
- "method": "btree",
2395
- "with": {}
2396
- },
2397
- "issues_company_assignee_status_idx": {
2398
- "name": "issues_company_assignee_status_idx",
2399
- "columns": [
2400
- {
2401
- "expression": "company_id",
2402
- "isExpression": false,
2403
- "asc": true,
2404
- "nulls": "last"
2405
- },
2406
- {
2407
- "expression": "assignee_agent_id",
2408
- "isExpression": false,
2409
- "asc": true,
2410
- "nulls": "last"
2411
- },
2412
- {
2413
- "expression": "status",
2414
- "isExpression": false,
2415
- "asc": true,
2416
- "nulls": "last"
2417
- }
2418
- ],
2419
- "isUnique": false,
2420
- "concurrently": false,
2421
- "method": "btree",
2422
- "with": {}
2423
- },
2424
- "issues_company_parent_idx": {
2425
- "name": "issues_company_parent_idx",
2426
- "columns": [
2427
- {
2428
- "expression": "company_id",
2429
- "isExpression": false,
2430
- "asc": true,
2431
- "nulls": "last"
2432
- },
2433
- {
2434
- "expression": "parent_id",
2435
- "isExpression": false,
2436
- "asc": true,
2437
- "nulls": "last"
2438
- }
2439
- ],
2440
- "isUnique": false,
2441
- "concurrently": false,
2442
- "method": "btree",
2443
- "with": {}
2444
- },
2445
- "issues_company_project_idx": {
2446
- "name": "issues_company_project_idx",
2447
- "columns": [
2448
- {
2449
- "expression": "company_id",
2450
- "isExpression": false,
2451
- "asc": true,
2452
- "nulls": "last"
2453
- },
2454
- {
2455
- "expression": "project_id",
2456
- "isExpression": false,
2457
- "asc": true,
2458
- "nulls": "last"
2459
- }
2460
- ],
2461
- "isUnique": false,
2462
- "concurrently": false,
2463
- "method": "btree",
2464
- "with": {}
2465
- },
2466
- "issues_company_identifier_idx": {
2467
- "name": "issues_company_identifier_idx",
2468
- "columns": [
2469
- {
2470
- "expression": "company_id",
2471
- "isExpression": false,
2472
- "asc": true,
2473
- "nulls": "last"
2474
- },
2475
- {
2476
- "expression": "identifier",
2477
- "isExpression": false,
2478
- "asc": true,
2479
- "nulls": "last"
2480
- }
2481
- ],
2482
- "isUnique": true,
2483
- "concurrently": false,
2484
- "method": "btree",
2485
- "with": {}
2486
- }
2487
- },
2488
- "foreignKeys": {
2489
- "issues_company_id_companies_id_fk": {
2490
- "name": "issues_company_id_companies_id_fk",
2491
- "tableFrom": "issues",
2492
- "tableTo": "companies",
2493
- "columnsFrom": [
2494
- "company_id"
2495
- ],
2496
- "columnsTo": [
2497
- "id"
2498
- ],
2499
- "onDelete": "no action",
2500
- "onUpdate": "no action"
2501
- },
2502
- "issues_project_id_projects_id_fk": {
2503
- "name": "issues_project_id_projects_id_fk",
2504
- "tableFrom": "issues",
2505
- "tableTo": "projects",
2506
- "columnsFrom": [
2507
- "project_id"
2508
- ],
2509
- "columnsTo": [
2510
- "id"
2511
- ],
2512
- "onDelete": "no action",
2513
- "onUpdate": "no action"
2514
- },
2515
- "issues_goal_id_goals_id_fk": {
2516
- "name": "issues_goal_id_goals_id_fk",
2517
- "tableFrom": "issues",
2518
- "tableTo": "goals",
2519
- "columnsFrom": [
2520
- "goal_id"
2521
- ],
2522
- "columnsTo": [
2523
- "id"
2524
- ],
2525
- "onDelete": "no action",
2526
- "onUpdate": "no action"
2527
- },
2528
- "issues_parent_id_issues_id_fk": {
2529
- "name": "issues_parent_id_issues_id_fk",
2530
- "tableFrom": "issues",
2531
- "tableTo": "issues",
2532
- "columnsFrom": [
2533
- "parent_id"
2534
- ],
2535
- "columnsTo": [
2536
- "id"
2537
- ],
2538
- "onDelete": "no action",
2539
- "onUpdate": "no action"
2540
- },
2541
- "issues_assignee_agent_id_agents_id_fk": {
2542
- "name": "issues_assignee_agent_id_agents_id_fk",
2543
- "tableFrom": "issues",
2544
- "tableTo": "agents",
2545
- "columnsFrom": [
2546
- "assignee_agent_id"
2547
- ],
2548
- "columnsTo": [
2549
- "id"
2550
- ],
2551
- "onDelete": "no action",
2552
- "onUpdate": "no action"
2553
- },
2554
- "issues_created_by_agent_id_agents_id_fk": {
2555
- "name": "issues_created_by_agent_id_agents_id_fk",
2556
- "tableFrom": "issues",
2557
- "tableTo": "agents",
2558
- "columnsFrom": [
2559
- "created_by_agent_id"
2560
- ],
2561
- "columnsTo": [
2562
- "id"
2563
- ],
2564
- "onDelete": "no action",
2565
- "onUpdate": "no action"
2566
- }
2567
- },
2568
- "compositePrimaryKeys": {},
2569
- "uniqueConstraints": {},
2570
- "policies": {},
2571
- "checkConstraints": {},
2572
- "isRLSEnabled": false
2573
- },
2574
- "public.projects": {
2575
- "name": "projects",
2576
- "schema": "",
2577
- "columns": {
2578
- "id": {
2579
- "name": "id",
2580
- "type": "uuid",
2581
- "primaryKey": true,
2582
- "notNull": true,
2583
- "default": "gen_random_uuid()"
2584
- },
2585
- "company_id": {
2586
- "name": "company_id",
2587
- "type": "uuid",
2588
- "primaryKey": false,
2589
- "notNull": true
2590
- },
2591
- "goal_id": {
2592
- "name": "goal_id",
2593
- "type": "uuid",
2594
- "primaryKey": false,
2595
- "notNull": false
2596
- },
2597
- "name": {
2598
- "name": "name",
2599
- "type": "text",
2600
- "primaryKey": false,
2601
- "notNull": true
2602
- },
2603
- "description": {
2604
- "name": "description",
2605
- "type": "text",
2606
- "primaryKey": false,
2607
- "notNull": false
2608
- },
2609
- "status": {
2610
- "name": "status",
2611
- "type": "text",
2612
- "primaryKey": false,
2613
- "notNull": true,
2614
- "default": "'backlog'"
2615
- },
2616
- "lead_agent_id": {
2617
- "name": "lead_agent_id",
2618
- "type": "uuid",
2619
- "primaryKey": false,
2620
- "notNull": false
2621
- },
2622
- "target_date": {
2623
- "name": "target_date",
2624
- "type": "date",
2625
- "primaryKey": false,
2626
- "notNull": false
2627
- },
2628
- "created_at": {
2629
- "name": "created_at",
2630
- "type": "timestamp with time zone",
2631
- "primaryKey": false,
2632
- "notNull": true,
2633
- "default": "now()"
2634
- },
2635
- "updated_at": {
2636
- "name": "updated_at",
2637
- "type": "timestamp with time zone",
2638
- "primaryKey": false,
2639
- "notNull": true,
2640
- "default": "now()"
2641
- }
2642
- },
2643
- "indexes": {
2644
- "projects_company_idx": {
2645
- "name": "projects_company_idx",
2646
- "columns": [
2647
- {
2648
- "expression": "company_id",
2649
- "isExpression": false,
2650
- "asc": true,
2651
- "nulls": "last"
2652
- }
2653
- ],
2654
- "isUnique": false,
2655
- "concurrently": false,
2656
- "method": "btree",
2657
- "with": {}
2658
- }
2659
- },
2660
- "foreignKeys": {
2661
- "projects_company_id_companies_id_fk": {
2662
- "name": "projects_company_id_companies_id_fk",
2663
- "tableFrom": "projects",
2664
- "tableTo": "companies",
2665
- "columnsFrom": [
2666
- "company_id"
2667
- ],
2668
- "columnsTo": [
2669
- "id"
2670
- ],
2671
- "onDelete": "no action",
2672
- "onUpdate": "no action"
2673
- },
2674
- "projects_goal_id_goals_id_fk": {
2675
- "name": "projects_goal_id_goals_id_fk",
2676
- "tableFrom": "projects",
2677
- "tableTo": "goals",
2678
- "columnsFrom": [
2679
- "goal_id"
2680
- ],
2681
- "columnsTo": [
2682
- "id"
2683
- ],
2684
- "onDelete": "no action",
2685
- "onUpdate": "no action"
2686
- },
2687
- "projects_lead_agent_id_agents_id_fk": {
2688
- "name": "projects_lead_agent_id_agents_id_fk",
2689
- "tableFrom": "projects",
2690
- "tableTo": "agents",
2691
- "columnsFrom": [
2692
- "lead_agent_id"
2693
- ],
2694
- "columnsTo": [
2695
- "id"
2696
- ],
2697
- "onDelete": "no action",
2698
- "onUpdate": "no action"
2699
- }
2700
- },
2701
- "compositePrimaryKeys": {},
2702
- "uniqueConstraints": {},
2703
- "policies": {},
2704
- "checkConstraints": {},
2705
- "isRLSEnabled": false
2706
- }
2707
- },
2708
- "enums": {},
2709
- "schemas": {},
2710
- "sequences": {},
2711
- "roles": {},
2712
- "policies": {},
2713
- "views": {},
2714
- "_meta": {
2715
- "columns": {},
2716
- "schemas": {},
2717
- "tables": {}
2718
- }
2719
- }