@paperclipai/db 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/migrations/0000_mature_masked_marvel.sql +208 -0
  2. package/dist/migrations/0001_fast_northstar.sql +87 -0
  3. package/dist/migrations/0002_big_zaladane.sql +1 -0
  4. package/dist/migrations/0003_shallow_quentin_quire.sql +5 -0
  5. package/dist/migrations/0004_issue_identifiers.sql +28 -0
  6. package/dist/migrations/0005_chief_luke_cage.sql +19 -0
  7. package/dist/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  8. package/dist/migrations/0007_new_quentin_quire.sql +20 -0
  9. package/dist/migrations/0008_amused_zzzax.sql +1 -0
  10. package/dist/migrations/0009_fast_jackal.sql +36 -0
  11. package/dist/migrations/0010_stale_justin_hammer.sql +37 -0
  12. package/dist/migrations/0011_windy_corsair.sql +18 -0
  13. package/dist/migrations/0012_perpetual_ser_duncan.sql +2 -0
  14. package/dist/migrations/0013_dashing_wasp.sql +4 -0
  15. package/dist/migrations/0014_many_mikhail_rasputin.sql +135 -0
  16. package/dist/migrations/0015_project_color_archived.sql +2 -0
  17. package/dist/migrations/0016_agent_icon.sql +1 -0
  18. package/dist/migrations/0017_tiresome_gabe_jones.sql +51 -0
  19. package/dist/migrations/0018_flat_sleepwalker.sql +26 -0
  20. package/dist/migrations/0019_public_victor_mancha.sql +18 -0
  21. package/dist/migrations/0020_white_anita_blake.sql +1 -0
  22. package/dist/migrations/0021_chief_vindicator.sql +1 -0
  23. package/dist/migrations/0022_company_brand_color.sql +1 -0
  24. package/dist/migrations/0023_fair_lethal_legion.sql +3 -0
  25. package/dist/migrations/meta/0000_snapshot.json +1743 -0
  26. package/dist/migrations/meta/0001_snapshot.json +2441 -0
  27. package/dist/migrations/meta/0002_snapshot.json +2454 -0
  28. package/dist/migrations/meta/0003_snapshot.json +2502 -0
  29. package/dist/migrations/meta/0005_snapshot.json +2719 -0
  30. package/dist/migrations/meta/0006_snapshot.json +3048 -0
  31. package/dist/migrations/meta/0007_snapshot.json +3258 -0
  32. package/dist/migrations/meta/0008_snapshot.json +3264 -0
  33. package/dist/migrations/meta/0009_snapshot.json +3587 -0
  34. package/dist/migrations/meta/0010_snapshot.json +3929 -0
  35. package/dist/migrations/meta/0011_snapshot.json +4068 -0
  36. package/dist/migrations/meta/0012_snapshot.json +4087 -0
  37. package/dist/migrations/meta/0013_snapshot.json +4118 -0
  38. package/dist/migrations/meta/0014_snapshot.json +5187 -0
  39. package/dist/migrations/meta/0017_snapshot.json +5215 -0
  40. package/dist/migrations/meta/0018_snapshot.json +5450 -0
  41. package/dist/migrations/meta/0019_snapshot.json +5603 -0
  42. package/dist/migrations/meta/0020_snapshot.json +5603 -0
  43. package/dist/migrations/meta/0021_snapshot.json +5609 -0
  44. package/dist/migrations/meta/0023_snapshot.json +5633 -0
  45. package/dist/migrations/meta/_journal.json +174 -0
  46. package/dist/migrations/migrations/0000_mature_masked_marvel.sql +208 -0
  47. package/dist/migrations/migrations/0001_fast_northstar.sql +87 -0
  48. package/dist/migrations/migrations/0002_big_zaladane.sql +1 -0
  49. package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +5 -0
  50. package/dist/migrations/migrations/0004_issue_identifiers.sql +28 -0
  51. package/dist/migrations/migrations/0005_chief_luke_cage.sql +19 -0
  52. package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  53. package/dist/migrations/migrations/0007_new_quentin_quire.sql +20 -0
  54. package/dist/migrations/migrations/0008_amused_zzzax.sql +1 -0
  55. package/dist/migrations/migrations/0009_fast_jackal.sql +36 -0
  56. package/dist/migrations/migrations/0010_stale_justin_hammer.sql +37 -0
  57. package/dist/migrations/migrations/0011_windy_corsair.sql +18 -0
  58. package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +2 -0
  59. package/dist/migrations/migrations/0013_dashing_wasp.sql +4 -0
  60. package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +135 -0
  61. package/dist/migrations/migrations/0015_project_color_archived.sql +2 -0
  62. package/dist/migrations/migrations/0016_agent_icon.sql +1 -0
  63. package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +51 -0
  64. package/dist/migrations/migrations/0018_flat_sleepwalker.sql +26 -0
  65. package/dist/migrations/migrations/0019_public_victor_mancha.sql +18 -0
  66. package/dist/migrations/migrations/0020_white_anita_blake.sql +1 -0
  67. package/dist/migrations/migrations/0021_chief_vindicator.sql +1 -0
  68. package/dist/migrations/migrations/0022_company_brand_color.sql +1 -0
  69. package/dist/migrations/migrations/0023_fair_lethal_legion.sql +3 -0
  70. package/dist/migrations/migrations/meta/0000_snapshot.json +1743 -0
  71. package/dist/migrations/migrations/meta/0001_snapshot.json +2441 -0
  72. package/dist/migrations/migrations/meta/0002_snapshot.json +2454 -0
  73. package/dist/migrations/migrations/meta/0003_snapshot.json +2502 -0
  74. package/dist/migrations/migrations/meta/0005_snapshot.json +2719 -0
  75. package/dist/migrations/migrations/meta/0006_snapshot.json +3048 -0
  76. package/dist/migrations/migrations/meta/0007_snapshot.json +3258 -0
  77. package/dist/migrations/migrations/meta/0008_snapshot.json +3264 -0
  78. package/dist/migrations/migrations/meta/0009_snapshot.json +3587 -0
  79. package/dist/migrations/migrations/meta/0010_snapshot.json +3929 -0
  80. package/dist/migrations/migrations/meta/0011_snapshot.json +4068 -0
  81. package/dist/migrations/migrations/meta/0012_snapshot.json +4087 -0
  82. package/dist/migrations/migrations/meta/0013_snapshot.json +4118 -0
  83. package/dist/migrations/migrations/meta/0014_snapshot.json +5187 -0
  84. package/dist/migrations/migrations/meta/0017_snapshot.json +5215 -0
  85. package/dist/migrations/migrations/meta/0018_snapshot.json +5450 -0
  86. package/dist/migrations/migrations/meta/0019_snapshot.json +5603 -0
  87. package/dist/migrations/migrations/meta/0020_snapshot.json +5603 -0
  88. package/dist/migrations/migrations/meta/0021_snapshot.json +5609 -0
  89. package/dist/migrations/migrations/meta/0023_snapshot.json +5633 -0
  90. package/dist/migrations/migrations/meta/_journal.json +174 -0
  91. package/package.json +3 -3
