@alvax-ai/db 0.1.0

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