@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,3466 @@
1
+ {
2
+ "id": "a666d6cd-9dfc-401b-a66f-674219ebab28",
3
+ "prevId": "4eb936c3-79c7-476a-a9e8-96bf356fda31",
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.environments": {
958
+ "name": "environments",
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
+ "name": {
975
+ "name": "name",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": true
979
+ },
980
+ "description": {
981
+ "name": "description",
982
+ "type": "text",
983
+ "primaryKey": false,
984
+ "notNull": false
985
+ },
986
+ "driver": {
987
+ "name": "driver",
988
+ "type": "text",
989
+ "primaryKey": false,
990
+ "notNull": true,
991
+ "default": "'local'"
992
+ },
993
+ "status": {
994
+ "name": "status",
995
+ "type": "text",
996
+ "primaryKey": false,
997
+ "notNull": true,
998
+ "default": "'active'"
999
+ },
1000
+ "config": {
1001
+ "name": "config",
1002
+ "type": "jsonb",
1003
+ "primaryKey": false,
1004
+ "notNull": true,
1005
+ "default": "'{}'::jsonb"
1006
+ },
1007
+ "metadata": {
1008
+ "name": "metadata",
1009
+ "type": "jsonb",
1010
+ "primaryKey": false,
1011
+ "notNull": false
1012
+ },
1013
+ "created_at": {
1014
+ "name": "created_at",
1015
+ "type": "timestamp with time zone",
1016
+ "primaryKey": false,
1017
+ "notNull": true,
1018
+ "default": "now()"
1019
+ },
1020
+ "updated_at": {
1021
+ "name": "updated_at",
1022
+ "type": "timestamp with time zone",
1023
+ "primaryKey": false,
1024
+ "notNull": true,
1025
+ "default": "now()"
1026
+ }
1027
+ },
1028
+ "indexes": {
1029
+ "environments_company_status_idx": {
1030
+ "name": "environments_company_status_idx",
1031
+ "columns": [
1032
+ {
1033
+ "expression": "company_id",
1034
+ "isExpression": false,
1035
+ "asc": true,
1036
+ "nulls": "last"
1037
+ },
1038
+ {
1039
+ "expression": "status",
1040
+ "isExpression": false,
1041
+ "asc": true,
1042
+ "nulls": "last"
1043
+ }
1044
+ ],
1045
+ "isUnique": false,
1046
+ "concurrently": false,
1047
+ "method": "btree",
1048
+ "with": {}
1049
+ },
1050
+ "environments_company_driver_idx": {
1051
+ "name": "environments_company_driver_idx",
1052
+ "columns": [
1053
+ {
1054
+ "expression": "company_id",
1055
+ "isExpression": false,
1056
+ "asc": true,
1057
+ "nulls": "last"
1058
+ },
1059
+ {
1060
+ "expression": "driver",
1061
+ "isExpression": false,
1062
+ "asc": true,
1063
+ "nulls": "last"
1064
+ }
1065
+ ],
1066
+ "isUnique": true,
1067
+ "where": "\"environments\".\"driver\" = 'local'",
1068
+ "concurrently": false,
1069
+ "method": "btree",
1070
+ "with": {}
1071
+ },
1072
+ "environments_company_name_idx": {
1073
+ "name": "environments_company_name_idx",
1074
+ "columns": [
1075
+ {
1076
+ "expression": "company_id",
1077
+ "isExpression": false,
1078
+ "asc": true,
1079
+ "nulls": "last"
1080
+ },
1081
+ {
1082
+ "expression": "name",
1083
+ "isExpression": false,
1084
+ "asc": true,
1085
+ "nulls": "last"
1086
+ }
1087
+ ],
1088
+ "isUnique": false,
1089
+ "concurrently": false,
1090
+ "method": "btree",
1091
+ "with": {}
1092
+ }
1093
+ },
1094
+ "foreignKeys": {
1095
+ "environments_company_id_companies_id_fk": {
1096
+ "name": "environments_company_id_companies_id_fk",
1097
+ "tableFrom": "environments",
1098
+ "tableTo": "companies",
1099
+ "columnsFrom": [
1100
+ "company_id"
1101
+ ],
1102
+ "columnsTo": [
1103
+ "id"
1104
+ ],
1105
+ "onDelete": "cascade",
1106
+ "onUpdate": "no action"
1107
+ }
1108
+ },
1109
+ "compositePrimaryKeys": {},
1110
+ "uniqueConstraints": {},
1111
+ "policies": {},
1112
+ "checkConstraints": {},
1113
+ "isRLSEnabled": false
1114
+ },
1115
+ "public.heartbeat_run_events": {
1116
+ "name": "heartbeat_run_events",
1117
+ "schema": "",
1118
+ "columns": {
1119
+ "id": {
1120
+ "name": "id",
1121
+ "type": "bigserial",
1122
+ "primaryKey": true,
1123
+ "notNull": true
1124
+ },
1125
+ "company_id": {
1126
+ "name": "company_id",
1127
+ "type": "uuid",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "run_id": {
1132
+ "name": "run_id",
1133
+ "type": "uuid",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "agent_id": {
1138
+ "name": "agent_id",
1139
+ "type": "uuid",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "seq": {
1144
+ "name": "seq",
1145
+ "type": "integer",
1146
+ "primaryKey": false,
1147
+ "notNull": true
1148
+ },
1149
+ "event_type": {
1150
+ "name": "event_type",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": true
1154
+ },
1155
+ "stream": {
1156
+ "name": "stream",
1157
+ "type": "text",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "level": {
1162
+ "name": "level",
1163
+ "type": "text",
1164
+ "primaryKey": false,
1165
+ "notNull": false
1166
+ },
1167
+ "color": {
1168
+ "name": "color",
1169
+ "type": "text",
1170
+ "primaryKey": false,
1171
+ "notNull": false
1172
+ },
1173
+ "message": {
1174
+ "name": "message",
1175
+ "type": "text",
1176
+ "primaryKey": false,
1177
+ "notNull": false
1178
+ },
1179
+ "payload": {
1180
+ "name": "payload",
1181
+ "type": "jsonb",
1182
+ "primaryKey": false,
1183
+ "notNull": false
1184
+ },
1185
+ "created_at": {
1186
+ "name": "created_at",
1187
+ "type": "timestamp with time zone",
1188
+ "primaryKey": false,
1189
+ "notNull": true,
1190
+ "default": "now()"
1191
+ }
1192
+ },
1193
+ "indexes": {
1194
+ "heartbeat_run_events_run_seq_idx": {
1195
+ "name": "heartbeat_run_events_run_seq_idx",
1196
+ "columns": [
1197
+ {
1198
+ "expression": "run_id",
1199
+ "isExpression": false,
1200
+ "asc": true,
1201
+ "nulls": "last"
1202
+ },
1203
+ {
1204
+ "expression": "seq",
1205
+ "isExpression": false,
1206
+ "asc": true,
1207
+ "nulls": "last"
1208
+ }
1209
+ ],
1210
+ "isUnique": false,
1211
+ "concurrently": false,
1212
+ "method": "btree",
1213
+ "with": {}
1214
+ },
1215
+ "heartbeat_run_events_company_run_idx": {
1216
+ "name": "heartbeat_run_events_company_run_idx",
1217
+ "columns": [
1218
+ {
1219
+ "expression": "company_id",
1220
+ "isExpression": false,
1221
+ "asc": true,
1222
+ "nulls": "last"
1223
+ },
1224
+ {
1225
+ "expression": "run_id",
1226
+ "isExpression": false,
1227
+ "asc": true,
1228
+ "nulls": "last"
1229
+ }
1230
+ ],
1231
+ "isUnique": false,
1232
+ "concurrently": false,
1233
+ "method": "btree",
1234
+ "with": {}
1235
+ },
1236
+ "heartbeat_run_events_company_created_idx": {
1237
+ "name": "heartbeat_run_events_company_created_idx",
1238
+ "columns": [
1239
+ {
1240
+ "expression": "company_id",
1241
+ "isExpression": false,
1242
+ "asc": true,
1243
+ "nulls": "last"
1244
+ },
1245
+ {
1246
+ "expression": "created_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
+ },
1258
+ "foreignKeys": {
1259
+ "heartbeat_run_events_company_id_companies_id_fk": {
1260
+ "name": "heartbeat_run_events_company_id_companies_id_fk",
1261
+ "tableFrom": "heartbeat_run_events",
1262
+ "tableTo": "companies",
1263
+ "columnsFrom": [
1264
+ "company_id"
1265
+ ],
1266
+ "columnsTo": [
1267
+ "id"
1268
+ ],
1269
+ "onDelete": "no action",
1270
+ "onUpdate": "no action"
1271
+ },
1272
+ "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
1273
+ "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
1274
+ "tableFrom": "heartbeat_run_events",
1275
+ "tableTo": "heartbeat_runs",
1276
+ "columnsFrom": [
1277
+ "run_id"
1278
+ ],
1279
+ "columnsTo": [
1280
+ "id"
1281
+ ],
1282
+ "onDelete": "no action",
1283
+ "onUpdate": "no action"
1284
+ },
1285
+ "heartbeat_run_events_agent_id_agents_id_fk": {
1286
+ "name": "heartbeat_run_events_agent_id_agents_id_fk",
1287
+ "tableFrom": "heartbeat_run_events",
1288
+ "tableTo": "agents",
1289
+ "columnsFrom": [
1290
+ "agent_id"
1291
+ ],
1292
+ "columnsTo": [
1293
+ "id"
1294
+ ],
1295
+ "onDelete": "no action",
1296
+ "onUpdate": "no action"
1297
+ }
1298
+ },
1299
+ "compositePrimaryKeys": {},
1300
+ "uniqueConstraints": {},
1301
+ "policies": {},
1302
+ "checkConstraints": {},
1303
+ "isRLSEnabled": false
1304
+ },
1305
+ "public.heartbeat_runs": {
1306
+ "name": "heartbeat_runs",
1307
+ "schema": "",
1308
+ "columns": {
1309
+ "id": {
1310
+ "name": "id",
1311
+ "type": "uuid",
1312
+ "primaryKey": true,
1313
+ "notNull": true,
1314
+ "default": "gen_random_uuid()"
1315
+ },
1316
+ "company_id": {
1317
+ "name": "company_id",
1318
+ "type": "uuid",
1319
+ "primaryKey": false,
1320
+ "notNull": true
1321
+ },
1322
+ "agent_id": {
1323
+ "name": "agent_id",
1324
+ "type": "uuid",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "invocation_source": {
1329
+ "name": "invocation_source",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true,
1333
+ "default": "'on_demand'"
1334
+ },
1335
+ "trigger_detail": {
1336
+ "name": "trigger_detail",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "status": {
1342
+ "name": "status",
1343
+ "type": "text",
1344
+ "primaryKey": false,
1345
+ "notNull": true,
1346
+ "default": "'queued'"
1347
+ },
1348
+ "started_at": {
1349
+ "name": "started_at",
1350
+ "type": "timestamp with time zone",
1351
+ "primaryKey": false,
1352
+ "notNull": false
1353
+ },
1354
+ "finished_at": {
1355
+ "name": "finished_at",
1356
+ "type": "timestamp with time zone",
1357
+ "primaryKey": false,
1358
+ "notNull": false
1359
+ },
1360
+ "error": {
1361
+ "name": "error",
1362
+ "type": "text",
1363
+ "primaryKey": false,
1364
+ "notNull": false
1365
+ },
1366
+ "wakeup_request_id": {
1367
+ "name": "wakeup_request_id",
1368
+ "type": "uuid",
1369
+ "primaryKey": false,
1370
+ "notNull": false
1371
+ },
1372
+ "exit_code": {
1373
+ "name": "exit_code",
1374
+ "type": "integer",
1375
+ "primaryKey": false,
1376
+ "notNull": false
1377
+ },
1378
+ "signal": {
1379
+ "name": "signal",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": false
1383
+ },
1384
+ "usage_json": {
1385
+ "name": "usage_json",
1386
+ "type": "jsonb",
1387
+ "primaryKey": false,
1388
+ "notNull": false
1389
+ },
1390
+ "result_json": {
1391
+ "name": "result_json",
1392
+ "type": "jsonb",
1393
+ "primaryKey": false,
1394
+ "notNull": false
1395
+ },
1396
+ "session_id_before": {
1397
+ "name": "session_id_before",
1398
+ "type": "text",
1399
+ "primaryKey": false,
1400
+ "notNull": false
1401
+ },
1402
+ "session_id_after": {
1403
+ "name": "session_id_after",
1404
+ "type": "text",
1405
+ "primaryKey": false,
1406
+ "notNull": false
1407
+ },
1408
+ "log_store": {
1409
+ "name": "log_store",
1410
+ "type": "text",
1411
+ "primaryKey": false,
1412
+ "notNull": false
1413
+ },
1414
+ "log_ref": {
1415
+ "name": "log_ref",
1416
+ "type": "text",
1417
+ "primaryKey": false,
1418
+ "notNull": false
1419
+ },
1420
+ "log_bytes": {
1421
+ "name": "log_bytes",
1422
+ "type": "bigint",
1423
+ "primaryKey": false,
1424
+ "notNull": false
1425
+ },
1426
+ "log_sha256": {
1427
+ "name": "log_sha256",
1428
+ "type": "text",
1429
+ "primaryKey": false,
1430
+ "notNull": false
1431
+ },
1432
+ "log_compressed": {
1433
+ "name": "log_compressed",
1434
+ "type": "boolean",
1435
+ "primaryKey": false,
1436
+ "notNull": true,
1437
+ "default": false
1438
+ },
1439
+ "stdout_excerpt": {
1440
+ "name": "stdout_excerpt",
1441
+ "type": "text",
1442
+ "primaryKey": false,
1443
+ "notNull": false
1444
+ },
1445
+ "stderr_excerpt": {
1446
+ "name": "stderr_excerpt",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": false
1450
+ },
1451
+ "error_code": {
1452
+ "name": "error_code",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": false
1456
+ },
1457
+ "external_run_id": {
1458
+ "name": "external_run_id",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": false
1462
+ },
1463
+ "process_pid": {
1464
+ "name": "process_pid",
1465
+ "type": "integer",
1466
+ "primaryKey": false,
1467
+ "notNull": false
1468
+ },
1469
+ "process_group_id": {
1470
+ "name": "process_group_id",
1471
+ "type": "integer",
1472
+ "primaryKey": false,
1473
+ "notNull": false
1474
+ },
1475
+ "process_started_at": {
1476
+ "name": "process_started_at",
1477
+ "type": "timestamp with time zone",
1478
+ "primaryKey": false,
1479
+ "notNull": false
1480
+ },
1481
+ "last_output_at": {
1482
+ "name": "last_output_at",
1483
+ "type": "timestamp with time zone",
1484
+ "primaryKey": false,
1485
+ "notNull": false
1486
+ },
1487
+ "last_output_seq": {
1488
+ "name": "last_output_seq",
1489
+ "type": "integer",
1490
+ "primaryKey": false,
1491
+ "notNull": true,
1492
+ "default": 0
1493
+ },
1494
+ "last_output_stream": {
1495
+ "name": "last_output_stream",
1496
+ "type": "text",
1497
+ "primaryKey": false,
1498
+ "notNull": false
1499
+ },
1500
+ "last_output_bytes": {
1501
+ "name": "last_output_bytes",
1502
+ "type": "bigint",
1503
+ "primaryKey": false,
1504
+ "notNull": false
1505
+ },
1506
+ "retry_of_run_id": {
1507
+ "name": "retry_of_run_id",
1508
+ "type": "uuid",
1509
+ "primaryKey": false,
1510
+ "notNull": false
1511
+ },
1512
+ "process_loss_retry_count": {
1513
+ "name": "process_loss_retry_count",
1514
+ "type": "integer",
1515
+ "primaryKey": false,
1516
+ "notNull": true,
1517
+ "default": 0
1518
+ },
1519
+ "scheduled_retry_at": {
1520
+ "name": "scheduled_retry_at",
1521
+ "type": "timestamp with time zone",
1522
+ "primaryKey": false,
1523
+ "notNull": false
1524
+ },
1525
+ "scheduled_retry_attempt": {
1526
+ "name": "scheduled_retry_attempt",
1527
+ "type": "integer",
1528
+ "primaryKey": false,
1529
+ "notNull": true,
1530
+ "default": 0
1531
+ },
1532
+ "scheduled_retry_reason": {
1533
+ "name": "scheduled_retry_reason",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": false
1537
+ },
1538
+ "issue_comment_status": {
1539
+ "name": "issue_comment_status",
1540
+ "type": "text",
1541
+ "primaryKey": false,
1542
+ "notNull": true,
1543
+ "default": "'not_applicable'"
1544
+ },
1545
+ "issue_comment_satisfied_by_comment_id": {
1546
+ "name": "issue_comment_satisfied_by_comment_id",
1547
+ "type": "uuid",
1548
+ "primaryKey": false,
1549
+ "notNull": false
1550
+ },
1551
+ "issue_comment_retry_queued_at": {
1552
+ "name": "issue_comment_retry_queued_at",
1553
+ "type": "timestamp with time zone",
1554
+ "primaryKey": false,
1555
+ "notNull": false
1556
+ },
1557
+ "liveness_state": {
1558
+ "name": "liveness_state",
1559
+ "type": "text",
1560
+ "primaryKey": false,
1561
+ "notNull": false
1562
+ },
1563
+ "liveness_reason": {
1564
+ "name": "liveness_reason",
1565
+ "type": "text",
1566
+ "primaryKey": false,
1567
+ "notNull": false
1568
+ },
1569
+ "continuation_attempt": {
1570
+ "name": "continuation_attempt",
1571
+ "type": "integer",
1572
+ "primaryKey": false,
1573
+ "notNull": true,
1574
+ "default": 0
1575
+ },
1576
+ "last_useful_action_at": {
1577
+ "name": "last_useful_action_at",
1578
+ "type": "timestamp with time zone",
1579
+ "primaryKey": false,
1580
+ "notNull": false
1581
+ },
1582
+ "next_action": {
1583
+ "name": "next_action",
1584
+ "type": "text",
1585
+ "primaryKey": false,
1586
+ "notNull": false
1587
+ },
1588
+ "context_snapshot": {
1589
+ "name": "context_snapshot",
1590
+ "type": "jsonb",
1591
+ "primaryKey": false,
1592
+ "notNull": false
1593
+ },
1594
+ "created_at": {
1595
+ "name": "created_at",
1596
+ "type": "timestamp with time zone",
1597
+ "primaryKey": false,
1598
+ "notNull": true,
1599
+ "default": "now()"
1600
+ },
1601
+ "updated_at": {
1602
+ "name": "updated_at",
1603
+ "type": "timestamp with time zone",
1604
+ "primaryKey": false,
1605
+ "notNull": true,
1606
+ "default": "now()"
1607
+ }
1608
+ },
1609
+ "indexes": {
1610
+ "heartbeat_runs_company_agent_started_idx": {
1611
+ "name": "heartbeat_runs_company_agent_started_idx",
1612
+ "columns": [
1613
+ {
1614
+ "expression": "company_id",
1615
+ "isExpression": false,
1616
+ "asc": true,
1617
+ "nulls": "last"
1618
+ },
1619
+ {
1620
+ "expression": "agent_id",
1621
+ "isExpression": false,
1622
+ "asc": true,
1623
+ "nulls": "last"
1624
+ },
1625
+ {
1626
+ "expression": "started_at",
1627
+ "isExpression": false,
1628
+ "asc": true,
1629
+ "nulls": "last"
1630
+ }
1631
+ ],
1632
+ "isUnique": false,
1633
+ "concurrently": false,
1634
+ "method": "btree",
1635
+ "with": {}
1636
+ },
1637
+ "heartbeat_runs_company_liveness_idx": {
1638
+ "name": "heartbeat_runs_company_liveness_idx",
1639
+ "columns": [
1640
+ {
1641
+ "expression": "company_id",
1642
+ "isExpression": false,
1643
+ "asc": true,
1644
+ "nulls": "last"
1645
+ },
1646
+ {
1647
+ "expression": "liveness_state",
1648
+ "isExpression": false,
1649
+ "asc": true,
1650
+ "nulls": "last"
1651
+ },
1652
+ {
1653
+ "expression": "created_at",
1654
+ "isExpression": false,
1655
+ "asc": true,
1656
+ "nulls": "last"
1657
+ }
1658
+ ],
1659
+ "isUnique": false,
1660
+ "concurrently": false,
1661
+ "method": "btree",
1662
+ "with": {}
1663
+ },
1664
+ "heartbeat_runs_company_status_last_output_idx": {
1665
+ "name": "heartbeat_runs_company_status_last_output_idx",
1666
+ "columns": [
1667
+ {
1668
+ "expression": "company_id",
1669
+ "isExpression": false,
1670
+ "asc": true,
1671
+ "nulls": "last"
1672
+ },
1673
+ {
1674
+ "expression": "status",
1675
+ "isExpression": false,
1676
+ "asc": true,
1677
+ "nulls": "last"
1678
+ },
1679
+ {
1680
+ "expression": "last_output_at",
1681
+ "isExpression": false,
1682
+ "asc": true,
1683
+ "nulls": "last"
1684
+ }
1685
+ ],
1686
+ "isUnique": false,
1687
+ "concurrently": false,
1688
+ "method": "btree",
1689
+ "with": {}
1690
+ },
1691
+ "heartbeat_runs_company_status_process_started_idx": {
1692
+ "name": "heartbeat_runs_company_status_process_started_idx",
1693
+ "columns": [
1694
+ {
1695
+ "expression": "company_id",
1696
+ "isExpression": false,
1697
+ "asc": true,
1698
+ "nulls": "last"
1699
+ },
1700
+ {
1701
+ "expression": "status",
1702
+ "isExpression": false,
1703
+ "asc": true,
1704
+ "nulls": "last"
1705
+ },
1706
+ {
1707
+ "expression": "process_started_at",
1708
+ "isExpression": false,
1709
+ "asc": true,
1710
+ "nulls": "last"
1711
+ }
1712
+ ],
1713
+ "isUnique": false,
1714
+ "concurrently": false,
1715
+ "method": "btree",
1716
+ "with": {}
1717
+ }
1718
+ },
1719
+ "foreignKeys": {
1720
+ "heartbeat_runs_company_id_companies_id_fk": {
1721
+ "name": "heartbeat_runs_company_id_companies_id_fk",
1722
+ "tableFrom": "heartbeat_runs",
1723
+ "tableTo": "companies",
1724
+ "columnsFrom": [
1725
+ "company_id"
1726
+ ],
1727
+ "columnsTo": [
1728
+ "id"
1729
+ ],
1730
+ "onDelete": "no action",
1731
+ "onUpdate": "no action"
1732
+ },
1733
+ "heartbeat_runs_agent_id_agents_id_fk": {
1734
+ "name": "heartbeat_runs_agent_id_agents_id_fk",
1735
+ "tableFrom": "heartbeat_runs",
1736
+ "tableTo": "agents",
1737
+ "columnsFrom": [
1738
+ "agent_id"
1739
+ ],
1740
+ "columnsTo": [
1741
+ "id"
1742
+ ],
1743
+ "onDelete": "no action",
1744
+ "onUpdate": "no action"
1745
+ },
1746
+ "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
1747
+ "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
1748
+ "tableFrom": "heartbeat_runs",
1749
+ "tableTo": "agent_wakeup_requests",
1750
+ "columnsFrom": [
1751
+ "wakeup_request_id"
1752
+ ],
1753
+ "columnsTo": [
1754
+ "id"
1755
+ ],
1756
+ "onDelete": "no action",
1757
+ "onUpdate": "no action"
1758
+ },
1759
+ "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk": {
1760
+ "name": "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk",
1761
+ "tableFrom": "heartbeat_runs",
1762
+ "tableTo": "heartbeat_runs",
1763
+ "columnsFrom": [
1764
+ "retry_of_run_id"
1765
+ ],
1766
+ "columnsTo": [
1767
+ "id"
1768
+ ],
1769
+ "onDelete": "set null",
1770
+ "onUpdate": "no action"
1771
+ }
1772
+ },
1773
+ "compositePrimaryKeys": {},
1774
+ "uniqueConstraints": {},
1775
+ "policies": {},
1776
+ "checkConstraints": {},
1777
+ "isRLSEnabled": false
1778
+ },
1779
+ "public.issue_comments": {
1780
+ "name": "issue_comments",
1781
+ "schema": "",
1782
+ "columns": {
1783
+ "id": {
1784
+ "name": "id",
1785
+ "type": "uuid",
1786
+ "primaryKey": true,
1787
+ "notNull": true,
1788
+ "default": "gen_random_uuid()"
1789
+ },
1790
+ "company_id": {
1791
+ "name": "company_id",
1792
+ "type": "uuid",
1793
+ "primaryKey": false,
1794
+ "notNull": true
1795
+ },
1796
+ "issue_id": {
1797
+ "name": "issue_id",
1798
+ "type": "uuid",
1799
+ "primaryKey": false,
1800
+ "notNull": true
1801
+ },
1802
+ "author_agent_id": {
1803
+ "name": "author_agent_id",
1804
+ "type": "uuid",
1805
+ "primaryKey": false,
1806
+ "notNull": false
1807
+ },
1808
+ "author_user_id": {
1809
+ "name": "author_user_id",
1810
+ "type": "text",
1811
+ "primaryKey": false,
1812
+ "notNull": false
1813
+ },
1814
+ "author_type": {
1815
+ "name": "author_type",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": false
1819
+ },
1820
+ "created_by_run_id": {
1821
+ "name": "created_by_run_id",
1822
+ "type": "uuid",
1823
+ "primaryKey": false,
1824
+ "notNull": false
1825
+ },
1826
+ "body": {
1827
+ "name": "body",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": true
1831
+ },
1832
+ "presentation": {
1833
+ "name": "presentation",
1834
+ "type": "jsonb",
1835
+ "primaryKey": false,
1836
+ "notNull": false
1837
+ },
1838
+ "metadata": {
1839
+ "name": "metadata",
1840
+ "type": "jsonb",
1841
+ "primaryKey": false,
1842
+ "notNull": false
1843
+ },
1844
+ "created_at": {
1845
+ "name": "created_at",
1846
+ "type": "timestamp with time zone",
1847
+ "primaryKey": false,
1848
+ "notNull": true,
1849
+ "default": "now()"
1850
+ },
1851
+ "updated_at": {
1852
+ "name": "updated_at",
1853
+ "type": "timestamp with time zone",
1854
+ "primaryKey": false,
1855
+ "notNull": true,
1856
+ "default": "now()"
1857
+ }
1858
+ },
1859
+ "indexes": {
1860
+ "issue_comments_issue_idx": {
1861
+ "name": "issue_comments_issue_idx",
1862
+ "columns": [
1863
+ {
1864
+ "expression": "issue_id",
1865
+ "isExpression": false,
1866
+ "asc": true,
1867
+ "nulls": "last"
1868
+ }
1869
+ ],
1870
+ "isUnique": false,
1871
+ "concurrently": false,
1872
+ "method": "btree",
1873
+ "with": {}
1874
+ },
1875
+ "issue_comments_company_idx": {
1876
+ "name": "issue_comments_company_idx",
1877
+ "columns": [
1878
+ {
1879
+ "expression": "company_id",
1880
+ "isExpression": false,
1881
+ "asc": true,
1882
+ "nulls": "last"
1883
+ }
1884
+ ],
1885
+ "isUnique": false,
1886
+ "concurrently": false,
1887
+ "method": "btree",
1888
+ "with": {}
1889
+ },
1890
+ "issue_comments_company_issue_created_at_idx": {
1891
+ "name": "issue_comments_company_issue_created_at_idx",
1892
+ "columns": [
1893
+ {
1894
+ "expression": "company_id",
1895
+ "isExpression": false,
1896
+ "asc": true,
1897
+ "nulls": "last"
1898
+ },
1899
+ {
1900
+ "expression": "issue_id",
1901
+ "isExpression": false,
1902
+ "asc": true,
1903
+ "nulls": "last"
1904
+ },
1905
+ {
1906
+ "expression": "created_at",
1907
+ "isExpression": false,
1908
+ "asc": true,
1909
+ "nulls": "last"
1910
+ }
1911
+ ],
1912
+ "isUnique": false,
1913
+ "concurrently": false,
1914
+ "method": "btree",
1915
+ "with": {}
1916
+ },
1917
+ "issue_comments_company_author_issue_created_at_idx": {
1918
+ "name": "issue_comments_company_author_issue_created_at_idx",
1919
+ "columns": [
1920
+ {
1921
+ "expression": "company_id",
1922
+ "isExpression": false,
1923
+ "asc": true,
1924
+ "nulls": "last"
1925
+ },
1926
+ {
1927
+ "expression": "author_user_id",
1928
+ "isExpression": false,
1929
+ "asc": true,
1930
+ "nulls": "last"
1931
+ },
1932
+ {
1933
+ "expression": "issue_id",
1934
+ "isExpression": false,
1935
+ "asc": true,
1936
+ "nulls": "last"
1937
+ },
1938
+ {
1939
+ "expression": "created_at",
1940
+ "isExpression": false,
1941
+ "asc": true,
1942
+ "nulls": "last"
1943
+ }
1944
+ ],
1945
+ "isUnique": false,
1946
+ "concurrently": false,
1947
+ "method": "btree",
1948
+ "with": {}
1949
+ }
1950
+ },
1951
+ "foreignKeys": {
1952
+ "issue_comments_company_id_companies_id_fk": {
1953
+ "name": "issue_comments_company_id_companies_id_fk",
1954
+ "tableFrom": "issue_comments",
1955
+ "tableTo": "companies",
1956
+ "columnsFrom": [
1957
+ "company_id"
1958
+ ],
1959
+ "columnsTo": [
1960
+ "id"
1961
+ ],
1962
+ "onDelete": "no action",
1963
+ "onUpdate": "no action"
1964
+ },
1965
+ "issue_comments_issue_id_issues_id_fk": {
1966
+ "name": "issue_comments_issue_id_issues_id_fk",
1967
+ "tableFrom": "issue_comments",
1968
+ "tableTo": "issues",
1969
+ "columnsFrom": [
1970
+ "issue_id"
1971
+ ],
1972
+ "columnsTo": [
1973
+ "id"
1974
+ ],
1975
+ "onDelete": "no action",
1976
+ "onUpdate": "no action"
1977
+ },
1978
+ "issue_comments_author_agent_id_agents_id_fk": {
1979
+ "name": "issue_comments_author_agent_id_agents_id_fk",
1980
+ "tableFrom": "issue_comments",
1981
+ "tableTo": "agents",
1982
+ "columnsFrom": [
1983
+ "author_agent_id"
1984
+ ],
1985
+ "columnsTo": [
1986
+ "id"
1987
+ ],
1988
+ "onDelete": "no action",
1989
+ "onUpdate": "no action"
1990
+ },
1991
+ "issue_comments_created_by_run_id_heartbeat_runs_id_fk": {
1992
+ "name": "issue_comments_created_by_run_id_heartbeat_runs_id_fk",
1993
+ "tableFrom": "issue_comments",
1994
+ "tableTo": "heartbeat_runs",
1995
+ "columnsFrom": [
1996
+ "created_by_run_id"
1997
+ ],
1998
+ "columnsTo": [
1999
+ "id"
2000
+ ],
2001
+ "onDelete": "set null",
2002
+ "onUpdate": "no action"
2003
+ }
2004
+ },
2005
+ "compositePrimaryKeys": {},
2006
+ "uniqueConstraints": {},
2007
+ "policies": {},
2008
+ "checkConstraints": {},
2009
+ "isRLSEnabled": false
2010
+ },
2011
+ "public.issue_relations": {
2012
+ "name": "issue_relations",
2013
+ "schema": "",
2014
+ "columns": {
2015
+ "id": {
2016
+ "name": "id",
2017
+ "type": "uuid",
2018
+ "primaryKey": true,
2019
+ "notNull": true,
2020
+ "default": "gen_random_uuid()"
2021
+ },
2022
+ "company_id": {
2023
+ "name": "company_id",
2024
+ "type": "uuid",
2025
+ "primaryKey": false,
2026
+ "notNull": true
2027
+ },
2028
+ "issue_id": {
2029
+ "name": "issue_id",
2030
+ "type": "uuid",
2031
+ "primaryKey": false,
2032
+ "notNull": true
2033
+ },
2034
+ "related_issue_id": {
2035
+ "name": "related_issue_id",
2036
+ "type": "uuid",
2037
+ "primaryKey": false,
2038
+ "notNull": true
2039
+ },
2040
+ "type": {
2041
+ "name": "type",
2042
+ "type": "text",
2043
+ "primaryKey": false,
2044
+ "notNull": true
2045
+ },
2046
+ "created_by_agent_id": {
2047
+ "name": "created_by_agent_id",
2048
+ "type": "uuid",
2049
+ "primaryKey": false,
2050
+ "notNull": false
2051
+ },
2052
+ "created_by_user_id": {
2053
+ "name": "created_by_user_id",
2054
+ "type": "text",
2055
+ "primaryKey": false,
2056
+ "notNull": false
2057
+ },
2058
+ "created_at": {
2059
+ "name": "created_at",
2060
+ "type": "timestamp with time zone",
2061
+ "primaryKey": false,
2062
+ "notNull": true,
2063
+ "default": "now()"
2064
+ },
2065
+ "updated_at": {
2066
+ "name": "updated_at",
2067
+ "type": "timestamp with time zone",
2068
+ "primaryKey": false,
2069
+ "notNull": true,
2070
+ "default": "now()"
2071
+ }
2072
+ },
2073
+ "indexes": {
2074
+ "issue_relations_company_issue_idx": {
2075
+ "name": "issue_relations_company_issue_idx",
2076
+ "columns": [
2077
+ {
2078
+ "expression": "company_id",
2079
+ "isExpression": false,
2080
+ "asc": true,
2081
+ "nulls": "last"
2082
+ },
2083
+ {
2084
+ "expression": "issue_id",
2085
+ "isExpression": false,
2086
+ "asc": true,
2087
+ "nulls": "last"
2088
+ }
2089
+ ],
2090
+ "isUnique": false,
2091
+ "concurrently": false,
2092
+ "method": "btree",
2093
+ "with": {}
2094
+ },
2095
+ "issue_relations_company_related_issue_idx": {
2096
+ "name": "issue_relations_company_related_issue_idx",
2097
+ "columns": [
2098
+ {
2099
+ "expression": "company_id",
2100
+ "isExpression": false,
2101
+ "asc": true,
2102
+ "nulls": "last"
2103
+ },
2104
+ {
2105
+ "expression": "related_issue_id",
2106
+ "isExpression": false,
2107
+ "asc": true,
2108
+ "nulls": "last"
2109
+ }
2110
+ ],
2111
+ "isUnique": false,
2112
+ "concurrently": false,
2113
+ "method": "btree",
2114
+ "with": {}
2115
+ },
2116
+ "issue_relations_company_type_idx": {
2117
+ "name": "issue_relations_company_type_idx",
2118
+ "columns": [
2119
+ {
2120
+ "expression": "company_id",
2121
+ "isExpression": false,
2122
+ "asc": true,
2123
+ "nulls": "last"
2124
+ },
2125
+ {
2126
+ "expression": "type",
2127
+ "isExpression": false,
2128
+ "asc": true,
2129
+ "nulls": "last"
2130
+ }
2131
+ ],
2132
+ "isUnique": false,
2133
+ "concurrently": false,
2134
+ "method": "btree",
2135
+ "with": {}
2136
+ },
2137
+ "issue_relations_company_edge_uq": {
2138
+ "name": "issue_relations_company_edge_uq",
2139
+ "columns": [
2140
+ {
2141
+ "expression": "company_id",
2142
+ "isExpression": false,
2143
+ "asc": true,
2144
+ "nulls": "last"
2145
+ },
2146
+ {
2147
+ "expression": "issue_id",
2148
+ "isExpression": false,
2149
+ "asc": true,
2150
+ "nulls": "last"
2151
+ },
2152
+ {
2153
+ "expression": "related_issue_id",
2154
+ "isExpression": false,
2155
+ "asc": true,
2156
+ "nulls": "last"
2157
+ },
2158
+ {
2159
+ "expression": "type",
2160
+ "isExpression": false,
2161
+ "asc": true,
2162
+ "nulls": "last"
2163
+ }
2164
+ ],
2165
+ "isUnique": true,
2166
+ "concurrently": false,
2167
+ "method": "btree",
2168
+ "with": {}
2169
+ }
2170
+ },
2171
+ "foreignKeys": {
2172
+ "issue_relations_company_id_companies_id_fk": {
2173
+ "name": "issue_relations_company_id_companies_id_fk",
2174
+ "tableFrom": "issue_relations",
2175
+ "tableTo": "companies",
2176
+ "columnsFrom": [
2177
+ "company_id"
2178
+ ],
2179
+ "columnsTo": [
2180
+ "id"
2181
+ ],
2182
+ "onDelete": "no action",
2183
+ "onUpdate": "no action"
2184
+ },
2185
+ "issue_relations_issue_id_issues_id_fk": {
2186
+ "name": "issue_relations_issue_id_issues_id_fk",
2187
+ "tableFrom": "issue_relations",
2188
+ "tableTo": "issues",
2189
+ "columnsFrom": [
2190
+ "issue_id"
2191
+ ],
2192
+ "columnsTo": [
2193
+ "id"
2194
+ ],
2195
+ "onDelete": "cascade",
2196
+ "onUpdate": "no action"
2197
+ },
2198
+ "issue_relations_related_issue_id_issues_id_fk": {
2199
+ "name": "issue_relations_related_issue_id_issues_id_fk",
2200
+ "tableFrom": "issue_relations",
2201
+ "tableTo": "issues",
2202
+ "columnsFrom": [
2203
+ "related_issue_id"
2204
+ ],
2205
+ "columnsTo": [
2206
+ "id"
2207
+ ],
2208
+ "onDelete": "cascade",
2209
+ "onUpdate": "no action"
2210
+ },
2211
+ "issue_relations_created_by_agent_id_agents_id_fk": {
2212
+ "name": "issue_relations_created_by_agent_id_agents_id_fk",
2213
+ "tableFrom": "issue_relations",
2214
+ "tableTo": "agents",
2215
+ "columnsFrom": [
2216
+ "created_by_agent_id"
2217
+ ],
2218
+ "columnsTo": [
2219
+ "id"
2220
+ ],
2221
+ "onDelete": "set null",
2222
+ "onUpdate": "no action"
2223
+ }
2224
+ },
2225
+ "compositePrimaryKeys": {},
2226
+ "uniqueConstraints": {},
2227
+ "policies": {},
2228
+ "checkConstraints": {},
2229
+ "isRLSEnabled": false
2230
+ },
2231
+ "public.issues": {
2232
+ "name": "issues",
2233
+ "schema": "",
2234
+ "columns": {
2235
+ "id": {
2236
+ "name": "id",
2237
+ "type": "uuid",
2238
+ "primaryKey": true,
2239
+ "notNull": true,
2240
+ "default": "gen_random_uuid()"
2241
+ },
2242
+ "company_id": {
2243
+ "name": "company_id",
2244
+ "type": "uuid",
2245
+ "primaryKey": false,
2246
+ "notNull": true
2247
+ },
2248
+ "project_id": {
2249
+ "name": "project_id",
2250
+ "type": "uuid",
2251
+ "primaryKey": false,
2252
+ "notNull": false
2253
+ },
2254
+ "project_workspace_id": {
2255
+ "name": "project_workspace_id",
2256
+ "type": "uuid",
2257
+ "primaryKey": false,
2258
+ "notNull": false
2259
+ },
2260
+ "goal_id": {
2261
+ "name": "goal_id",
2262
+ "type": "uuid",
2263
+ "primaryKey": false,
2264
+ "notNull": false
2265
+ },
2266
+ "parent_id": {
2267
+ "name": "parent_id",
2268
+ "type": "uuid",
2269
+ "primaryKey": false,
2270
+ "notNull": false
2271
+ },
2272
+ "title": {
2273
+ "name": "title",
2274
+ "type": "text",
2275
+ "primaryKey": false,
2276
+ "notNull": true
2277
+ },
2278
+ "description": {
2279
+ "name": "description",
2280
+ "type": "text",
2281
+ "primaryKey": false,
2282
+ "notNull": false
2283
+ },
2284
+ "status": {
2285
+ "name": "status",
2286
+ "type": "text",
2287
+ "primaryKey": false,
2288
+ "notNull": true,
2289
+ "default": "'backlog'"
2290
+ },
2291
+ "work_mode": {
2292
+ "name": "work_mode",
2293
+ "type": "text",
2294
+ "primaryKey": false,
2295
+ "notNull": true,
2296
+ "default": "'standard'"
2297
+ },
2298
+ "priority": {
2299
+ "name": "priority",
2300
+ "type": "text",
2301
+ "primaryKey": false,
2302
+ "notNull": true,
2303
+ "default": "'medium'"
2304
+ },
2305
+ "assignee_agent_id": {
2306
+ "name": "assignee_agent_id",
2307
+ "type": "uuid",
2308
+ "primaryKey": false,
2309
+ "notNull": false
2310
+ },
2311
+ "assignee_user_id": {
2312
+ "name": "assignee_user_id",
2313
+ "type": "text",
2314
+ "primaryKey": false,
2315
+ "notNull": false
2316
+ },
2317
+ "checkout_run_id": {
2318
+ "name": "checkout_run_id",
2319
+ "type": "uuid",
2320
+ "primaryKey": false,
2321
+ "notNull": false
2322
+ },
2323
+ "execution_run_id": {
2324
+ "name": "execution_run_id",
2325
+ "type": "uuid",
2326
+ "primaryKey": false,
2327
+ "notNull": false
2328
+ },
2329
+ "execution_agent_name_key": {
2330
+ "name": "execution_agent_name_key",
2331
+ "type": "text",
2332
+ "primaryKey": false,
2333
+ "notNull": false
2334
+ },
2335
+ "execution_locked_at": {
2336
+ "name": "execution_locked_at",
2337
+ "type": "timestamp with time zone",
2338
+ "primaryKey": false,
2339
+ "notNull": false
2340
+ },
2341
+ "created_by_agent_id": {
2342
+ "name": "created_by_agent_id",
2343
+ "type": "uuid",
2344
+ "primaryKey": false,
2345
+ "notNull": false
2346
+ },
2347
+ "created_by_user_id": {
2348
+ "name": "created_by_user_id",
2349
+ "type": "text",
2350
+ "primaryKey": false,
2351
+ "notNull": false
2352
+ },
2353
+ "issue_number": {
2354
+ "name": "issue_number",
2355
+ "type": "integer",
2356
+ "primaryKey": false,
2357
+ "notNull": false
2358
+ },
2359
+ "identifier": {
2360
+ "name": "identifier",
2361
+ "type": "text",
2362
+ "primaryKey": false,
2363
+ "notNull": false
2364
+ },
2365
+ "origin_kind": {
2366
+ "name": "origin_kind",
2367
+ "type": "text",
2368
+ "primaryKey": false,
2369
+ "notNull": true,
2370
+ "default": "'manual'"
2371
+ },
2372
+ "origin_id": {
2373
+ "name": "origin_id",
2374
+ "type": "text",
2375
+ "primaryKey": false,
2376
+ "notNull": false
2377
+ },
2378
+ "origin_run_id": {
2379
+ "name": "origin_run_id",
2380
+ "type": "text",
2381
+ "primaryKey": false,
2382
+ "notNull": false
2383
+ },
2384
+ "origin_fingerprint": {
2385
+ "name": "origin_fingerprint",
2386
+ "type": "text",
2387
+ "primaryKey": false,
2388
+ "notNull": true,
2389
+ "default": "'default'"
2390
+ },
2391
+ "request_depth": {
2392
+ "name": "request_depth",
2393
+ "type": "integer",
2394
+ "primaryKey": false,
2395
+ "notNull": true,
2396
+ "default": 0
2397
+ },
2398
+ "billing_code": {
2399
+ "name": "billing_code",
2400
+ "type": "text",
2401
+ "primaryKey": false,
2402
+ "notNull": false
2403
+ },
2404
+ "assignee_adapter_overrides": {
2405
+ "name": "assignee_adapter_overrides",
2406
+ "type": "jsonb",
2407
+ "primaryKey": false,
2408
+ "notNull": false
2409
+ },
2410
+ "execution_policy": {
2411
+ "name": "execution_policy",
2412
+ "type": "jsonb",
2413
+ "primaryKey": false,
2414
+ "notNull": false
2415
+ },
2416
+ "execution_state": {
2417
+ "name": "execution_state",
2418
+ "type": "jsonb",
2419
+ "primaryKey": false,
2420
+ "notNull": false
2421
+ },
2422
+ "monitor_next_check_at": {
2423
+ "name": "monitor_next_check_at",
2424
+ "type": "timestamp with time zone",
2425
+ "primaryKey": false,
2426
+ "notNull": false
2427
+ },
2428
+ "monitor_wake_requested_at": {
2429
+ "name": "monitor_wake_requested_at",
2430
+ "type": "timestamp with time zone",
2431
+ "primaryKey": false,
2432
+ "notNull": false
2433
+ },
2434
+ "monitor_last_triggered_at": {
2435
+ "name": "monitor_last_triggered_at",
2436
+ "type": "timestamp with time zone",
2437
+ "primaryKey": false,
2438
+ "notNull": false
2439
+ },
2440
+ "monitor_attempt_count": {
2441
+ "name": "monitor_attempt_count",
2442
+ "type": "integer",
2443
+ "primaryKey": false,
2444
+ "notNull": true,
2445
+ "default": 0
2446
+ },
2447
+ "monitor_notes": {
2448
+ "name": "monitor_notes",
2449
+ "type": "text",
2450
+ "primaryKey": false,
2451
+ "notNull": false
2452
+ },
2453
+ "monitor_scheduled_by": {
2454
+ "name": "monitor_scheduled_by",
2455
+ "type": "text",
2456
+ "primaryKey": false,
2457
+ "notNull": false
2458
+ },
2459
+ "execution_workspace_id": {
2460
+ "name": "execution_workspace_id",
2461
+ "type": "uuid",
2462
+ "primaryKey": false,
2463
+ "notNull": false
2464
+ },
2465
+ "execution_workspace_preference": {
2466
+ "name": "execution_workspace_preference",
2467
+ "type": "text",
2468
+ "primaryKey": false,
2469
+ "notNull": false
2470
+ },
2471
+ "execution_workspace_settings": {
2472
+ "name": "execution_workspace_settings",
2473
+ "type": "jsonb",
2474
+ "primaryKey": false,
2475
+ "notNull": false
2476
+ },
2477
+ "started_at": {
2478
+ "name": "started_at",
2479
+ "type": "timestamp with time zone",
2480
+ "primaryKey": false,
2481
+ "notNull": false
2482
+ },
2483
+ "completed_at": {
2484
+ "name": "completed_at",
2485
+ "type": "timestamp with time zone",
2486
+ "primaryKey": false,
2487
+ "notNull": false
2488
+ },
2489
+ "cancelled_at": {
2490
+ "name": "cancelled_at",
2491
+ "type": "timestamp with time zone",
2492
+ "primaryKey": false,
2493
+ "notNull": false
2494
+ },
2495
+ "hidden_at": {
2496
+ "name": "hidden_at",
2497
+ "type": "timestamp with time zone",
2498
+ "primaryKey": false,
2499
+ "notNull": false
2500
+ },
2501
+ "created_at": {
2502
+ "name": "created_at",
2503
+ "type": "timestamp with time zone",
2504
+ "primaryKey": false,
2505
+ "notNull": true,
2506
+ "default": "now()"
2507
+ },
2508
+ "updated_at": {
2509
+ "name": "updated_at",
2510
+ "type": "timestamp with time zone",
2511
+ "primaryKey": false,
2512
+ "notNull": true,
2513
+ "default": "now()"
2514
+ }
2515
+ },
2516
+ "indexes": {
2517
+ "issues_company_status_idx": {
2518
+ "name": "issues_company_status_idx",
2519
+ "columns": [
2520
+ {
2521
+ "expression": "company_id",
2522
+ "isExpression": false,
2523
+ "asc": true,
2524
+ "nulls": "last"
2525
+ },
2526
+ {
2527
+ "expression": "status",
2528
+ "isExpression": false,
2529
+ "asc": true,
2530
+ "nulls": "last"
2531
+ }
2532
+ ],
2533
+ "isUnique": false,
2534
+ "concurrently": false,
2535
+ "method": "btree",
2536
+ "with": {}
2537
+ },
2538
+ "issues_company_assignee_status_idx": {
2539
+ "name": "issues_company_assignee_status_idx",
2540
+ "columns": [
2541
+ {
2542
+ "expression": "company_id",
2543
+ "isExpression": false,
2544
+ "asc": true,
2545
+ "nulls": "last"
2546
+ },
2547
+ {
2548
+ "expression": "assignee_agent_id",
2549
+ "isExpression": false,
2550
+ "asc": true,
2551
+ "nulls": "last"
2552
+ },
2553
+ {
2554
+ "expression": "status",
2555
+ "isExpression": false,
2556
+ "asc": true,
2557
+ "nulls": "last"
2558
+ }
2559
+ ],
2560
+ "isUnique": false,
2561
+ "concurrently": false,
2562
+ "method": "btree",
2563
+ "with": {}
2564
+ },
2565
+ "issues_company_assignee_user_status_idx": {
2566
+ "name": "issues_company_assignee_user_status_idx",
2567
+ "columns": [
2568
+ {
2569
+ "expression": "company_id",
2570
+ "isExpression": false,
2571
+ "asc": true,
2572
+ "nulls": "last"
2573
+ },
2574
+ {
2575
+ "expression": "assignee_user_id",
2576
+ "isExpression": false,
2577
+ "asc": true,
2578
+ "nulls": "last"
2579
+ },
2580
+ {
2581
+ "expression": "status",
2582
+ "isExpression": false,
2583
+ "asc": true,
2584
+ "nulls": "last"
2585
+ }
2586
+ ],
2587
+ "isUnique": false,
2588
+ "concurrently": false,
2589
+ "method": "btree",
2590
+ "with": {}
2591
+ },
2592
+ "issues_company_parent_idx": {
2593
+ "name": "issues_company_parent_idx",
2594
+ "columns": [
2595
+ {
2596
+ "expression": "company_id",
2597
+ "isExpression": false,
2598
+ "asc": true,
2599
+ "nulls": "last"
2600
+ },
2601
+ {
2602
+ "expression": "parent_id",
2603
+ "isExpression": false,
2604
+ "asc": true,
2605
+ "nulls": "last"
2606
+ }
2607
+ ],
2608
+ "isUnique": false,
2609
+ "concurrently": false,
2610
+ "method": "btree",
2611
+ "with": {}
2612
+ },
2613
+ "issues_company_project_idx": {
2614
+ "name": "issues_company_project_idx",
2615
+ "columns": [
2616
+ {
2617
+ "expression": "company_id",
2618
+ "isExpression": false,
2619
+ "asc": true,
2620
+ "nulls": "last"
2621
+ },
2622
+ {
2623
+ "expression": "project_id",
2624
+ "isExpression": false,
2625
+ "asc": true,
2626
+ "nulls": "last"
2627
+ }
2628
+ ],
2629
+ "isUnique": false,
2630
+ "concurrently": false,
2631
+ "method": "btree",
2632
+ "with": {}
2633
+ },
2634
+ "issues_company_origin_idx": {
2635
+ "name": "issues_company_origin_idx",
2636
+ "columns": [
2637
+ {
2638
+ "expression": "company_id",
2639
+ "isExpression": false,
2640
+ "asc": true,
2641
+ "nulls": "last"
2642
+ },
2643
+ {
2644
+ "expression": "origin_kind",
2645
+ "isExpression": false,
2646
+ "asc": true,
2647
+ "nulls": "last"
2648
+ },
2649
+ {
2650
+ "expression": "origin_id",
2651
+ "isExpression": false,
2652
+ "asc": true,
2653
+ "nulls": "last"
2654
+ }
2655
+ ],
2656
+ "isUnique": false,
2657
+ "concurrently": false,
2658
+ "method": "btree",
2659
+ "with": {}
2660
+ },
2661
+ "issues_company_project_workspace_idx": {
2662
+ "name": "issues_company_project_workspace_idx",
2663
+ "columns": [
2664
+ {
2665
+ "expression": "company_id",
2666
+ "isExpression": false,
2667
+ "asc": true,
2668
+ "nulls": "last"
2669
+ },
2670
+ {
2671
+ "expression": "project_workspace_id",
2672
+ "isExpression": false,
2673
+ "asc": true,
2674
+ "nulls": "last"
2675
+ }
2676
+ ],
2677
+ "isUnique": false,
2678
+ "concurrently": false,
2679
+ "method": "btree",
2680
+ "with": {}
2681
+ },
2682
+ "issues_company_execution_workspace_idx": {
2683
+ "name": "issues_company_execution_workspace_idx",
2684
+ "columns": [
2685
+ {
2686
+ "expression": "company_id",
2687
+ "isExpression": false,
2688
+ "asc": true,
2689
+ "nulls": "last"
2690
+ },
2691
+ {
2692
+ "expression": "execution_workspace_id",
2693
+ "isExpression": false,
2694
+ "asc": true,
2695
+ "nulls": "last"
2696
+ }
2697
+ ],
2698
+ "isUnique": false,
2699
+ "concurrently": false,
2700
+ "method": "btree",
2701
+ "with": {}
2702
+ },
2703
+ "issues_company_monitor_due_idx": {
2704
+ "name": "issues_company_monitor_due_idx",
2705
+ "columns": [
2706
+ {
2707
+ "expression": "company_id",
2708
+ "isExpression": false,
2709
+ "asc": true,
2710
+ "nulls": "last"
2711
+ },
2712
+ {
2713
+ "expression": "monitor_next_check_at",
2714
+ "isExpression": false,
2715
+ "asc": true,
2716
+ "nulls": "last"
2717
+ }
2718
+ ],
2719
+ "isUnique": false,
2720
+ "concurrently": false,
2721
+ "method": "btree",
2722
+ "with": {}
2723
+ },
2724
+ "issues_identifier_idx": {
2725
+ "name": "issues_identifier_idx",
2726
+ "columns": [
2727
+ {
2728
+ "expression": "identifier",
2729
+ "isExpression": false,
2730
+ "asc": true,
2731
+ "nulls": "last"
2732
+ }
2733
+ ],
2734
+ "isUnique": true,
2735
+ "concurrently": false,
2736
+ "method": "btree",
2737
+ "with": {}
2738
+ },
2739
+ "issues_open_routine_execution_uq": {
2740
+ "name": "issues_open_routine_execution_uq",
2741
+ "columns": [
2742
+ {
2743
+ "expression": "company_id",
2744
+ "isExpression": false,
2745
+ "asc": true,
2746
+ "nulls": "last"
2747
+ },
2748
+ {
2749
+ "expression": "origin_kind",
2750
+ "isExpression": false,
2751
+ "asc": true,
2752
+ "nulls": "last"
2753
+ },
2754
+ {
2755
+ "expression": "origin_id",
2756
+ "isExpression": false,
2757
+ "asc": true,
2758
+ "nulls": "last"
2759
+ },
2760
+ {
2761
+ "expression": "origin_fingerprint",
2762
+ "isExpression": false,
2763
+ "asc": true,
2764
+ "nulls": "last"
2765
+ }
2766
+ ],
2767
+ "isUnique": true,
2768
+ "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')",
2769
+ "concurrently": false,
2770
+ "method": "btree",
2771
+ "with": {}
2772
+ },
2773
+ "issues_active_liveness_recovery_incident_uq": {
2774
+ "name": "issues_active_liveness_recovery_incident_uq",
2775
+ "columns": [
2776
+ {
2777
+ "expression": "company_id",
2778
+ "isExpression": false,
2779
+ "asc": true,
2780
+ "nulls": "last"
2781
+ },
2782
+ {
2783
+ "expression": "origin_kind",
2784
+ "isExpression": false,
2785
+ "asc": true,
2786
+ "nulls": "last"
2787
+ },
2788
+ {
2789
+ "expression": "origin_id",
2790
+ "isExpression": false,
2791
+ "asc": true,
2792
+ "nulls": "last"
2793
+ }
2794
+ ],
2795
+ "isUnique": true,
2796
+ "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')",
2797
+ "concurrently": false,
2798
+ "method": "btree",
2799
+ "with": {}
2800
+ },
2801
+ "issues_active_liveness_recovery_leaf_uq": {
2802
+ "name": "issues_active_liveness_recovery_leaf_uq",
2803
+ "columns": [
2804
+ {
2805
+ "expression": "company_id",
2806
+ "isExpression": false,
2807
+ "asc": true,
2808
+ "nulls": "last"
2809
+ },
2810
+ {
2811
+ "expression": "origin_kind",
2812
+ "isExpression": false,
2813
+ "asc": true,
2814
+ "nulls": "last"
2815
+ },
2816
+ {
2817
+ "expression": "origin_fingerprint",
2818
+ "isExpression": false,
2819
+ "asc": true,
2820
+ "nulls": "last"
2821
+ }
2822
+ ],
2823
+ "isUnique": true,
2824
+ "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')",
2825
+ "concurrently": false,
2826
+ "method": "btree",
2827
+ "with": {}
2828
+ },
2829
+ "issues_active_stale_run_evaluation_uq": {
2830
+ "name": "issues_active_stale_run_evaluation_uq",
2831
+ "columns": [
2832
+ {
2833
+ "expression": "company_id",
2834
+ "isExpression": false,
2835
+ "asc": true,
2836
+ "nulls": "last"
2837
+ },
2838
+ {
2839
+ "expression": "origin_kind",
2840
+ "isExpression": false,
2841
+ "asc": true,
2842
+ "nulls": "last"
2843
+ },
2844
+ {
2845
+ "expression": "origin_id",
2846
+ "isExpression": false,
2847
+ "asc": true,
2848
+ "nulls": "last"
2849
+ }
2850
+ ],
2851
+ "isUnique": true,
2852
+ "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')",
2853
+ "concurrently": false,
2854
+ "method": "btree",
2855
+ "with": {}
2856
+ },
2857
+ "issues_active_productivity_review_uq": {
2858
+ "name": "issues_active_productivity_review_uq",
2859
+ "columns": [
2860
+ {
2861
+ "expression": "company_id",
2862
+ "isExpression": false,
2863
+ "asc": true,
2864
+ "nulls": "last"
2865
+ },
2866
+ {
2867
+ "expression": "origin_kind",
2868
+ "isExpression": false,
2869
+ "asc": true,
2870
+ "nulls": "last"
2871
+ },
2872
+ {
2873
+ "expression": "origin_id",
2874
+ "isExpression": false,
2875
+ "asc": true,
2876
+ "nulls": "last"
2877
+ }
2878
+ ],
2879
+ "isUnique": true,
2880
+ "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')",
2881
+ "concurrently": false,
2882
+ "method": "btree",
2883
+ "with": {}
2884
+ },
2885
+ "issues_active_stranded_issue_recovery_uq": {
2886
+ "name": "issues_active_stranded_issue_recovery_uq",
2887
+ "columns": [
2888
+ {
2889
+ "expression": "company_id",
2890
+ "isExpression": false,
2891
+ "asc": true,
2892
+ "nulls": "last"
2893
+ },
2894
+ {
2895
+ "expression": "origin_kind",
2896
+ "isExpression": false,
2897
+ "asc": true,
2898
+ "nulls": "last"
2899
+ },
2900
+ {
2901
+ "expression": "origin_id",
2902
+ "isExpression": false,
2903
+ "asc": true,
2904
+ "nulls": "last"
2905
+ }
2906
+ ],
2907
+ "isUnique": true,
2908
+ "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')",
2909
+ "concurrently": false,
2910
+ "method": "btree",
2911
+ "with": {}
2912
+ }
2913
+ },
2914
+ "foreignKeys": {
2915
+ "issues_company_id_companies_id_fk": {
2916
+ "name": "issues_company_id_companies_id_fk",
2917
+ "tableFrom": "issues",
2918
+ "tableTo": "companies",
2919
+ "columnsFrom": [
2920
+ "company_id"
2921
+ ],
2922
+ "columnsTo": [
2923
+ "id"
2924
+ ],
2925
+ "onDelete": "no action",
2926
+ "onUpdate": "no action"
2927
+ },
2928
+ "issues_project_id_projects_id_fk": {
2929
+ "name": "issues_project_id_projects_id_fk",
2930
+ "tableFrom": "issues",
2931
+ "tableTo": "projects",
2932
+ "columnsFrom": [
2933
+ "project_id"
2934
+ ],
2935
+ "columnsTo": [
2936
+ "id"
2937
+ ],
2938
+ "onDelete": "no action",
2939
+ "onUpdate": "no action"
2940
+ },
2941
+ "issues_project_workspace_id_project_workspaces_id_fk": {
2942
+ "name": "issues_project_workspace_id_project_workspaces_id_fk",
2943
+ "tableFrom": "issues",
2944
+ "tableTo": "project_workspaces",
2945
+ "columnsFrom": [
2946
+ "project_workspace_id"
2947
+ ],
2948
+ "columnsTo": [
2949
+ "id"
2950
+ ],
2951
+ "onDelete": "set null",
2952
+ "onUpdate": "no action"
2953
+ },
2954
+ "issues_parent_id_issues_id_fk": {
2955
+ "name": "issues_parent_id_issues_id_fk",
2956
+ "tableFrom": "issues",
2957
+ "tableTo": "issues",
2958
+ "columnsFrom": [
2959
+ "parent_id"
2960
+ ],
2961
+ "columnsTo": [
2962
+ "id"
2963
+ ],
2964
+ "onDelete": "no action",
2965
+ "onUpdate": "no action"
2966
+ },
2967
+ "issues_assignee_agent_id_agents_id_fk": {
2968
+ "name": "issues_assignee_agent_id_agents_id_fk",
2969
+ "tableFrom": "issues",
2970
+ "tableTo": "agents",
2971
+ "columnsFrom": [
2972
+ "assignee_agent_id"
2973
+ ],
2974
+ "columnsTo": [
2975
+ "id"
2976
+ ],
2977
+ "onDelete": "no action",
2978
+ "onUpdate": "no action"
2979
+ },
2980
+ "issues_checkout_run_id_heartbeat_runs_id_fk": {
2981
+ "name": "issues_checkout_run_id_heartbeat_runs_id_fk",
2982
+ "tableFrom": "issues",
2983
+ "tableTo": "heartbeat_runs",
2984
+ "columnsFrom": [
2985
+ "checkout_run_id"
2986
+ ],
2987
+ "columnsTo": [
2988
+ "id"
2989
+ ],
2990
+ "onDelete": "set null",
2991
+ "onUpdate": "no action"
2992
+ },
2993
+ "issues_execution_run_id_heartbeat_runs_id_fk": {
2994
+ "name": "issues_execution_run_id_heartbeat_runs_id_fk",
2995
+ "tableFrom": "issues",
2996
+ "tableTo": "heartbeat_runs",
2997
+ "columnsFrom": [
2998
+ "execution_run_id"
2999
+ ],
3000
+ "columnsTo": [
3001
+ "id"
3002
+ ],
3003
+ "onDelete": "set null",
3004
+ "onUpdate": "no action"
3005
+ },
3006
+ "issues_created_by_agent_id_agents_id_fk": {
3007
+ "name": "issues_created_by_agent_id_agents_id_fk",
3008
+ "tableFrom": "issues",
3009
+ "tableTo": "agents",
3010
+ "columnsFrom": [
3011
+ "created_by_agent_id"
3012
+ ],
3013
+ "columnsTo": [
3014
+ "id"
3015
+ ],
3016
+ "onDelete": "no action",
3017
+ "onUpdate": "no action"
3018
+ }
3019
+ },
3020
+ "compositePrimaryKeys": {},
3021
+ "uniqueConstraints": {},
3022
+ "policies": {},
3023
+ "checkConstraints": {},
3024
+ "isRLSEnabled": false
3025
+ },
3026
+ "public.project_workspaces": {
3027
+ "name": "project_workspaces",
3028
+ "schema": "",
3029
+ "columns": {
3030
+ "id": {
3031
+ "name": "id",
3032
+ "type": "uuid",
3033
+ "primaryKey": true,
3034
+ "notNull": true,
3035
+ "default": "gen_random_uuid()"
3036
+ },
3037
+ "company_id": {
3038
+ "name": "company_id",
3039
+ "type": "uuid",
3040
+ "primaryKey": false,
3041
+ "notNull": true
3042
+ },
3043
+ "project_id": {
3044
+ "name": "project_id",
3045
+ "type": "uuid",
3046
+ "primaryKey": false,
3047
+ "notNull": true
3048
+ },
3049
+ "name": {
3050
+ "name": "name",
3051
+ "type": "text",
3052
+ "primaryKey": false,
3053
+ "notNull": true
3054
+ },
3055
+ "source_type": {
3056
+ "name": "source_type",
3057
+ "type": "text",
3058
+ "primaryKey": false,
3059
+ "notNull": true,
3060
+ "default": "'local_path'"
3061
+ },
3062
+ "cwd": {
3063
+ "name": "cwd",
3064
+ "type": "text",
3065
+ "primaryKey": false,
3066
+ "notNull": false
3067
+ },
3068
+ "repo_url": {
3069
+ "name": "repo_url",
3070
+ "type": "text",
3071
+ "primaryKey": false,
3072
+ "notNull": false
3073
+ },
3074
+ "repo_ref": {
3075
+ "name": "repo_ref",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": false
3079
+ },
3080
+ "default_ref": {
3081
+ "name": "default_ref",
3082
+ "type": "text",
3083
+ "primaryKey": false,
3084
+ "notNull": false
3085
+ },
3086
+ "visibility": {
3087
+ "name": "visibility",
3088
+ "type": "text",
3089
+ "primaryKey": false,
3090
+ "notNull": true,
3091
+ "default": "'default'"
3092
+ },
3093
+ "setup_command": {
3094
+ "name": "setup_command",
3095
+ "type": "text",
3096
+ "primaryKey": false,
3097
+ "notNull": false
3098
+ },
3099
+ "cleanup_command": {
3100
+ "name": "cleanup_command",
3101
+ "type": "text",
3102
+ "primaryKey": false,
3103
+ "notNull": false
3104
+ },
3105
+ "remote_provider": {
3106
+ "name": "remote_provider",
3107
+ "type": "text",
3108
+ "primaryKey": false,
3109
+ "notNull": false
3110
+ },
3111
+ "remote_workspace_ref": {
3112
+ "name": "remote_workspace_ref",
3113
+ "type": "text",
3114
+ "primaryKey": false,
3115
+ "notNull": false
3116
+ },
3117
+ "shared_workspace_key": {
3118
+ "name": "shared_workspace_key",
3119
+ "type": "text",
3120
+ "primaryKey": false,
3121
+ "notNull": false
3122
+ },
3123
+ "metadata": {
3124
+ "name": "metadata",
3125
+ "type": "jsonb",
3126
+ "primaryKey": false,
3127
+ "notNull": false
3128
+ },
3129
+ "is_primary": {
3130
+ "name": "is_primary",
3131
+ "type": "boolean",
3132
+ "primaryKey": false,
3133
+ "notNull": true,
3134
+ "default": false
3135
+ },
3136
+ "created_at": {
3137
+ "name": "created_at",
3138
+ "type": "timestamp with time zone",
3139
+ "primaryKey": false,
3140
+ "notNull": true,
3141
+ "default": "now()"
3142
+ },
3143
+ "updated_at": {
3144
+ "name": "updated_at",
3145
+ "type": "timestamp with time zone",
3146
+ "primaryKey": false,
3147
+ "notNull": true,
3148
+ "default": "now()"
3149
+ }
3150
+ },
3151
+ "indexes": {
3152
+ "project_workspaces_company_project_idx": {
3153
+ "name": "project_workspaces_company_project_idx",
3154
+ "columns": [
3155
+ {
3156
+ "expression": "company_id",
3157
+ "isExpression": false,
3158
+ "asc": true,
3159
+ "nulls": "last"
3160
+ },
3161
+ {
3162
+ "expression": "project_id",
3163
+ "isExpression": false,
3164
+ "asc": true,
3165
+ "nulls": "last"
3166
+ }
3167
+ ],
3168
+ "isUnique": false,
3169
+ "concurrently": false,
3170
+ "method": "btree",
3171
+ "with": {}
3172
+ },
3173
+ "project_workspaces_project_primary_idx": {
3174
+ "name": "project_workspaces_project_primary_idx",
3175
+ "columns": [
3176
+ {
3177
+ "expression": "project_id",
3178
+ "isExpression": false,
3179
+ "asc": true,
3180
+ "nulls": "last"
3181
+ },
3182
+ {
3183
+ "expression": "is_primary",
3184
+ "isExpression": false,
3185
+ "asc": true,
3186
+ "nulls": "last"
3187
+ }
3188
+ ],
3189
+ "isUnique": false,
3190
+ "concurrently": false,
3191
+ "method": "btree",
3192
+ "with": {}
3193
+ },
3194
+ "project_workspaces_project_source_type_idx": {
3195
+ "name": "project_workspaces_project_source_type_idx",
3196
+ "columns": [
3197
+ {
3198
+ "expression": "project_id",
3199
+ "isExpression": false,
3200
+ "asc": true,
3201
+ "nulls": "last"
3202
+ },
3203
+ {
3204
+ "expression": "source_type",
3205
+ "isExpression": false,
3206
+ "asc": true,
3207
+ "nulls": "last"
3208
+ }
3209
+ ],
3210
+ "isUnique": false,
3211
+ "concurrently": false,
3212
+ "method": "btree",
3213
+ "with": {}
3214
+ },
3215
+ "project_workspaces_company_shared_key_idx": {
3216
+ "name": "project_workspaces_company_shared_key_idx",
3217
+ "columns": [
3218
+ {
3219
+ "expression": "company_id",
3220
+ "isExpression": false,
3221
+ "asc": true,
3222
+ "nulls": "last"
3223
+ },
3224
+ {
3225
+ "expression": "shared_workspace_key",
3226
+ "isExpression": false,
3227
+ "asc": true,
3228
+ "nulls": "last"
3229
+ }
3230
+ ],
3231
+ "isUnique": false,
3232
+ "concurrently": false,
3233
+ "method": "btree",
3234
+ "with": {}
3235
+ },
3236
+ "project_workspaces_project_remote_ref_idx": {
3237
+ "name": "project_workspaces_project_remote_ref_idx",
3238
+ "columns": [
3239
+ {
3240
+ "expression": "project_id",
3241
+ "isExpression": false,
3242
+ "asc": true,
3243
+ "nulls": "last"
3244
+ },
3245
+ {
3246
+ "expression": "remote_provider",
3247
+ "isExpression": false,
3248
+ "asc": true,
3249
+ "nulls": "last"
3250
+ },
3251
+ {
3252
+ "expression": "remote_workspace_ref",
3253
+ "isExpression": false,
3254
+ "asc": true,
3255
+ "nulls": "last"
3256
+ }
3257
+ ],
3258
+ "isUnique": true,
3259
+ "concurrently": false,
3260
+ "method": "btree",
3261
+ "with": {}
3262
+ }
3263
+ },
3264
+ "foreignKeys": {
3265
+ "project_workspaces_company_id_companies_id_fk": {
3266
+ "name": "project_workspaces_company_id_companies_id_fk",
3267
+ "tableFrom": "project_workspaces",
3268
+ "tableTo": "companies",
3269
+ "columnsFrom": [
3270
+ "company_id"
3271
+ ],
3272
+ "columnsTo": [
3273
+ "id"
3274
+ ],
3275
+ "onDelete": "no action",
3276
+ "onUpdate": "no action"
3277
+ },
3278
+ "project_workspaces_project_id_projects_id_fk": {
3279
+ "name": "project_workspaces_project_id_projects_id_fk",
3280
+ "tableFrom": "project_workspaces",
3281
+ "tableTo": "projects",
3282
+ "columnsFrom": [
3283
+ "project_id"
3284
+ ],
3285
+ "columnsTo": [
3286
+ "id"
3287
+ ],
3288
+ "onDelete": "cascade",
3289
+ "onUpdate": "no action"
3290
+ }
3291
+ },
3292
+ "compositePrimaryKeys": {},
3293
+ "uniqueConstraints": {},
3294
+ "policies": {},
3295
+ "checkConstraints": {},
3296
+ "isRLSEnabled": false
3297
+ },
3298
+ "public.projects": {
3299
+ "name": "projects",
3300
+ "schema": "",
3301
+ "columns": {
3302
+ "id": {
3303
+ "name": "id",
3304
+ "type": "uuid",
3305
+ "primaryKey": true,
3306
+ "notNull": true,
3307
+ "default": "gen_random_uuid()"
3308
+ },
3309
+ "company_id": {
3310
+ "name": "company_id",
3311
+ "type": "uuid",
3312
+ "primaryKey": false,
3313
+ "notNull": true
3314
+ },
3315
+ "goal_id": {
3316
+ "name": "goal_id",
3317
+ "type": "uuid",
3318
+ "primaryKey": false,
3319
+ "notNull": false
3320
+ },
3321
+ "name": {
3322
+ "name": "name",
3323
+ "type": "text",
3324
+ "primaryKey": false,
3325
+ "notNull": true
3326
+ },
3327
+ "description": {
3328
+ "name": "description",
3329
+ "type": "text",
3330
+ "primaryKey": false,
3331
+ "notNull": false
3332
+ },
3333
+ "status": {
3334
+ "name": "status",
3335
+ "type": "text",
3336
+ "primaryKey": false,
3337
+ "notNull": true,
3338
+ "default": "'backlog'"
3339
+ },
3340
+ "lead_agent_id": {
3341
+ "name": "lead_agent_id",
3342
+ "type": "uuid",
3343
+ "primaryKey": false,
3344
+ "notNull": false
3345
+ },
3346
+ "target_date": {
3347
+ "name": "target_date",
3348
+ "type": "date",
3349
+ "primaryKey": false,
3350
+ "notNull": false
3351
+ },
3352
+ "color": {
3353
+ "name": "color",
3354
+ "type": "text",
3355
+ "primaryKey": false,
3356
+ "notNull": false
3357
+ },
3358
+ "env": {
3359
+ "name": "env",
3360
+ "type": "jsonb",
3361
+ "primaryKey": false,
3362
+ "notNull": false
3363
+ },
3364
+ "pause_reason": {
3365
+ "name": "pause_reason",
3366
+ "type": "text",
3367
+ "primaryKey": false,
3368
+ "notNull": false
3369
+ },
3370
+ "paused_at": {
3371
+ "name": "paused_at",
3372
+ "type": "timestamp with time zone",
3373
+ "primaryKey": false,
3374
+ "notNull": false
3375
+ },
3376
+ "execution_workspace_policy": {
3377
+ "name": "execution_workspace_policy",
3378
+ "type": "jsonb",
3379
+ "primaryKey": false,
3380
+ "notNull": false
3381
+ },
3382
+ "archived_at": {
3383
+ "name": "archived_at",
3384
+ "type": "timestamp with time zone",
3385
+ "primaryKey": false,
3386
+ "notNull": false
3387
+ },
3388
+ "created_at": {
3389
+ "name": "created_at",
3390
+ "type": "timestamp with time zone",
3391
+ "primaryKey": false,
3392
+ "notNull": true,
3393
+ "default": "now()"
3394
+ },
3395
+ "updated_at": {
3396
+ "name": "updated_at",
3397
+ "type": "timestamp with time zone",
3398
+ "primaryKey": false,
3399
+ "notNull": true,
3400
+ "default": "now()"
3401
+ }
3402
+ },
3403
+ "indexes": {
3404
+ "projects_company_idx": {
3405
+ "name": "projects_company_idx",
3406
+ "columns": [
3407
+ {
3408
+ "expression": "company_id",
3409
+ "isExpression": false,
3410
+ "asc": true,
3411
+ "nulls": "last"
3412
+ }
3413
+ ],
3414
+ "isUnique": false,
3415
+ "concurrently": false,
3416
+ "method": "btree",
3417
+ "with": {}
3418
+ }
3419
+ },
3420
+ "foreignKeys": {
3421
+ "projects_company_id_companies_id_fk": {
3422
+ "name": "projects_company_id_companies_id_fk",
3423
+ "tableFrom": "projects",
3424
+ "tableTo": "companies",
3425
+ "columnsFrom": [
3426
+ "company_id"
3427
+ ],
3428
+ "columnsTo": [
3429
+ "id"
3430
+ ],
3431
+ "onDelete": "no action",
3432
+ "onUpdate": "no action"
3433
+ },
3434
+ "projects_lead_agent_id_agents_id_fk": {
3435
+ "name": "projects_lead_agent_id_agents_id_fk",
3436
+ "tableFrom": "projects",
3437
+ "tableTo": "agents",
3438
+ "columnsFrom": [
3439
+ "lead_agent_id"
3440
+ ],
3441
+ "columnsTo": [
3442
+ "id"
3443
+ ],
3444
+ "onDelete": "no action",
3445
+ "onUpdate": "no action"
3446
+ }
3447
+ },
3448
+ "compositePrimaryKeys": {},
3449
+ "uniqueConstraints": {},
3450
+ "policies": {},
3451
+ "checkConstraints": {},
3452
+ "isRLSEnabled": false
3453
+ }
3454
+ },
3455
+ "enums": {},
3456
+ "schemas": {},
3457
+ "sequences": {},
3458
+ "roles": {},
3459
+ "policies": {},
3460
+ "views": {},
3461
+ "_meta": {
3462
+ "columns": {},
3463
+ "schemas": {},
3464
+ "tables": {}
3465
+ }
3466
+ }