@@ -0,0 +1,1743 @@
1
+ {
2
+ "id": "ff4290a9-e0a7-4405-8fa0-219a00a09f83",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
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
+ "details": {
62
+ "name": "details",
63
+ "type": "jsonb",
64
+ "primaryKey": false,
65
+ "notNull": false
66
+ },
67
+ "created_at": {
68
+ "name": "created_at",
69
+ "type": "timestamp with time zone",
70
+ "primaryKey": false,
71
+ "notNull": true,
72
+ "default": "now()"
73
+ }
74
+ },
75
+ "indexes": {
76
+ "activity_log_company_created_idx": {
77
+ "name": "activity_log_company_created_idx",
78
+ "columns": [
79
+ {
80
+ "expression": "company_id",
81
+ "isExpression": false,
82
+ "asc": true,
83
+ "nulls": "last"
84
+ },
85
+ {
86
+ "expression": "created_at",
87
+ "isExpression": false,
88
+ "asc": true,
89
+ "nulls": "last"
90
+ }
91
+ ],
92
+ "isUnique": false,
93
+ "concurrently": false,
94
+ "method": "btree",
95
+ "with": {}
96
+ }
97
+ },
98
+ "foreignKeys": {
99
+ "activity_log_company_id_companies_id_fk": {
100
+ "name": "activity_log_company_id_companies_id_fk",
101
+ "tableFrom": "activity_log",
102
+ "tableTo": "companies",
103
+ "columnsFrom": [
104
+ "company_id"
105
+ ],
106
+ "columnsTo": [
107
+ "id"
108
+ ],
109
+ "onDelete": "no action",
110
+ "onUpdate": "no action"
111
+ },
112
+ "activity_log_agent_id_agents_id_fk": {
113
+ "name": "activity_log_agent_id_agents_id_fk",
114
+ "tableFrom": "activity_log",
115
+ "tableTo": "agents",
116
+ "columnsFrom": [
117
+ "agent_id"
118
+ ],
119
+ "columnsTo": [
120
+ "id"
121
+ ],
122
+ "onDelete": "no action",
123
+ "onUpdate": "no action"
124
+ }
125
+ },
126
+ "compositePrimaryKeys": {},
127
+ "uniqueConstraints": {},
128
+ "policies": {},
129
+ "checkConstraints": {},
130
+ "isRLSEnabled": false
131
+ },
132
+ "public.agent_api_keys": {
133
+ "name": "agent_api_keys",
134
+ "schema": "",
135
+ "columns": {
136
+ "id": {
137
+ "name": "id",
138
+ "type": "uuid",
139
+ "primaryKey": true,
140
+ "notNull": true,
141
+ "default": "gen_random_uuid()"
142
+ },
143
+ "agent_id": {
144
+ "name": "agent_id",
145
+ "type": "uuid",
146
+ "primaryKey": false,
147
+ "notNull": true
148
+ },
149
+ "company_id": {
150
+ "name": "company_id",
151
+ "type": "uuid",
152
+ "primaryKey": false,
153
+ "notNull": true
154
+ },
155
+ "name": {
156
+ "name": "name",
157
+ "type": "text",
158
+ "primaryKey": false,
159
+ "notNull": true
160
+ },
161
+ "key_hash": {
162
+ "name": "key_hash",
163
+ "type": "text",
164
+ "primaryKey": false,
165
+ "notNull": true
166
+ },
167
+ "last_used_at": {
168
+ "name": "last_used_at",
169
+ "type": "timestamp with time zone",
170
+ "primaryKey": false,
171
+ "notNull": false
172
+ },
173
+ "revoked_at": {
174
+ "name": "revoked_at",
175
+ "type": "timestamp with time zone",
176
+ "primaryKey": false,
177
+ "notNull": false
178
+ },
179
+ "created_at": {
180
+ "name": "created_at",
181
+ "type": "timestamp with time zone",
182
+ "primaryKey": false,
183
+ "notNull": true,
184
+ "default": "now()"
185
+ }
186
+ },
187
+ "indexes": {
188
+ "agent_api_keys_key_hash_idx": {
189
+ "name": "agent_api_keys_key_hash_idx",
190
+ "columns": [
191
+ {
192
+ "expression": "key_hash",
193
+ "isExpression": false,
194
+ "asc": true,
195
+ "nulls": "last"
196
+ }
197
+ ],
198
+ "isUnique": false,
199
+ "concurrently": false,
200
+ "method": "btree",
201
+ "with": {}
202
+ },
203
+ "agent_api_keys_company_agent_idx": {
204
+ "name": "agent_api_keys_company_agent_idx",
205
+ "columns": [
206
+ {
207
+ "expression": "company_id",
208
+ "isExpression": false,
209
+ "asc": true,
210
+ "nulls": "last"
211
+ },
212
+ {
213
+ "expression": "agent_id",
214
+ "isExpression": false,
215
+ "asc": true,
216
+ "nulls": "last"
217
+ }
218
+ ],
219
+ "isUnique": false,
220
+ "concurrently": false,
221
+ "method": "btree",
222
+ "with": {}
223
+ }
224
+ },
225
+ "foreignKeys": {
226
+ "agent_api_keys_agent_id_agents_id_fk": {
227
+ "name": "agent_api_keys_agent_id_agents_id_fk",
228
+ "tableFrom": "agent_api_keys",
229
+ "tableTo": "agents",
230
+ "columnsFrom": [
231
+ "agent_id"
232
+ ],
233
+ "columnsTo": [
234
+ "id"
235
+ ],
236
+ "onDelete": "no action",
237
+ "onUpdate": "no action"
238
+ },
239
+ "agent_api_keys_company_id_companies_id_fk": {
240
+ "name": "agent_api_keys_company_id_companies_id_fk",
241
+ "tableFrom": "agent_api_keys",
242
+ "tableTo": "companies",
243
+ "columnsFrom": [
244
+ "company_id"
245
+ ],
246
+ "columnsTo": [
247
+ "id"
248
+ ],
249
+ "onDelete": "no action",
250
+ "onUpdate": "no action"
251
+ }
252
+ },
253
+ "compositePrimaryKeys": {},
254
+ "uniqueConstraints": {},
255
+ "policies": {},
256
+ "checkConstraints": {},
257
+ "isRLSEnabled": false
258
+ },
259
+ "public.agents": {
260
+ "name": "agents",
261
+ "schema": "",
262
+ "columns": {
263
+ "id": {
264
+ "name": "id",
265
+ "type": "uuid",
266
+ "primaryKey": true,
267
+ "notNull": true,
268
+ "default": "gen_random_uuid()"
269
+ },
270
+ "company_id": {
271
+ "name": "company_id",
272
+ "type": "uuid",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "name": {
277
+ "name": "name",
278
+ "type": "text",
279
+ "primaryKey": false,
280
+ "notNull": true
281
+ },
282
+ "role": {
283
+ "name": "role",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": true,
287
+ "default": "'general'"
288
+ },
289
+ "title": {
290
+ "name": "title",
291
+ "type": "text",
292
+ "primaryKey": false,
293
+ "notNull": false
294
+ },
295
+ "status": {
296
+ "name": "status",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": true,
300
+ "default": "'idle'"
301
+ },
302
+ "reports_to": {
303
+ "name": "reports_to",
304
+ "type": "uuid",
305
+ "primaryKey": false,
306
+ "notNull": false
307
+ },
308
+ "capabilities": {
309
+ "name": "capabilities",
310
+ "type": "text",
311
+ "primaryKey": false,
312
+ "notNull": false
313
+ },
314
+ "adapter_type": {
315
+ "name": "adapter_type",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true,
319
+ "default": "'process'"
320
+ },
321
+ "adapter_config": {
322
+ "name": "adapter_config",
323
+ "type": "jsonb",
324
+ "primaryKey": false,
325
+ "notNull": true,
326
+ "default": "'{}'::jsonb"
327
+ },
328
+ "context_mode": {
329
+ "name": "context_mode",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true,
333
+ "default": "'thin'"
334
+ },
335
+ "budget_monthly_cents": {
336
+ "name": "budget_monthly_cents",
337
+ "type": "integer",
338
+ "primaryKey": false,
339
+ "notNull": true,
340
+ "default": 0
341
+ },
342
+ "spent_monthly_cents": {
343
+ "name": "spent_monthly_cents",
344
+ "type": "integer",
345
+ "primaryKey": false,
346
+ "notNull": true,
347
+ "default": 0
348
+ },
349
+ "last_heartbeat_at": {
350
+ "name": "last_heartbeat_at",
351
+ "type": "timestamp with time zone",
352
+ "primaryKey": false,
353
+ "notNull": false
354
+ },
355
+ "metadata": {
356
+ "name": "metadata",
357
+ "type": "jsonb",
358
+ "primaryKey": false,
359
+ "notNull": false
360
+ },
361
+ "created_at": {
362
+ "name": "created_at",
363
+ "type": "timestamp with time zone",
364
+ "primaryKey": false,
365
+ "notNull": true,
366
+ "default": "now()"
367
+ },
368
+ "updated_at": {
369
+ "name": "updated_at",
370
+ "type": "timestamp with time zone",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "default": "now()"
374
+ }
375
+ },
376
+ "indexes": {
377
+ "agents_company_status_idx": {
378
+ "name": "agents_company_status_idx",
379
+ "columns": [
380
+ {
381
+ "expression": "company_id",
382
+ "isExpression": false,
383
+ "asc": true,
384
+ "nulls": "last"
385
+ },
386
+ {
387
+ "expression": "status",
388
+ "isExpression": false,
389
+ "asc": true,
390
+ "nulls": "last"
391
+ }
392
+ ],
393
+ "isUnique": false,
394
+ "concurrently": false,
395
+ "method": "btree",
396
+ "with": {}
397
+ },
398
+ "agents_company_reports_to_idx": {
399
+ "name": "agents_company_reports_to_idx",
400
+ "columns": [
401
+ {
402
+ "expression": "company_id",
403
+ "isExpression": false,
404
+ "asc": true,
405
+ "nulls": "last"
406
+ },
407
+ {
408
+ "expression": "reports_to",
409
+ "isExpression": false,
410
+ "asc": true,
411
+ "nulls": "last"
412
+ }
413
+ ],
414
+ "isUnique": false,
415
+ "concurrently": false,
416
+ "method": "btree",
417
+ "with": {}
418
+ }
419
+ },
420
+ "foreignKeys": {
421
+ "agents_company_id_companies_id_fk": {
422
+ "name": "agents_company_id_companies_id_fk",
423
+ "tableFrom": "agents",
424
+ "tableTo": "companies",
425
+ "columnsFrom": [
426
+ "company_id"
427
+ ],
428
+ "columnsTo": [
429
+ "id"
430
+ ],
431
+ "onDelete": "no action",
432
+ "onUpdate": "no action"
433
+ },
434
+ "agents_reports_to_agents_id_fk": {
435
+ "name": "agents_reports_to_agents_id_fk",
436
+ "tableFrom": "agents",
437
+ "tableTo": "agents",
438
+ "columnsFrom": [
439
+ "reports_to"
440
+ ],
441
+ "columnsTo": [
442
+ "id"
443
+ ],
444
+ "onDelete": "no action",
445
+ "onUpdate": "no action"
446
+ }
447
+ },
448
+ "compositePrimaryKeys": {},
449
+ "uniqueConstraints": {},
450
+ "policies": {},
451
+ "checkConstraints": {},
452
+ "isRLSEnabled": false
453
+ },
454
+ "public.approvals": {
455
+ "name": "approvals",
456
+ "schema": "",
457
+ "columns": {
458
+ "id": {
459
+ "name": "id",
460
+ "type": "uuid",
461
+ "primaryKey": true,
462
+ "notNull": true,
463
+ "default": "gen_random_uuid()"
464
+ },
465
+ "company_id": {
466
+ "name": "company_id",
467
+ "type": "uuid",
468
+ "primaryKey": false,
469
+ "notNull": true
470
+ },
471
+ "type": {
472
+ "name": "type",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": true
476
+ },
477
+ "requested_by_agent_id": {
478
+ "name": "requested_by_agent_id",
479
+ "type": "uuid",
480
+ "primaryKey": false,
481
+ "notNull": false
482
+ },
483
+ "requested_by_user_id": {
484
+ "name": "requested_by_user_id",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": false
488
+ },
489
+ "status": {
490
+ "name": "status",
491
+ "type": "text",
492
+ "primaryKey": false,
493
+ "notNull": true,
494
+ "default": "'pending'"
495
+ },
496
+ "payload": {
497
+ "name": "payload",
498
+ "type": "jsonb",
499
+ "primaryKey": false,
500
+ "notNull": true
501
+ },
502
+ "decision_note": {
503
+ "name": "decision_note",
504
+ "type": "text",
505
+ "primaryKey": false,
506
+ "notNull": false
507
+ },
508
+ "decided_by_user_id": {
509
+ "name": "decided_by_user_id",
510
+ "type": "text",
511
+ "primaryKey": false,
512
+ "notNull": false
513
+ },
514
+ "decided_at": {
515
+ "name": "decided_at",
516
+ "type": "timestamp with time zone",
517
+ "primaryKey": false,
518
+ "notNull": false
519
+ },
520
+ "created_at": {
521
+ "name": "created_at",
522
+ "type": "timestamp with time zone",
523
+ "primaryKey": false,
524
+ "notNull": true,
525
+ "default": "now()"
526
+ },
527
+ "updated_at": {
528
+ "name": "updated_at",
529
+ "type": "timestamp with time zone",
530
+ "primaryKey": false,
531
+ "notNull": true,
532
+ "default": "now()"
533
+ }
534
+ },
535
+ "indexes": {
536
+ "approvals_company_status_type_idx": {
537
+ "name": "approvals_company_status_type_idx",
538
+ "columns": [
539
+ {
540
+ "expression": "company_id",
541
+ "isExpression": false,
542
+ "asc": true,
543
+ "nulls": "last"
544
+ },
545
+ {
546
+ "expression": "status",
547
+ "isExpression": false,
548
+ "asc": true,
549
+ "nulls": "last"
550
+ },
551
+ {
552
+ "expression": "type",
553
+ "isExpression": false,
554
+ "asc": true,
555
+ "nulls": "last"
556
+ }
557
+ ],
558
+ "isUnique": false,
559
+ "concurrently": false,
560
+ "method": "btree",
561
+ "with": {}
562
+ }
563
+ },
564
+ "foreignKeys": {
565
+ "approvals_company_id_companies_id_fk": {
566
+ "name": "approvals_company_id_companies_id_fk",
567
+ "tableFrom": "approvals",
568
+ "tableTo": "companies",
569
+ "columnsFrom": [
570
+ "company_id"
571
+ ],
572
+ "columnsTo": [
573
+ "id"
574
+ ],
575
+ "onDelete": "no action",
576
+ "onUpdate": "no action"
577
+ },
578
+ "approvals_requested_by_agent_id_agents_id_fk": {
579
+ "name": "approvals_requested_by_agent_id_agents_id_fk",
580
+ "tableFrom": "approvals",
581
+ "tableTo": "agents",
582
+ "columnsFrom": [
583
+ "requested_by_agent_id"
584
+ ],
585
+ "columnsTo": [
586
+ "id"
587
+ ],
588
+ "onDelete": "no action",
589
+ "onUpdate": "no action"
590
+ }
591
+ },
592
+ "compositePrimaryKeys": {},
593
+ "uniqueConstraints": {},
594
+ "policies": {},
595
+ "checkConstraints": {},
596
+ "isRLSEnabled": false
597
+ },
598
+ "public.companies": {
599
+ "name": "companies",
600
+ "schema": "",
601
+ "columns": {
602
+ "id": {
603
+ "name": "id",
604
+ "type": "uuid",
605
+ "primaryKey": true,
606
+ "notNull": true,
607
+ "default": "gen_random_uuid()"
608
+ },
609
+ "name": {
610
+ "name": "name",
611
+ "type": "text",
612
+ "primaryKey": false,
613
+ "notNull": true
614
+ },
615
+ "description": {
616
+ "name": "description",
617
+ "type": "text",
618
+ "primaryKey": false,
619
+ "notNull": false
620
+ },
621
+ "status": {
622
+ "name": "status",
623
+ "type": "text",
624
+ "primaryKey": false,
625
+ "notNull": true,
626
+ "default": "'active'"
627
+ },
628
+ "budget_monthly_cents": {
629
+ "name": "budget_monthly_cents",
630
+ "type": "integer",
631
+ "primaryKey": false,
632
+ "notNull": true,
633
+ "default": 0
634
+ },
635
+ "spent_monthly_cents": {
636
+ "name": "spent_monthly_cents",
637
+ "type": "integer",
638
+ "primaryKey": false,
639
+ "notNull": true,
640
+ "default": 0
641
+ },
642
+ "created_at": {
643
+ "name": "created_at",
644
+ "type": "timestamp with time zone",
645
+ "primaryKey": false,
646
+ "notNull": true,
647
+ "default": "now()"
648
+ },
649
+ "updated_at": {
650
+ "name": "updated_at",
651
+ "type": "timestamp with time zone",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "default": "now()"
655
+ }
656
+ },
657
+ "indexes": {},
658
+ "foreignKeys": {},
659
+ "compositePrimaryKeys": {},
660
+ "uniqueConstraints": {},
661
+ "policies": {},
662
+ "checkConstraints": {},
663
+ "isRLSEnabled": false
664
+ },
665
+ "public.cost_events": {
666
+ "name": "cost_events",
667
+ "schema": "",
668
+ "columns": {
669
+ "id": {
670
+ "name": "id",
671
+ "type": "uuid",
672
+ "primaryKey": true,
673
+ "notNull": true,
674
+ "default": "gen_random_uuid()"
675
+ },
676
+ "company_id": {
677
+ "name": "company_id",
678
+ "type": "uuid",
679
+ "primaryKey": false,
680
+ "notNull": true
681
+ },
682
+ "agent_id": {
683
+ "name": "agent_id",
684
+ "type": "uuid",
685
+ "primaryKey": false,
686
+ "notNull": true
687
+ },
688
+ "issue_id": {
689
+ "name": "issue_id",
690
+ "type": "uuid",
691
+ "primaryKey": false,
692
+ "notNull": false
693
+ },
694
+ "project_id": {
695
+ "name": "project_id",
696
+ "type": "uuid",
697
+ "primaryKey": false,
698
+ "notNull": false
699
+ },
700
+ "goal_id": {
701
+ "name": "goal_id",
702
+ "type": "uuid",
703
+ "primaryKey": false,
704
+ "notNull": false
705
+ },
706
+ "billing_code": {
707
+ "name": "billing_code",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": false
711
+ },
712
+ "provider": {
713
+ "name": "provider",
714
+ "type": "text",
715
+ "primaryKey": false,
716
+ "notNull": true
717
+ },
718
+ "model": {
719
+ "name": "model",
720
+ "type": "text",
721
+ "primaryKey": false,
722
+ "notNull": true
723
+ },
724
+ "input_tokens": {
725
+ "name": "input_tokens",
726
+ "type": "integer",
727
+ "primaryKey": false,
728
+ "notNull": true,
729
+ "default": 0
730
+ },
731
+ "output_tokens": {
732
+ "name": "output_tokens",
733
+ "type": "integer",
734
+ "primaryKey": false,
735
+ "notNull": true,
736
+ "default": 0
737
+ },
738
+ "cost_cents": {
739
+ "name": "cost_cents",
740
+ "type": "integer",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "occurred_at": {
745
+ "name": "occurred_at",
746
+ "type": "timestamp with time zone",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "created_at": {
751
+ "name": "created_at",
752
+ "type": "timestamp with time zone",
753
+ "primaryKey": false,
754
+ "notNull": true,
755
+ "default": "now()"
756
+ }
757
+ },
758
+ "indexes": {
759
+ "cost_events_company_occurred_idx": {
760
+ "name": "cost_events_company_occurred_idx",
761
+ "columns": [
762
+ {
763
+ "expression": "company_id",
764
+ "isExpression": false,
765
+ "asc": true,
766
+ "nulls": "last"
767
+ },
768
+ {
769
+ "expression": "occurred_at",
770
+ "isExpression": false,
771
+ "asc": true,
772
+ "nulls": "last"
773
+ }
774
+ ],
775
+ "isUnique": false,
776
+ "concurrently": false,
777
+ "method": "btree",
778
+ "with": {}
779
+ },
780
+ "cost_events_company_agent_occurred_idx": {
781
+ "name": "cost_events_company_agent_occurred_idx",
782
+ "columns": [
783
+ {
784
+ "expression": "company_id",
785
+ "isExpression": false,
786
+ "asc": true,
787
+ "nulls": "last"
788
+ },
789
+ {
790
+ "expression": "agent_id",
791
+ "isExpression": false,
792
+ "asc": true,
793
+ "nulls": "last"
794
+ },
795
+ {
796
+ "expression": "occurred_at",
797
+ "isExpression": false,
798
+ "asc": true,
799
+ "nulls": "last"
800
+ }
801
+ ],
802
+ "isUnique": false,
803
+ "concurrently": false,
804
+ "method": "btree",
805
+ "with": {}
806
+ }
807
+ },
808
+ "foreignKeys": {
809
+ "cost_events_company_id_companies_id_fk": {
810
+ "name": "cost_events_company_id_companies_id_fk",
811
+ "tableFrom": "cost_events",
812
+ "tableTo": "companies",
813
+ "columnsFrom": [
814
+ "company_id"
815
+ ],
816
+ "columnsTo": [
817
+ "id"
818
+ ],
819
+ "onDelete": "no action",
820
+ "onUpdate": "no action"
821
+ },
822
+ "cost_events_agent_id_agents_id_fk": {
823
+ "name": "cost_events_agent_id_agents_id_fk",
824
+ "tableFrom": "cost_events",
825
+ "tableTo": "agents",
826
+ "columnsFrom": [
827
+ "agent_id"
828
+ ],
829
+ "columnsTo": [
830
+ "id"
831
+ ],
832
+ "onDelete": "no action",
833
+ "onUpdate": "no action"
834
+ },
835
+ "cost_events_issue_id_issues_id_fk": {
836
+ "name": "cost_events_issue_id_issues_id_fk",
837
+ "tableFrom": "cost_events",
838
+ "tableTo": "issues",
839
+ "columnsFrom": [
840
+ "issue_id"
841
+ ],
842
+ "columnsTo": [
843
+ "id"
844
+ ],
845
+ "onDelete": "no action",
846
+ "onUpdate": "no action"
847
+ },
848
+ "cost_events_project_id_projects_id_fk": {
849
+ "name": "cost_events_project_id_projects_id_fk",
850
+ "tableFrom": "cost_events",
851
+ "tableTo": "projects",
852
+ "columnsFrom": [
853
+ "project_id"
854
+ ],
855
+ "columnsTo": [
856
+ "id"
857
+ ],
858
+ "onDelete": "no action",
859
+ "onUpdate": "no action"
860
+ },
861
+ "cost_events_goal_id_goals_id_fk": {
862
+ "name": "cost_events_goal_id_goals_id_fk",
863
+ "tableFrom": "cost_events",
864
+ "tableTo": "goals",
865
+ "columnsFrom": [
866
+ "goal_id"
867
+ ],
868
+ "columnsTo": [
869
+ "id"
870
+ ],
871
+ "onDelete": "no action",
872
+ "onUpdate": "no action"
873
+ }
874
+ },
875
+ "compositePrimaryKeys": {},
876
+ "uniqueConstraints": {},
877
+ "policies": {},
878
+ "checkConstraints": {},
879
+ "isRLSEnabled": false
880
+ },
881
+ "public.goals": {
882
+ "name": "goals",
883
+ "schema": "",
884
+ "columns": {
885
+ "id": {
886
+ "name": "id",
887
+ "type": "uuid",
888
+ "primaryKey": true,
889
+ "notNull": true,
890
+ "default": "gen_random_uuid()"
891
+ },
892
+ "company_id": {
893
+ "name": "company_id",
894
+ "type": "uuid",
895
+ "primaryKey": false,
896
+ "notNull": true
897
+ },
898
+ "title": {
899
+ "name": "title",
900
+ "type": "text",
901
+ "primaryKey": false,
902
+ "notNull": true
903
+ },
904
+ "description": {
905
+ "name": "description",
906
+ "type": "text",
907
+ "primaryKey": false,
908
+ "notNull": false
909
+ },
910
+ "level": {
911
+ "name": "level",
912
+ "type": "text",
913
+ "primaryKey": false,
914
+ "notNull": true,
915
+ "default": "'task'"
916
+ },
917
+ "status": {
918
+ "name": "status",
919
+ "type": "text",
920
+ "primaryKey": false,
921
+ "notNull": true,
922
+ "default": "'planned'"
923
+ },
924
+ "parent_id": {
925
+ "name": "parent_id",
926
+ "type": "uuid",
927
+ "primaryKey": false,
928
+ "notNull": false
929
+ },
930
+ "owner_agent_id": {
931
+ "name": "owner_agent_id",
932
+ "type": "uuid",
933
+ "primaryKey": false,
934
+ "notNull": false
935
+ },
936
+ "created_at": {
937
+ "name": "created_at",
938
+ "type": "timestamp with time zone",
939
+ "primaryKey": false,
940
+ "notNull": true,
941
+ "default": "now()"
942
+ },
943
+ "updated_at": {
944
+ "name": "updated_at",
945
+ "type": "timestamp with time zone",
946
+ "primaryKey": false,
947
+ "notNull": true,
948
+ "default": "now()"
949
+ }
950
+ },
951
+ "indexes": {
952
+ "goals_company_idx": {
953
+ "name": "goals_company_idx",
954
+ "columns": [
955
+ {
956
+ "expression": "company_id",
957
+ "isExpression": false,
958
+ "asc": true,
959
+ "nulls": "last"
960
+ }
961
+ ],
962
+ "isUnique": false,
963
+ "concurrently": false,
964
+ "method": "btree",
965
+ "with": {}
966
+ }
967
+ },
968
+ "foreignKeys": {
969
+ "goals_company_id_companies_id_fk": {
970
+ "name": "goals_company_id_companies_id_fk",
971
+ "tableFrom": "goals",
972
+ "tableTo": "companies",
973
+ "columnsFrom": [
974
+ "company_id"
975
+ ],
976
+ "columnsTo": [
977
+ "id"
978
+ ],
979
+ "onDelete": "no action",
980
+ "onUpdate": "no action"
981
+ },
982
+ "goals_parent_id_goals_id_fk": {
983
+ "name": "goals_parent_id_goals_id_fk",
984
+ "tableFrom": "goals",
985
+ "tableTo": "goals",
986
+ "columnsFrom": [
987
+ "parent_id"
988
+ ],
989
+ "columnsTo": [
990
+ "id"
991
+ ],
992
+ "onDelete": "no action",
993
+ "onUpdate": "no action"
994
+ },
995
+ "goals_owner_agent_id_agents_id_fk": {
996
+ "name": "goals_owner_agent_id_agents_id_fk",
997
+ "tableFrom": "goals",
998
+ "tableTo": "agents",
999
+ "columnsFrom": [
1000
+ "owner_agent_id"
1001
+ ],
1002
+ "columnsTo": [
1003
+ "id"
1004
+ ],
1005
+ "onDelete": "no action",
1006
+ "onUpdate": "no action"
1007
+ }
1008
+ },
1009
+ "compositePrimaryKeys": {},
1010
+ "uniqueConstraints": {},
1011
+ "policies": {},
1012
+ "checkConstraints": {},
1013
+ "isRLSEnabled": false
1014
+ },
1015
+ "public.heartbeat_runs": {
1016
+ "name": "heartbeat_runs",
1017
+ "schema": "",
1018
+ "columns": {
1019
+ "id": {
1020
+ "name": "id",
1021
+ "type": "uuid",
1022
+ "primaryKey": true,
1023
+ "notNull": true,
1024
+ "default": "gen_random_uuid()"
1025
+ },
1026
+ "company_id": {
1027
+ "name": "company_id",
1028
+ "type": "uuid",
1029
+ "primaryKey": false,
1030
+ "notNull": true
1031
+ },
1032
+ "agent_id": {
1033
+ "name": "agent_id",
1034
+ "type": "uuid",
1035
+ "primaryKey": false,
1036
+ "notNull": true
1037
+ },
1038
+ "invocation_source": {
1039
+ "name": "invocation_source",
1040
+ "type": "text",
1041
+ "primaryKey": false,
1042
+ "notNull": true,
1043
+ "default": "'manual'"
1044
+ },
1045
+ "status": {
1046
+ "name": "status",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": true,
1050
+ "default": "'queued'"
1051
+ },
1052
+ "started_at": {
1053
+ "name": "started_at",
1054
+ "type": "timestamp with time zone",
1055
+ "primaryKey": false,
1056
+ "notNull": false
1057
+ },
1058
+ "finished_at": {
1059
+ "name": "finished_at",
1060
+ "type": "timestamp with time zone",
1061
+ "primaryKey": false,
1062
+ "notNull": false
1063
+ },
1064
+ "error": {
1065
+ "name": "error",
1066
+ "type": "text",
1067
+ "primaryKey": false,
1068
+ "notNull": false
1069
+ },
1070
+ "external_run_id": {
1071
+ "name": "external_run_id",
1072
+ "type": "text",
1073
+ "primaryKey": false,
1074
+ "notNull": false
1075
+ },
1076
+ "context_snapshot": {
1077
+ "name": "context_snapshot",
1078
+ "type": "jsonb",
1079
+ "primaryKey": false,
1080
+ "notNull": false
1081
+ },
1082
+ "created_at": {
1083
+ "name": "created_at",
1084
+ "type": "timestamp with time zone",
1085
+ "primaryKey": false,
1086
+ "notNull": true,
1087
+ "default": "now()"
1088
+ },
1089
+ "updated_at": {
1090
+ "name": "updated_at",
1091
+ "type": "timestamp with time zone",
1092
+ "primaryKey": false,
1093
+ "notNull": true,
1094
+ "default": "now()"
1095
+ }
1096
+ },
1097
+ "indexes": {
1098
+ "heartbeat_runs_company_agent_started_idx": {
1099
+ "name": "heartbeat_runs_company_agent_started_idx",
1100
+ "columns": [
1101
+ {
1102
+ "expression": "company_id",
1103
+ "isExpression": false,
1104
+ "asc": true,
1105
+ "nulls": "last"
1106
+ },
1107
+ {
1108
+ "expression": "agent_id",
1109
+ "isExpression": false,
1110
+ "asc": true,
1111
+ "nulls": "last"
1112
+ },
1113
+ {
1114
+ "expression": "started_at",
1115
+ "isExpression": false,
1116
+ "asc": true,
1117
+ "nulls": "last"
1118
+ }
1119
+ ],
1120
+ "isUnique": false,
1121
+ "concurrently": false,
1122
+ "method": "btree",
1123
+ "with": {}
1124
+ }
1125
+ },
1126
+ "foreignKeys": {
1127
+ "heartbeat_runs_company_id_companies_id_fk": {
1128
+ "name": "heartbeat_runs_company_id_companies_id_fk",
1129
+ "tableFrom": "heartbeat_runs",
1130
+ "tableTo": "companies",
1131
+ "columnsFrom": [
1132
+ "company_id"
1133
+ ],
1134
+ "columnsTo": [
1135
+ "id"
1136
+ ],
1137
+ "onDelete": "no action",
1138
+ "onUpdate": "no action"
1139
+ },
1140
+ "heartbeat_runs_agent_id_agents_id_fk": {
1141
+ "name": "heartbeat_runs_agent_id_agents_id_fk",
1142
+ "tableFrom": "heartbeat_runs",
1143
+ "tableTo": "agents",
1144
+ "columnsFrom": [
1145
+ "agent_id"
1146
+ ],
1147
+ "columnsTo": [
1148
+ "id"
1149
+ ],
1150
+ "onDelete": "no action",
1151
+ "onUpdate": "no action"
1152
+ }
1153
+ },
1154
+ "compositePrimaryKeys": {},
1155
+ "uniqueConstraints": {},
1156
+ "policies": {},
1157
+ "checkConstraints": {},
1158
+ "isRLSEnabled": false
1159
+ },
1160
+ "public.issue_comments": {
1161
+ "name": "issue_comments",
1162
+ "schema": "",
1163
+ "columns": {
1164
+ "id": {
1165
+ "name": "id",
1166
+ "type": "uuid",
1167
+ "primaryKey": true,
1168
+ "notNull": true,
1169
+ "default": "gen_random_uuid()"
1170
+ },
1171
+ "company_id": {
1172
+ "name": "company_id",
1173
+ "type": "uuid",
1174
+ "primaryKey": false,
1175
+ "notNull": true
1176
+ },
1177
+ "issue_id": {
1178
+ "name": "issue_id",
1179
+ "type": "uuid",
1180
+ "primaryKey": false,
1181
+ "notNull": true
1182
+ },
1183
+ "author_agent_id": {
1184
+ "name": "author_agent_id",
1185
+ "type": "uuid",
1186
+ "primaryKey": false,
1187
+ "notNull": false
1188
+ },
1189
+ "author_user_id": {
1190
+ "name": "author_user_id",
1191
+ "type": "text",
1192
+ "primaryKey": false,
1193
+ "notNull": false
1194
+ },
1195
+ "body": {
1196
+ "name": "body",
1197
+ "type": "text",
1198
+ "primaryKey": false,
1199
+ "notNull": true
1200
+ },
1201
+ "created_at": {
1202
+ "name": "created_at",
1203
+ "type": "timestamp with time zone",
1204
+ "primaryKey": false,
1205
+ "notNull": true,
1206
+ "default": "now()"
1207
+ },
1208
+ "updated_at": {
1209
+ "name": "updated_at",
1210
+ "type": "timestamp with time zone",
1211
+ "primaryKey": false,
1212
+ "notNull": true,
1213
+ "default": "now()"
1214
+ }
1215
+ },
1216
+ "indexes": {
1217
+ "issue_comments_issue_idx": {
1218
+ "name": "issue_comments_issue_idx",
1219
+ "columns": [
1220
+ {
1221
+ "expression": "issue_id",
1222
+ "isExpression": false,
1223
+ "asc": true,
1224
+ "nulls": "last"
1225
+ }
1226
+ ],
1227
+ "isUnique": false,
1228
+ "concurrently": false,
1229
+ "method": "btree",
1230
+ "with": {}
1231
+ },
1232
+ "issue_comments_company_idx": {
1233
+ "name": "issue_comments_company_idx",
1234
+ "columns": [
1235
+ {
1236
+ "expression": "company_id",
1237
+ "isExpression": false,
1238
+ "asc": true,
1239
+ "nulls": "last"
1240
+ }
1241
+ ],
1242
+ "isUnique": false,
1243
+ "concurrently": false,
1244
+ "method": "btree",
1245
+ "with": {}
1246
+ }
1247
+ },
1248
+ "foreignKeys": {
1249
+ "issue_comments_company_id_companies_id_fk": {
1250
+ "name": "issue_comments_company_id_companies_id_fk",
1251
+ "tableFrom": "issue_comments",
1252
+ "tableTo": "companies",
1253
+ "columnsFrom": [
1254
+ "company_id"
1255
+ ],
1256
+ "columnsTo": [
1257
+ "id"
1258
+ ],
1259
+ "onDelete": "no action",
1260
+ "onUpdate": "no action"
1261
+ },
1262
+ "issue_comments_issue_id_issues_id_fk": {
1263
+ "name": "issue_comments_issue_id_issues_id_fk",
1264
+ "tableFrom": "issue_comments",
1265
+ "tableTo": "issues",
1266
+ "columnsFrom": [
1267
+ "issue_id"
1268
+ ],
1269
+ "columnsTo": [
1270
+ "id"
1271
+ ],
1272
+ "onDelete": "no action",
1273
+ "onUpdate": "no action"
1274
+ },
1275
+ "issue_comments_author_agent_id_agents_id_fk": {
1276
+ "name": "issue_comments_author_agent_id_agents_id_fk",
1277
+ "tableFrom": "issue_comments",
1278
+ "tableTo": "agents",
1279
+ "columnsFrom": [
1280
+ "author_agent_id"
1281
+ ],
1282
+ "columnsTo": [
1283
+ "id"
1284
+ ],
1285
+ "onDelete": "no action",
1286
+ "onUpdate": "no action"
1287
+ }
1288
+ },
1289
+ "compositePrimaryKeys": {},
1290
+ "uniqueConstraints": {},
1291
+ "policies": {},
1292
+ "checkConstraints": {},
1293
+ "isRLSEnabled": false
1294
+ },
1295
+ "public.issues": {
1296
+ "name": "issues",
1297
+ "schema": "",
1298
+ "columns": {
1299
+ "id": {
1300
+ "name": "id",
1301
+ "type": "uuid",
1302
+ "primaryKey": true,
1303
+ "notNull": true,
1304
+ "default": "gen_random_uuid()"
1305
+ },
1306
+ "company_id": {
1307
+ "name": "company_id",
1308
+ "type": "uuid",
1309
+ "primaryKey": false,
1310
+ "notNull": true
1311
+ },
1312
+ "project_id": {
1313
+ "name": "project_id",
1314
+ "type": "uuid",
1315
+ "primaryKey": false,
1316
+ "notNull": false
1317
+ },
1318
+ "goal_id": {
1319
+ "name": "goal_id",
1320
+ "type": "uuid",
1321
+ "primaryKey": false,
1322
+ "notNull": false
1323
+ },
1324
+ "parent_id": {
1325
+ "name": "parent_id",
1326
+ "type": "uuid",
1327
+ "primaryKey": false,
1328
+ "notNull": false
1329
+ },
1330
+ "title": {
1331
+ "name": "title",
1332
+ "type": "text",
1333
+ "primaryKey": false,
1334
+ "notNull": true
1335
+ },
1336
+ "description": {
1337
+ "name": "description",
1338
+ "type": "text",
1339
+ "primaryKey": false,
1340
+ "notNull": false
1341
+ },
1342
+ "status": {
1343
+ "name": "status",
1344
+ "type": "text",
1345
+ "primaryKey": false,
1346
+ "notNull": true,
1347
+ "default": "'backlog'"
1348
+ },
1349
+ "priority": {
1350
+ "name": "priority",
1351
+ "type": "text",
1352
+ "primaryKey": false,
1353
+ "notNull": true,
1354
+ "default": "'medium'"
1355
+ },
1356
+ "assignee_agent_id": {
1357
+ "name": "assignee_agent_id",
1358
+ "type": "uuid",
1359
+ "primaryKey": false,
1360
+ "notNull": false
1361
+ },
1362
+ "created_by_agent_id": {
1363
+ "name": "created_by_agent_id",
1364
+ "type": "uuid",
1365
+ "primaryKey": false,
1366
+ "notNull": false
1367
+ },
1368
+ "created_by_user_id": {
1369
+ "name": "created_by_user_id",
1370
+ "type": "text",
1371
+ "primaryKey": false,
1372
+ "notNull": false
1373
+ },
1374
+ "request_depth": {
1375
+ "name": "request_depth",
1376
+ "type": "integer",
1377
+ "primaryKey": false,
1378
+ "notNull": true,
1379
+ "default": 0
1380
+ },
1381
+ "billing_code": {
1382
+ "name": "billing_code",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": false
1386
+ },
1387
+ "started_at": {
1388
+ "name": "started_at",
1389
+ "type": "timestamp with time zone",
1390
+ "primaryKey": false,
1391
+ "notNull": false
1392
+ },
1393
+ "completed_at": {
1394
+ "name": "completed_at",
1395
+ "type": "timestamp with time zone",
1396
+ "primaryKey": false,
1397
+ "notNull": false
1398
+ },
1399
+ "cancelled_at": {
1400
+ "name": "cancelled_at",
1401
+ "type": "timestamp with time zone",
1402
+ "primaryKey": false,
1403
+ "notNull": false
1404
+ },
1405
+ "created_at": {
1406
+ "name": "created_at",
1407
+ "type": "timestamp with time zone",
1408
+ "primaryKey": false,
1409
+ "notNull": true,
1410
+ "default": "now()"
1411
+ },
1412
+ "updated_at": {
1413
+ "name": "updated_at",
1414
+ "type": "timestamp with time zone",
1415
+ "primaryKey": false,
1416
+ "notNull": true,
1417
+ "default": "now()"
1418
+ }
1419
+ },
1420
+ "indexes": {
1421
+ "issues_company_status_idx": {
1422
+ "name": "issues_company_status_idx",
1423
+ "columns": [
1424
+ {
1425
+ "expression": "company_id",
1426
+ "isExpression": false,
1427
+ "asc": true,
1428
+ "nulls": "last"
1429
+ },
1430
+ {
1431
+ "expression": "status",
1432
+ "isExpression": false,
1433
+ "asc": true,
1434
+ "nulls": "last"
1435
+ }
1436
+ ],
1437
+ "isUnique": false,
1438
+ "concurrently": false,
1439
+ "method": "btree",
1440
+ "with": {}
1441
+ },
1442
+ "issues_company_assignee_status_idx": {
1443
+ "name": "issues_company_assignee_status_idx",
1444
+ "columns": [
1445
+ {
1446
+ "expression": "company_id",
1447
+ "isExpression": false,
1448
+ "asc": true,
1449
+ "nulls": "last"
1450
+ },
1451
+ {
1452
+ "expression": "assignee_agent_id",
1453
+ "isExpression": false,
1454
+ "asc": true,
1455
+ "nulls": "last"
1456
+ },
1457
+ {
1458
+ "expression": "status",
1459
+ "isExpression": false,
1460
+ "asc": true,
1461
+ "nulls": "last"
1462
+ }
1463
+ ],
1464
+ "isUnique": false,
1465
+ "concurrently": false,
1466
+ "method": "btree",
1467
+ "with": {}
1468
+ },
1469
+ "issues_company_parent_idx": {
1470
+ "name": "issues_company_parent_idx",
1471
+ "columns": [
1472
+ {
1473
+ "expression": "company_id",
1474
+ "isExpression": false,
1475
+ "asc": true,
1476
+ "nulls": "last"
1477
+ },
1478
+ {
1479
+ "expression": "parent_id",
1480
+ "isExpression": false,
1481
+ "asc": true,
1482
+ "nulls": "last"
1483
+ }
1484
+ ],
1485
+ "isUnique": false,
1486
+ "concurrently": false,
1487
+ "method": "btree",
1488
+ "with": {}
1489
+ },
1490
+ "issues_company_project_idx": {
1491
+ "name": "issues_company_project_idx",
1492
+ "columns": [
1493
+ {
1494
+ "expression": "company_id",
1495
+ "isExpression": false,
1496
+ "asc": true,
1497
+ "nulls": "last"
1498
+ },
1499
+ {
1500
+ "expression": "project_id",
1501
+ "isExpression": false,
1502
+ "asc": true,
1503
+ "nulls": "last"
1504
+ }
1505
+ ],
1506
+ "isUnique": false,
1507
+ "concurrently": false,
1508
+ "method": "btree",
1509
+ "with": {}
1510
+ }
1511
+ },
1512
+ "foreignKeys": {
1513
+ "issues_company_id_companies_id_fk": {
1514
+ "name": "issues_company_id_companies_id_fk",
1515
+ "tableFrom": "issues",
1516
+ "tableTo": "companies",
1517
+ "columnsFrom": [
1518
+ "company_id"
1519
+ ],
1520
+ "columnsTo": [
1521
+ "id"
1522
+ ],
1523
+ "onDelete": "no action",
1524
+ "onUpdate": "no action"
1525
+ },
1526
+ "issues_project_id_projects_id_fk": {
1527
+ "name": "issues_project_id_projects_id_fk",
1528
+ "tableFrom": "issues",
1529
+ "tableTo": "projects",
1530
+ "columnsFrom": [
1531
+ "project_id"
1532
+ ],
1533
+ "columnsTo": [
1534
+ "id"
1535
+ ],
1536
+ "onDelete": "no action",
1537
+ "onUpdate": "no action"
1538
+ },
1539
+ "issues_goal_id_goals_id_fk": {
1540
+ "name": "issues_goal_id_goals_id_fk",
1541
+ "tableFrom": "issues",
1542
+ "tableTo": "goals",
1543
+ "columnsFrom": [
1544
+ "goal_id"
1545
+ ],
1546
+ "columnsTo": [
1547
+ "id"
1548
+ ],
1549
+ "onDelete": "no action",
1550
+ "onUpdate": "no action"
1551
+ },
1552
+ "issues_parent_id_issues_id_fk": {
1553
+ "name": "issues_parent_id_issues_id_fk",
1554
+ "tableFrom": "issues",
1555
+ "tableTo": "issues",
1556
+ "columnsFrom": [
1557
+ "parent_id"
1558
+ ],
1559
+ "columnsTo": [
1560
+ "id"
1561
+ ],
1562
+ "onDelete": "no action",
1563
+ "onUpdate": "no action"
1564
+ },
1565
+ "issues_assignee_agent_id_agents_id_fk": {
1566
+ "name": "issues_assignee_agent_id_agents_id_fk",
1567
+ "tableFrom": "issues",
1568
+ "tableTo": "agents",
1569
+ "columnsFrom": [
1570
+ "assignee_agent_id"
1571
+ ],
1572
+ "columnsTo": [
1573
+ "id"
1574
+ ],
1575
+ "onDelete": "no action",
1576
+ "onUpdate": "no action"
1577
+ },
1578
+ "issues_created_by_agent_id_agents_id_fk": {
1579
+ "name": "issues_created_by_agent_id_agents_id_fk",
1580
+ "tableFrom": "issues",
1581
+ "tableTo": "agents",
1582
+ "columnsFrom": [
1583
+ "created_by_agent_id"
1584
+ ],
1585
+ "columnsTo": [
1586
+ "id"
1587
+ ],
1588
+ "onDelete": "no action",
1589
+ "onUpdate": "no action"
1590
+ }
1591
+ },
1592
+ "compositePrimaryKeys": {},
1593
+ "uniqueConstraints": {},
1594
+ "policies": {},
1595
+ "checkConstraints": {},
1596
+ "isRLSEnabled": false
1597
+ },
1598
+ "public.projects": {
1599
+ "name": "projects",
1600
+ "schema": "",
1601
+ "columns": {
1602
+ "id": {
1603
+ "name": "id",
1604
+ "type": "uuid",
1605
+ "primaryKey": true,
1606
+ "notNull": true,
1607
+ "default": "gen_random_uuid()"
1608
+ },
1609
+ "company_id": {
1610
+ "name": "company_id",
1611
+ "type": "uuid",
1612
+ "primaryKey": false,
1613
+ "notNull": true
1614
+ },
1615
+ "goal_id": {
1616
+ "name": "goal_id",
1617
+ "type": "uuid",
1618
+ "primaryKey": false,
1619
+ "notNull": false
1620
+ },
1621
+ "name": {
1622
+ "name": "name",
1623
+ "type": "text",
1624
+ "primaryKey": false,
1625
+ "notNull": true
1626
+ },
1627
+ "description": {
1628
+ "name": "description",
1629
+ "type": "text",
1630
+ "primaryKey": false,
1631
+ "notNull": false
1632
+ },
1633
+ "status": {
1634
+ "name": "status",
1635
+ "type": "text",
1636
+ "primaryKey": false,
1637
+ "notNull": true,
1638
+ "default": "'backlog'"
1639
+ },
1640
+ "lead_agent_id": {
1641
+ "name": "lead_agent_id",
1642
+ "type": "uuid",
1643
+ "primaryKey": false,
1644
+ "notNull": false
1645
+ },
1646
+ "target_date": {
1647
+ "name": "target_date",
1648
+ "type": "date",
1649
+ "primaryKey": false,
1650
+ "notNull": false
1651
+ },
1652
+ "created_at": {
1653
+ "name": "created_at",
1654
+ "type": "timestamp with time zone",
1655
+ "primaryKey": false,
1656
+ "notNull": true,
1657
+ "default": "now()"
1658
+ },
1659
+ "updated_at": {
1660
+ "name": "updated_at",
1661
+ "type": "timestamp with time zone",
1662
+ "primaryKey": false,
1663
+ "notNull": true,
1664
+ "default": "now()"
1665
+ }
1666
+ },
1667
+ "indexes": {
1668
+ "projects_company_idx": {
1669
+ "name": "projects_company_idx",
1670
+ "columns": [
1671
+ {
1672
+ "expression": "company_id",
1673
+ "isExpression": false,
1674
+ "asc": true,
1675
+ "nulls": "last"
1676
+ }
1677
+ ],
1678
+ "isUnique": false,
1679
+ "concurrently": false,
1680
+ "method": "btree",
1681
+ "with": {}
1682
+ }
1683
+ },
1684
+ "foreignKeys": {
1685
+ "projects_company_id_companies_id_fk": {
1686
+ "name": "projects_company_id_companies_id_fk",
1687
+ "tableFrom": "projects",
1688
+ "tableTo": "companies",
1689
+ "columnsFrom": [
1690
+ "company_id"
1691
+ ],
1692
+ "columnsTo": [
1693
+ "id"
1694
+ ],
1695
+ "onDelete": "no action",
1696
+ "onUpdate": "no action"
1697
+ },
1698
+ "projects_goal_id_goals_id_fk": {
1699
+ "name": "projects_goal_id_goals_id_fk",
1700
+ "tableFrom": "projects",
1701
+ "tableTo": "goals",
1702
+ "columnsFrom": [
1703
+ "goal_id"
1704
+ ],
1705
+ "columnsTo": [
1706
+ "id"
1707
+ ],
1708
+ "onDelete": "no action",
1709
+ "onUpdate": "no action"
1710
+ },
1711
+ "projects_lead_agent_id_agents_id_fk": {
1712
+ "name": "projects_lead_agent_id_agents_id_fk",
1713
+ "tableFrom": "projects",
1714
+ "tableTo": "agents",
1715
+ "columnsFrom": [
1716
+ "lead_agent_id"
1717
+ ],
1718
+ "columnsTo": [
1719
+ "id"
1720
+ ],
1721
+ "onDelete": "no action",
1722
+ "onUpdate": "no action"
1723
+ }
1724
+ },
1725
+ "compositePrimaryKeys": {},
1726
+ "uniqueConstraints": {},
1727
+ "policies": {},
1728
+ "checkConstraints": {},
1729
+ "isRLSEnabled": false
1730
+ }
1731
+ },
1732
+ "enums": {},
1733
+ "schemas": {},
1734
+ "sequences": {},
1735
+ "roles": {},
1736
+ "policies": {},
1737
+ "views": {},
1738
+ "_meta": {
1739
+ "columns": {},
1740
+ "schemas": {},
1741
+ "tables": {}
1742
+ }
1743
+ }