@intx/db 0.1.2 → 0.3.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 (241) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +23 -4
  3. package/dist/approval-store.d.ts +52 -0
  4. package/dist/approval-store.js +79 -0
  5. package/dist/asset-resolution.d.ts +52 -0
  6. package/dist/asset-resolution.js +66 -0
  7. package/dist/catalog-resolution.d.ts +76 -0
  8. package/dist/catalog-resolution.js +151 -0
  9. package/dist/client.d.ts +19 -0
  10. package/dist/client.js +18 -0
  11. package/dist/config.d.ts +11 -0
  12. package/dist/config.js +16 -0
  13. package/dist/connection.d.ts +3 -0
  14. package/dist/connection.js +26 -0
  15. package/dist/credential-resolution.d.ts +222 -0
  16. package/dist/credential-resolution.js +255 -0
  17. package/dist/grant-store.d.ts +3 -0
  18. package/dist/grant-store.js +59 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.js +20 -0
  21. package/dist/migrate.d.ts +36 -0
  22. package/dist/migrate.js +135 -0
  23. package/dist/model-source-resolution.d.ts +115 -0
  24. package/dist/model-source-resolution.js +291 -0
  25. package/dist/parse-row.d.ts +373 -0
  26. package/dist/parse-row.js +232 -0
  27. package/dist/pg-error.d.ts +3 -0
  28. package/dist/pg-error.js +19 -0
  29. package/dist/pricing.d.ts +15 -0
  30. package/dist/pricing.js +24 -0
  31. package/dist/rekey-credential-secrets.d.ts +13 -0
  32. package/dist/rekey-credential-secrets.js +61 -0
  33. package/dist/schema/approvals.d.ts +245 -0
  34. package/dist/schema/approvals.js +52 -0
  35. package/dist/schema/assets.d.ts +143 -0
  36. package/{src/schema/assets.ts → dist/schema/assets.js} +7 -16
  37. package/dist/schema/auth.d.ts +606 -0
  38. package/dist/schema/auth.js +47 -0
  39. package/dist/schema/catalog.d.ts +811 -0
  40. package/dist/schema/catalog.js +108 -0
  41. package/dist/schema/column-types.d.ts +26 -0
  42. package/dist/schema/column-types.js +15 -0
  43. package/dist/schema/credentials.d.ts +305 -0
  44. package/{src/schema/credentials.ts → dist/schema/credentials.js} +16 -22
  45. package/dist/schema/git-tokens.d.ts +256 -0
  46. package/{src/schema/git-tokens.ts → dist/schema/git-tokens.js} +16 -39
  47. package/dist/schema/grants.d.ts +211 -0
  48. package/dist/schema/grants.js +30 -0
  49. package/dist/schema/index.d.ts +25 -0
  50. package/dist/schema/index.js +25 -0
  51. package/dist/schema/messages.d.ts +414 -0
  52. package/dist/schema/messages.js +82 -0
  53. package/dist/schema/oauth-clients.d.ts +246 -0
  54. package/{src/schema/oauth-clients.ts → dist/schema/oauth-clients.js} +8 -14
  55. package/dist/schema/offerings.d.ts +160 -0
  56. package/dist/schema/offerings.js +24 -0
  57. package/dist/schema/principals.d.ts +128 -0
  58. package/dist/schema/principals.js +23 -0
  59. package/dist/schema/providers.d.ts +237 -0
  60. package/dist/schema/providers.js +22 -0
  61. package/dist/schema/roles.d.ts +242 -0
  62. package/dist/schema/roles.js +37 -0
  63. package/dist/schema/session-assets.d.ts +92 -0
  64. package/dist/schema/session-assets.js +45 -0
  65. package/dist/schema/sessions.d.ts +143 -0
  66. package/dist/schema/sessions.js +29 -0
  67. package/dist/schema/sidecar-allocation.d.ts +406 -0
  68. package/dist/schema/sidecar-allocation.js +57 -0
  69. package/dist/schema/sidecar.d.ts +145 -0
  70. package/dist/schema/sidecar.js +28 -0
  71. package/dist/schema/signal-correlations.d.ts +177 -0
  72. package/dist/schema/signal-correlations.js +31 -0
  73. package/dist/schema/tenants.d.ts +235 -0
  74. package/{src/schema/tenants.ts → dist/schema/tenants.js} +10 -27
  75. package/dist/schema/wallets.d.ts +354 -0
  76. package/dist/schema/wallets.js +43 -0
  77. package/dist/schema/workflow-definitions.d.ts +371 -0
  78. package/dist/schema/workflow-definitions.js +97 -0
  79. package/dist/schema/workflow-run-dispatch.d.ts +328 -0
  80. package/dist/schema/workflow-run-dispatch.js +56 -0
  81. package/dist/schema/workflow-run-execution.d.ts +126 -0
  82. package/dist/schema/workflow-run-execution.js +48 -0
  83. package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
  84. package/dist/schema/workflow-run-launch-spec.js +26 -0
  85. package/dist/schema/workflow-run.d.ts +230 -0
  86. package/dist/schema/workflow-run.js +102 -0
  87. package/dist/sidecar-allocation-store.d.ts +171 -0
  88. package/dist/sidecar-allocation-store.js +512 -0
  89. package/dist/signal-correlation-store.d.ts +36 -0
  90. package/dist/signal-correlation-store.js +63 -0
  91. package/dist/tenant-hierarchy.d.ts +23 -0
  92. package/dist/tenant-hierarchy.js +60 -0
  93. package/dist/workflow-definition-store.d.ts +55 -0
  94. package/dist/workflow-definition-store.js +93 -0
  95. package/dist/workflow-run-dispatch-store.d.ts +80 -0
  96. package/dist/workflow-run-dispatch-store.js +298 -0
  97. package/dist/workflow-run-launch-spec-store.d.ts +13 -0
  98. package/dist/workflow-run-launch-spec-store.js +30 -0
  99. package/dist/workflow-run-store.d.ts +54 -0
  100. package/dist/workflow-run-store.js +85 -0
  101. package/migrations/0029_loose_warlock.sql +1 -0
  102. package/migrations/0030_session_asset_audit_split.sql +5 -0
  103. package/migrations/0031_gigantic_nicolaos.sql +68 -0
  104. package/migrations/0032_lethal_misty_knight.sql +1 -0
  105. package/migrations/0033_old_payback.sql +1 -0
  106. package/migrations/0034_sleepy_songbird.sql +11 -0
  107. package/migrations/0035_violet_giant_man.sql +3 -0
  108. package/migrations/0036_sharp_the_executioner.sql +2 -0
  109. package/migrations/0037_credential_use_backfill.sql +39 -0
  110. package/migrations/0038_chilly_blacklash.sql +37 -0
  111. package/migrations/0039_quick_carnage.sql +2 -0
  112. package/migrations/0040_reshape_approval_origin.sql +24 -0
  113. package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
  114. package/migrations/0042_youthful_mantis.sql +2 -0
  115. package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
  116. package/migrations/0044_model_offering_quirks.sql +1 -0
  117. package/migrations/0045_create_workflow_run.sql +13 -0
  118. package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
  119. package/migrations/0047_create_workflow_definition.sql +30 -0
  120. package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
  121. package/migrations/0049_curly_omega_flight.sql +2 -0
  122. package/migrations/0050_late_crystal.sql +10 -0
  123. package/migrations/0051_funny_madelyne_pryor.sql +1 -0
  124. package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
  125. package/migrations/0053_session_mail_session_id_index.sql +1 -0
  126. package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
  127. package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
  128. package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
  129. package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
  130. package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
  131. package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
  132. package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
  133. package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
  134. package/migrations/0062_drop_agent_asset_table.sql +11 -0
  135. package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
  136. package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
  137. package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
  138. package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
  139. package/migrations/0067_add_workflow_definition_kind.sql +10 -0
  140. package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
  141. package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
  142. package/migrations/0070_flashy_proteus.sql +13 -0
  143. package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
  144. package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
  145. package/migrations/0074_add_provider_api_base_url.sql +1 -0
  146. package/migrations/0075_workflow_run_launch_spec.sql +17 -0
  147. package/migrations/0076_sidecar_allocation.sql +40 -0
  148. package/migrations/0077_workflow_run_dispatch.sql +29 -0
  149. package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
  150. package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
  151. package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
  152. package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
  153. package/migrations/0082_blue_black_queen.sql +1 -0
  154. package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
  155. package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
  156. package/migrations/meta/0029_snapshot.json +2664 -0
  157. package/migrations/meta/0030_snapshot.json +2670 -0
  158. package/migrations/meta/0031_snapshot.json +3100 -0
  159. package/migrations/meta/0032_snapshot.json +3106 -0
  160. package/migrations/meta/0033_snapshot.json +3112 -0
  161. package/migrations/meta/0034_snapshot.json +3198 -0
  162. package/migrations/meta/0035_snapshot.json +3225 -0
  163. package/migrations/meta/0036_snapshot.json +3237 -0
  164. package/migrations/meta/0037_snapshot.json +3237 -0
  165. package/migrations/meta/0038_snapshot.json +3470 -0
  166. package/migrations/meta/0039_snapshot.json +3470 -0
  167. package/migrations/meta/0040_snapshot.json +3489 -0
  168. package/migrations/meta/0041_snapshot.json +3489 -0
  169. package/migrations/meta/0042_snapshot.json +3489 -0
  170. package/migrations/meta/0043_snapshot.json +3498 -0
  171. package/migrations/meta/0044_snapshot.json +3504 -0
  172. package/migrations/meta/0045_snapshot.json +3589 -0
  173. package/migrations/meta/0046_snapshot.json +3607 -0
  174. package/migrations/meta/0047_snapshot.json +3832 -0
  175. package/migrations/meta/0048_snapshot.json +3853 -0
  176. package/migrations/meta/0049_snapshot.json +3854 -0
  177. package/migrations/meta/0050_snapshot.json +3924 -0
  178. package/migrations/meta/0051_snapshot.json +3940 -0
  179. package/migrations/meta/0052_snapshot.json +3931 -0
  180. package/migrations/meta/0053_snapshot.json +3952 -0
  181. package/migrations/meta/0054_snapshot.json +3952 -0
  182. package/migrations/meta/0055_snapshot.json +3952 -0
  183. package/migrations/meta/0056_snapshot.json +3952 -0
  184. package/migrations/meta/0057_snapshot.json +3839 -0
  185. package/migrations/meta/0058_snapshot.json +3839 -0
  186. package/migrations/meta/0059_snapshot.json +3839 -0
  187. package/migrations/meta/0060_snapshot.json +3830 -0
  188. package/migrations/meta/0061_snapshot.json +3821 -0
  189. package/migrations/meta/0062_snapshot.json +3723 -0
  190. package/migrations/meta/0063_snapshot.json +3723 -0
  191. package/migrations/meta/0064_snapshot.json +3723 -0
  192. package/migrations/meta/0065_snapshot.json +3729 -0
  193. package/migrations/meta/0066_snapshot.json +3729 -0
  194. package/migrations/meta/0067_snapshot.json +3736 -0
  195. package/migrations/meta/0068_snapshot.json +3347 -0
  196. package/migrations/meta/0069_snapshot.json +3340 -0
  197. package/migrations/meta/0070_snapshot.json +3444 -0
  198. package/migrations/meta/0072_snapshot.json +3450 -0
  199. package/migrations/meta/0073_snapshot.json +3455 -0
  200. package/migrations/meta/0074_snapshot.json +3461 -0
  201. package/migrations/meta/0075_snapshot.json +3567 -0
  202. package/migrations/meta/0076_snapshot.json +3851 -0
  203. package/migrations/meta/0077_snapshot.json +4067 -0
  204. package/migrations/meta/0078_snapshot.json +4078 -0
  205. package/migrations/meta/0079_snapshot.json +4078 -0
  206. package/migrations/meta/0080_snapshot.json +4078 -0
  207. package/migrations/meta/0081_snapshot.json +4096 -0
  208. package/migrations/meta/0082_snapshot.json +4102 -0
  209. package/migrations/meta/0083_snapshot.json +4096 -0
  210. package/migrations/meta/0084_snapshot.json +4096 -0
  211. package/migrations/meta/_journal.json +385 -0
  212. package/package.json +25 -11
  213. package/drizzle.config.ts +0 -23
  214. package/src/client.ts +0 -24
  215. package/src/config.ts +0 -19
  216. package/src/connection.ts +0 -27
  217. package/src/credential-resolution.ts +0 -378
  218. package/src/grant-store.ts +0 -51
  219. package/src/index.ts +0 -32
  220. package/src/migrate.test.ts +0 -35
  221. package/src/migrate.ts +0 -168
  222. package/src/parse-row.test.ts +0 -113
  223. package/src/parse-row.ts +0 -185
  224. package/src/schema/agent-assets.ts +0 -21
  225. package/src/schema/agents.ts +0 -49
  226. package/src/schema/auth.ts +0 -51
  227. package/src/schema/grants.ts +0 -26
  228. package/src/schema/index.ts +0 -19
  229. package/src/schema/instances.ts +0 -36
  230. package/src/schema/messages.ts +0 -108
  231. package/src/schema/offerings.ts +0 -20
  232. package/src/schema/principals.ts +0 -28
  233. package/src/schema/providers.ts +0 -23
  234. package/src/schema/roles.ts +0 -51
  235. package/src/schema/session-assets.ts +0 -49
  236. package/src/schema/sessions.ts +0 -26
  237. package/src/schema/sidecar.ts +0 -14
  238. package/src/schema/wallets.ts +0 -44
  239. package/src/tenant-hierarchy.ts +0 -34
  240. package/tsconfig.json +0 -4
  241. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,3455 @@
1
+ {
2
+ "id": "b1846c3b-7b3a-4507-84e5-2ebdd2fbb498",
3
+ "prevId": "26d55ac6-8946-46f5-b055-3b90997381fd",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_workflow_definition_id_fk": {
557
+ "name": "agent_role_agent_id_workflow_definition_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "tableTo": "workflow_definition",
560
+ "columnsFrom": ["agent_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "agent_role_agent_id_role_id_pk": {
577
+ "name": "agent_role_agent_id_role_id_pk",
578
+ "columns": ["agent_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.principal_role": {
587
+ "name": "principal_role",
588
+ "schema": "",
589
+ "columns": {
590
+ "principal_id": {
591
+ "name": "principal_id",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "role_id": {
597
+ "name": "role_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "principal_role_principal_id_principal_id_fk": {
613
+ "name": "principal_role_principal_id_principal_id_fk",
614
+ "tableFrom": "principal_role",
615
+ "tableTo": "principal",
616
+ "columnsFrom": ["principal_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "tableTo": "role",
625
+ "columnsFrom": ["role_id"],
626
+ "columnsTo": ["id"],
627
+ "onDelete": "cascade",
628
+ "onUpdate": "no action"
629
+ }
630
+ },
631
+ "compositePrimaryKeys": {
632
+ "principal_role_principal_id_role_id_pk": {
633
+ "name": "principal_role_principal_id_role_id_pk",
634
+ "columns": ["principal_id", "role_id"]
635
+ }
636
+ },
637
+ "uniqueConstraints": {},
638
+ "policies": {},
639
+ "checkConstraints": {},
640
+ "isRLSEnabled": false
641
+ },
642
+ "public.role": {
643
+ "name": "role",
644
+ "schema": "",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "name": {
659
+ "name": "name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "is_system": {
671
+ "name": "is_system",
672
+ "type": "boolean",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": false
676
+ },
677
+ "created_at": {
678
+ "name": "created_at",
679
+ "type": "timestamp",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "default": "now()"
683
+ },
684
+ "updated_at": {
685
+ "name": "updated_at",
686
+ "type": "timestamp",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "default": "now()"
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {
694
+ "role_tenant_id_tenant_id_fk": {
695
+ "name": "role_tenant_id_tenant_id_fk",
696
+ "tableFrom": "role",
697
+ "tableTo": "tenant",
698
+ "columnsFrom": ["tenant_id"],
699
+ "columnsTo": ["id"],
700
+ "onDelete": "cascade",
701
+ "onUpdate": "no action"
702
+ }
703
+ },
704
+ "compositePrimaryKeys": {},
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.grant": {
711
+ "name": "grant",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true
719
+ },
720
+ "tenant_id": {
721
+ "name": "tenant_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "role_id": {
727
+ "name": "role_id",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "principal_id": {
733
+ "name": "principal_id",
734
+ "type": "text",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "resource": {
739
+ "name": "resource",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "action": {
745
+ "name": "action",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "effect": {
751
+ "name": "effect",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "conditions": {
757
+ "name": "conditions",
758
+ "type": "jsonb",
759
+ "primaryKey": false,
760
+ "notNull": false
761
+ },
762
+ "origin": {
763
+ "name": "origin",
764
+ "type": "text",
765
+ "primaryKey": false,
766
+ "notNull": true
767
+ },
768
+ "expires_at": {
769
+ "name": "expires_at",
770
+ "type": "timestamp",
771
+ "primaryKey": false,
772
+ "notNull": false
773
+ },
774
+ "created_at": {
775
+ "name": "created_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ },
781
+ "updated_at": {
782
+ "name": "updated_at",
783
+ "type": "timestamp",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "now()"
787
+ }
788
+ },
789
+ "indexes": {},
790
+ "foreignKeys": {
791
+ "grant_tenant_id_tenant_id_fk": {
792
+ "name": "grant_tenant_id_tenant_id_fk",
793
+ "tableFrom": "grant",
794
+ "tableTo": "tenant",
795
+ "columnsFrom": ["tenant_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "tableTo": "role",
804
+ "columnsFrom": ["role_id"],
805
+ "columnsTo": ["id"],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "tableTo": "principal",
813
+ "columnsFrom": ["principal_id"],
814
+ "columnsTo": ["id"],
815
+ "onDelete": "cascade",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {
823
+ "grant_target_exactly_one": {
824
+ "name": "grant_target_exactly_one",
825
+ "value": "num_nonnulls(\"grant\".\"principal_id\", \"grant\".\"role_id\") = 1"
826
+ }
827
+ },
828
+ "isRLSEnabled": false
829
+ },
830
+ "public.approval": {
831
+ "name": "approval",
832
+ "schema": "",
833
+ "columns": {
834
+ "id": {
835
+ "name": "id",
836
+ "type": "text",
837
+ "primaryKey": true,
838
+ "notNull": true
839
+ },
840
+ "tenant_id": {
841
+ "name": "tenant_id",
842
+ "type": "text",
843
+ "primaryKey": false,
844
+ "notNull": true
845
+ },
846
+ "deployment_id": {
847
+ "name": "deployment_id",
848
+ "type": "text",
849
+ "primaryKey": false,
850
+ "notNull": true
851
+ },
852
+ "run_id": {
853
+ "name": "run_id",
854
+ "type": "text",
855
+ "primaryKey": false,
856
+ "notNull": true
857
+ },
858
+ "agent_address": {
859
+ "name": "agent_address",
860
+ "type": "text",
861
+ "primaryKey": false,
862
+ "notNull": true
863
+ },
864
+ "correlation_id": {
865
+ "name": "correlation_id",
866
+ "type": "text",
867
+ "primaryKey": false,
868
+ "notNull": true
869
+ },
870
+ "tool_definition": {
871
+ "name": "tool_definition",
872
+ "type": "jsonb",
873
+ "primaryKey": false,
874
+ "notNull": true
875
+ },
876
+ "tool_arguments": {
877
+ "name": "tool_arguments",
878
+ "type": "jsonb",
879
+ "primaryKey": false,
880
+ "notNull": true
881
+ },
882
+ "scope": {
883
+ "name": "scope",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": false
887
+ },
888
+ "status": {
889
+ "name": "status",
890
+ "type": "text",
891
+ "primaryKey": false,
892
+ "notNull": true,
893
+ "default": "'pending'"
894
+ },
895
+ "timeout_at": {
896
+ "name": "timeout_at",
897
+ "type": "timestamp",
898
+ "primaryKey": false,
899
+ "notNull": false
900
+ },
901
+ "resolved_at": {
902
+ "name": "resolved_at",
903
+ "type": "timestamp",
904
+ "primaryKey": false,
905
+ "notNull": false
906
+ },
907
+ "created_at": {
908
+ "name": "created_at",
909
+ "type": "timestamp",
910
+ "primaryKey": false,
911
+ "notNull": true,
912
+ "default": "now()"
913
+ },
914
+ "updated_at": {
915
+ "name": "updated_at",
916
+ "type": "timestamp",
917
+ "primaryKey": false,
918
+ "notNull": true,
919
+ "default": "now()"
920
+ }
921
+ },
922
+ "indexes": {
923
+ "approval_tenant_status_idx": {
924
+ "name": "approval_tenant_status_idx",
925
+ "columns": [
926
+ {
927
+ "expression": "tenant_id",
928
+ "isExpression": false,
929
+ "asc": true,
930
+ "nulls": "last"
931
+ },
932
+ {
933
+ "expression": "status",
934
+ "isExpression": false,
935
+ "asc": true,
936
+ "nulls": "last"
937
+ },
938
+ {
939
+ "expression": "created_at",
940
+ "isExpression": false,
941
+ "asc": true,
942
+ "nulls": "last"
943
+ }
944
+ ],
945
+ "isUnique": false,
946
+ "concurrently": false,
947
+ "method": "btree",
948
+ "with": {}
949
+ },
950
+ "approval_deployment_idx": {
951
+ "name": "approval_deployment_idx",
952
+ "columns": [
953
+ {
954
+ "expression": "deployment_id",
955
+ "isExpression": false,
956
+ "asc": true,
957
+ "nulls": "last"
958
+ }
959
+ ],
960
+ "isUnique": false,
961
+ "concurrently": false,
962
+ "method": "btree",
963
+ "with": {}
964
+ }
965
+ },
966
+ "foreignKeys": {
967
+ "approval_tenant_id_tenant_id_fk": {
968
+ "name": "approval_tenant_id_tenant_id_fk",
969
+ "tableFrom": "approval",
970
+ "tableTo": "tenant",
971
+ "columnsFrom": ["tenant_id"],
972
+ "columnsTo": ["id"],
973
+ "onDelete": "cascade",
974
+ "onUpdate": "no action"
975
+ },
976
+ "approval_deployment_id_workflow_run_id_fk": {
977
+ "name": "approval_deployment_id_workflow_run_id_fk",
978
+ "tableFrom": "approval",
979
+ "tableTo": "workflow_run",
980
+ "columnsFrom": ["deployment_id"],
981
+ "columnsTo": ["id"],
982
+ "onDelete": "cascade",
983
+ "onUpdate": "no action"
984
+ },
985
+ "approval_run_id_workflow_run_id_fk": {
986
+ "name": "approval_run_id_workflow_run_id_fk",
987
+ "tableFrom": "approval",
988
+ "tableTo": "workflow_run",
989
+ "columnsFrom": ["run_id"],
990
+ "columnsTo": ["id"],
991
+ "onDelete": "cascade",
992
+ "onUpdate": "no action"
993
+ }
994
+ },
995
+ "compositePrimaryKeys": {},
996
+ "uniqueConstraints": {
997
+ "approval_correlation_id_unique": {
998
+ "name": "approval_correlation_id_unique",
999
+ "nullsNotDistinct": false,
1000
+ "columns": ["correlation_id"]
1001
+ }
1002
+ },
1003
+ "policies": {},
1004
+ "checkConstraints": {},
1005
+ "isRLSEnabled": false
1006
+ },
1007
+ "public.signal_correlation": {
1008
+ "name": "signal_correlation",
1009
+ "schema": "",
1010
+ "columns": {
1011
+ "correlation_id": {
1012
+ "name": "correlation_id",
1013
+ "type": "text",
1014
+ "primaryKey": true,
1015
+ "notNull": true
1016
+ },
1017
+ "tenant_id": {
1018
+ "name": "tenant_id",
1019
+ "type": "text",
1020
+ "primaryKey": false,
1021
+ "notNull": true
1022
+ },
1023
+ "deployment_id": {
1024
+ "name": "deployment_id",
1025
+ "type": "text",
1026
+ "primaryKey": false,
1027
+ "notNull": true
1028
+ },
1029
+ "agent_address": {
1030
+ "name": "agent_address",
1031
+ "type": "text",
1032
+ "primaryKey": false,
1033
+ "notNull": true
1034
+ },
1035
+ "run_id": {
1036
+ "name": "run_id",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true
1040
+ },
1041
+ "signal_name": {
1042
+ "name": "signal_name",
1043
+ "type": "text",
1044
+ "primaryKey": false,
1045
+ "notNull": true
1046
+ },
1047
+ "kind": {
1048
+ "name": "kind",
1049
+ "type": "text",
1050
+ "primaryKey": false,
1051
+ "notNull": true
1052
+ },
1053
+ "signal_id": {
1054
+ "name": "signal_id",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": false
1058
+ },
1059
+ "resolved_at": {
1060
+ "name": "resolved_at",
1061
+ "type": "timestamp",
1062
+ "primaryKey": false,
1063
+ "notNull": false
1064
+ },
1065
+ "created_at": {
1066
+ "name": "created_at",
1067
+ "type": "timestamp",
1068
+ "primaryKey": false,
1069
+ "notNull": true,
1070
+ "default": "now()"
1071
+ }
1072
+ },
1073
+ "indexes": {},
1074
+ "foreignKeys": {
1075
+ "signal_correlation_tenant_id_tenant_id_fk": {
1076
+ "name": "signal_correlation_tenant_id_tenant_id_fk",
1077
+ "tableFrom": "signal_correlation",
1078
+ "tableTo": "tenant",
1079
+ "columnsFrom": ["tenant_id"],
1080
+ "columnsTo": ["id"],
1081
+ "onDelete": "cascade",
1082
+ "onUpdate": "no action"
1083
+ },
1084
+ "signal_correlation_deployment_id_workflow_run_id_fk": {
1085
+ "name": "signal_correlation_deployment_id_workflow_run_id_fk",
1086
+ "tableFrom": "signal_correlation",
1087
+ "tableTo": "workflow_run",
1088
+ "columnsFrom": ["deployment_id"],
1089
+ "columnsTo": ["id"],
1090
+ "onDelete": "cascade",
1091
+ "onUpdate": "no action"
1092
+ },
1093
+ "signal_correlation_run_id_workflow_run_id_fk": {
1094
+ "name": "signal_correlation_run_id_workflow_run_id_fk",
1095
+ "tableFrom": "signal_correlation",
1096
+ "tableTo": "workflow_run",
1097
+ "columnsFrom": ["run_id"],
1098
+ "columnsTo": ["id"],
1099
+ "onDelete": "cascade",
1100
+ "onUpdate": "no action"
1101
+ }
1102
+ },
1103
+ "compositePrimaryKeys": {},
1104
+ "uniqueConstraints": {},
1105
+ "policies": {},
1106
+ "checkConstraints": {},
1107
+ "isRLSEnabled": false
1108
+ },
1109
+ "public.provider": {
1110
+ "name": "provider",
1111
+ "schema": "",
1112
+ "columns": {
1113
+ "id": {
1114
+ "name": "id",
1115
+ "type": "text",
1116
+ "primaryKey": true,
1117
+ "notNull": true
1118
+ },
1119
+ "tenant_id": {
1120
+ "name": "tenant_id",
1121
+ "type": "text",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "name": {
1126
+ "name": "name",
1127
+ "type": "text",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "plugin": {
1132
+ "name": "plugin",
1133
+ "type": "text",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "authorization_url": {
1138
+ "name": "authorization_url",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": false
1142
+ },
1143
+ "token_url": {
1144
+ "name": "token_url",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": false
1148
+ },
1149
+ "user_info_url": {
1150
+ "name": "user_info_url",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ },
1155
+ "scopes": {
1156
+ "name": "scopes",
1157
+ "type": "text[]",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "metadata": {
1162
+ "name": "metadata",
1163
+ "type": "jsonb",
1164
+ "primaryKey": false,
1165
+ "notNull": false
1166
+ },
1167
+ "created_at": {
1168
+ "name": "created_at",
1169
+ "type": "timestamp",
1170
+ "primaryKey": false,
1171
+ "notNull": true,
1172
+ "default": "now()"
1173
+ },
1174
+ "updated_at": {
1175
+ "name": "updated_at",
1176
+ "type": "timestamp",
1177
+ "primaryKey": false,
1178
+ "notNull": true,
1179
+ "default": "now()"
1180
+ }
1181
+ },
1182
+ "indexes": {},
1183
+ "foreignKeys": {
1184
+ "provider_tenant_id_tenant_id_fk": {
1185
+ "name": "provider_tenant_id_tenant_id_fk",
1186
+ "tableFrom": "provider",
1187
+ "tableTo": "tenant",
1188
+ "columnsFrom": ["tenant_id"],
1189
+ "columnsTo": ["id"],
1190
+ "onDelete": "cascade",
1191
+ "onUpdate": "no action"
1192
+ }
1193
+ },
1194
+ "compositePrimaryKeys": {},
1195
+ "uniqueConstraints": {
1196
+ "provider_tenant_name": {
1197
+ "name": "provider_tenant_name",
1198
+ "nullsNotDistinct": false,
1199
+ "columns": ["tenant_id", "name"]
1200
+ }
1201
+ },
1202
+ "policies": {},
1203
+ "checkConstraints": {},
1204
+ "isRLSEnabled": false
1205
+ },
1206
+ "public.oauth_client": {
1207
+ "name": "oauth_client",
1208
+ "schema": "",
1209
+ "columns": {
1210
+ "id": {
1211
+ "name": "id",
1212
+ "type": "text",
1213
+ "primaryKey": true,
1214
+ "notNull": true
1215
+ },
1216
+ "tenant_id": {
1217
+ "name": "tenant_id",
1218
+ "type": "text",
1219
+ "primaryKey": false,
1220
+ "notNull": true
1221
+ },
1222
+ "provider_id": {
1223
+ "name": "provider_id",
1224
+ "type": "text",
1225
+ "primaryKey": false,
1226
+ "notNull": true
1227
+ },
1228
+ "name": {
1229
+ "name": "name",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": true
1233
+ },
1234
+ "client_id": {
1235
+ "name": "client_id",
1236
+ "type": "text",
1237
+ "primaryKey": false,
1238
+ "notNull": true
1239
+ },
1240
+ "client_secret": {
1241
+ "name": "client_secret",
1242
+ "type": "text",
1243
+ "primaryKey": false,
1244
+ "notNull": true
1245
+ },
1246
+ "redirect_uris": {
1247
+ "name": "redirect_uris",
1248
+ "type": "text[]",
1249
+ "primaryKey": false,
1250
+ "notNull": false
1251
+ },
1252
+ "default_scopes": {
1253
+ "name": "default_scopes",
1254
+ "type": "text[]",
1255
+ "primaryKey": false,
1256
+ "notNull": false
1257
+ },
1258
+ "metadata": {
1259
+ "name": "metadata",
1260
+ "type": "jsonb",
1261
+ "primaryKey": false,
1262
+ "notNull": false
1263
+ },
1264
+ "created_at": {
1265
+ "name": "created_at",
1266
+ "type": "timestamp",
1267
+ "primaryKey": false,
1268
+ "notNull": true,
1269
+ "default": "now()"
1270
+ },
1271
+ "updated_at": {
1272
+ "name": "updated_at",
1273
+ "type": "timestamp",
1274
+ "primaryKey": false,
1275
+ "notNull": true,
1276
+ "default": "now()"
1277
+ }
1278
+ },
1279
+ "indexes": {},
1280
+ "foreignKeys": {
1281
+ "oauth_client_tenant_id_tenant_id_fk": {
1282
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1283
+ "tableFrom": "oauth_client",
1284
+ "tableTo": "tenant",
1285
+ "columnsFrom": ["tenant_id"],
1286
+ "columnsTo": ["id"],
1287
+ "onDelete": "cascade",
1288
+ "onUpdate": "no action"
1289
+ },
1290
+ "oauth_client_provider_id_provider_id_fk": {
1291
+ "name": "oauth_client_provider_id_provider_id_fk",
1292
+ "tableFrom": "oauth_client",
1293
+ "tableTo": "provider",
1294
+ "columnsFrom": ["provider_id"],
1295
+ "columnsTo": ["id"],
1296
+ "onDelete": "cascade",
1297
+ "onUpdate": "no action"
1298
+ }
1299
+ },
1300
+ "compositePrimaryKeys": {},
1301
+ "uniqueConstraints": {
1302
+ "oauth_client_tenant_provider": {
1303
+ "name": "oauth_client_tenant_provider",
1304
+ "nullsNotDistinct": false,
1305
+ "columns": ["tenant_id", "provider_id"]
1306
+ }
1307
+ },
1308
+ "policies": {},
1309
+ "checkConstraints": {},
1310
+ "isRLSEnabled": false
1311
+ },
1312
+ "public.credential": {
1313
+ "name": "credential",
1314
+ "schema": "",
1315
+ "columns": {
1316
+ "id": {
1317
+ "name": "id",
1318
+ "type": "text",
1319
+ "primaryKey": true,
1320
+ "notNull": true
1321
+ },
1322
+ "tenant_id": {
1323
+ "name": "tenant_id",
1324
+ "type": "text",
1325
+ "primaryKey": false,
1326
+ "notNull": true
1327
+ },
1328
+ "principal_id": {
1329
+ "name": "principal_id",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": false
1333
+ },
1334
+ "provider_id": {
1335
+ "name": "provider_id",
1336
+ "type": "text",
1337
+ "primaryKey": false,
1338
+ "notNull": true
1339
+ },
1340
+ "oauth_client_id": {
1341
+ "name": "oauth_client_id",
1342
+ "type": "text",
1343
+ "primaryKey": false,
1344
+ "notNull": false
1345
+ },
1346
+ "name": {
1347
+ "name": "name",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": true
1351
+ },
1352
+ "type": {
1353
+ "name": "type",
1354
+ "type": "text",
1355
+ "primaryKey": false,
1356
+ "notNull": true
1357
+ },
1358
+ "description": {
1359
+ "name": "description",
1360
+ "type": "text",
1361
+ "primaryKey": false,
1362
+ "notNull": false
1363
+ },
1364
+ "secret": {
1365
+ "name": "secret",
1366
+ "type": "text",
1367
+ "primaryKey": false,
1368
+ "notNull": true
1369
+ },
1370
+ "refresh_secret": {
1371
+ "name": "refresh_secret",
1372
+ "type": "text",
1373
+ "primaryKey": false,
1374
+ "notNull": false
1375
+ },
1376
+ "scopes": {
1377
+ "name": "scopes",
1378
+ "type": "text[]",
1379
+ "primaryKey": false,
1380
+ "notNull": false
1381
+ },
1382
+ "expires_at": {
1383
+ "name": "expires_at",
1384
+ "type": "timestamp",
1385
+ "primaryKey": false,
1386
+ "notNull": false
1387
+ },
1388
+ "status": {
1389
+ "name": "status",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "default": "'active'"
1394
+ },
1395
+ "metadata": {
1396
+ "name": "metadata",
1397
+ "type": "jsonb",
1398
+ "primaryKey": false,
1399
+ "notNull": false
1400
+ },
1401
+ "created_at": {
1402
+ "name": "created_at",
1403
+ "type": "timestamp",
1404
+ "primaryKey": false,
1405
+ "notNull": true,
1406
+ "default": "now()"
1407
+ },
1408
+ "updated_at": {
1409
+ "name": "updated_at",
1410
+ "type": "timestamp",
1411
+ "primaryKey": false,
1412
+ "notNull": true,
1413
+ "default": "now()"
1414
+ }
1415
+ },
1416
+ "indexes": {},
1417
+ "foreignKeys": {
1418
+ "credential_tenant_id_tenant_id_fk": {
1419
+ "name": "credential_tenant_id_tenant_id_fk",
1420
+ "tableFrom": "credential",
1421
+ "tableTo": "tenant",
1422
+ "columnsFrom": ["tenant_id"],
1423
+ "columnsTo": ["id"],
1424
+ "onDelete": "cascade",
1425
+ "onUpdate": "no action"
1426
+ },
1427
+ "credential_principal_id_principal_id_fk": {
1428
+ "name": "credential_principal_id_principal_id_fk",
1429
+ "tableFrom": "credential",
1430
+ "tableTo": "principal",
1431
+ "columnsFrom": ["principal_id"],
1432
+ "columnsTo": ["id"],
1433
+ "onDelete": "set null",
1434
+ "onUpdate": "no action"
1435
+ },
1436
+ "credential_provider_id_provider_id_fk": {
1437
+ "name": "credential_provider_id_provider_id_fk",
1438
+ "tableFrom": "credential",
1439
+ "tableTo": "provider",
1440
+ "columnsFrom": ["provider_id"],
1441
+ "columnsTo": ["id"],
1442
+ "onDelete": "cascade",
1443
+ "onUpdate": "no action"
1444
+ },
1445
+ "credential_oauth_client_id_oauth_client_id_fk": {
1446
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1447
+ "tableFrom": "credential",
1448
+ "tableTo": "oauth_client",
1449
+ "columnsFrom": ["oauth_client_id"],
1450
+ "columnsTo": ["id"],
1451
+ "onDelete": "set null",
1452
+ "onUpdate": "no action"
1453
+ }
1454
+ },
1455
+ "compositePrimaryKeys": {},
1456
+ "uniqueConstraints": {
1457
+ "credential_tenant_name": {
1458
+ "name": "credential_tenant_name",
1459
+ "nullsNotDistinct": false,
1460
+ "columns": ["tenant_id", "name"]
1461
+ }
1462
+ },
1463
+ "policies": {},
1464
+ "checkConstraints": {},
1465
+ "isRLSEnabled": false
1466
+ },
1467
+ "public.asset": {
1468
+ "name": "asset",
1469
+ "schema": "",
1470
+ "columns": {
1471
+ "id": {
1472
+ "name": "id",
1473
+ "type": "text",
1474
+ "primaryKey": true,
1475
+ "notNull": true
1476
+ },
1477
+ "tenant_id": {
1478
+ "name": "tenant_id",
1479
+ "type": "text",
1480
+ "primaryKey": false,
1481
+ "notNull": true
1482
+ },
1483
+ "kind": {
1484
+ "name": "kind",
1485
+ "type": "text",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ },
1489
+ "name": {
1490
+ "name": "name",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "display_name": {
1496
+ "name": "display_name",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": false
1500
+ },
1501
+ "creator_principal_id": {
1502
+ "name": "creator_principal_id",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": false
1506
+ },
1507
+ "created_at": {
1508
+ "name": "created_at",
1509
+ "type": "timestamp",
1510
+ "primaryKey": false,
1511
+ "notNull": true,
1512
+ "default": "now()"
1513
+ },
1514
+ "updated_at": {
1515
+ "name": "updated_at",
1516
+ "type": "timestamp",
1517
+ "primaryKey": false,
1518
+ "notNull": true,
1519
+ "default": "now()"
1520
+ }
1521
+ },
1522
+ "indexes": {},
1523
+ "foreignKeys": {
1524
+ "asset_tenant_id_tenant_id_fk": {
1525
+ "name": "asset_tenant_id_tenant_id_fk",
1526
+ "tableFrom": "asset",
1527
+ "tableTo": "tenant",
1528
+ "columnsFrom": ["tenant_id"],
1529
+ "columnsTo": ["id"],
1530
+ "onDelete": "cascade",
1531
+ "onUpdate": "no action"
1532
+ },
1533
+ "asset_creator_principal_id_principal_id_fk": {
1534
+ "name": "asset_creator_principal_id_principal_id_fk",
1535
+ "tableFrom": "asset",
1536
+ "tableTo": "principal",
1537
+ "columnsFrom": ["creator_principal_id"],
1538
+ "columnsTo": ["id"],
1539
+ "onDelete": "set null",
1540
+ "onUpdate": "no action"
1541
+ }
1542
+ },
1543
+ "compositePrimaryKeys": {},
1544
+ "uniqueConstraints": {
1545
+ "asset_tenant_kind_name": {
1546
+ "name": "asset_tenant_kind_name",
1547
+ "nullsNotDistinct": false,
1548
+ "columns": ["tenant_id", "kind", "name"]
1549
+ }
1550
+ },
1551
+ "policies": {},
1552
+ "checkConstraints": {},
1553
+ "isRLSEnabled": false
1554
+ },
1555
+ "public.transaction": {
1556
+ "name": "transaction",
1557
+ "schema": "",
1558
+ "columns": {
1559
+ "id": {
1560
+ "name": "id",
1561
+ "type": "text",
1562
+ "primaryKey": true,
1563
+ "notNull": true
1564
+ },
1565
+ "wallet_id": {
1566
+ "name": "wallet_id",
1567
+ "type": "text",
1568
+ "primaryKey": false,
1569
+ "notNull": true
1570
+ },
1571
+ "run_id": {
1572
+ "name": "run_id",
1573
+ "type": "text",
1574
+ "primaryKey": false,
1575
+ "notNull": false
1576
+ },
1577
+ "direction": {
1578
+ "name": "direction",
1579
+ "type": "text",
1580
+ "primaryKey": false,
1581
+ "notNull": true
1582
+ },
1583
+ "amount": {
1584
+ "name": "amount",
1585
+ "type": "text",
1586
+ "primaryKey": false,
1587
+ "notNull": true
1588
+ },
1589
+ "currency": {
1590
+ "name": "currency",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": true
1594
+ },
1595
+ "recipient_id": {
1596
+ "name": "recipient_id",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": false
1600
+ },
1601
+ "sender_id": {
1602
+ "name": "sender_id",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": false
1606
+ },
1607
+ "request_id": {
1608
+ "name": "request_id",
1609
+ "type": "text",
1610
+ "primaryKey": false,
1611
+ "notNull": false
1612
+ },
1613
+ "status": {
1614
+ "name": "status",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": true,
1618
+ "default": "'pending'"
1619
+ },
1620
+ "created_at": {
1621
+ "name": "created_at",
1622
+ "type": "timestamp",
1623
+ "primaryKey": false,
1624
+ "notNull": true,
1625
+ "default": "now()"
1626
+ }
1627
+ },
1628
+ "indexes": {},
1629
+ "foreignKeys": {
1630
+ "transaction_wallet_id_wallet_id_fk": {
1631
+ "name": "transaction_wallet_id_wallet_id_fk",
1632
+ "tableFrom": "transaction",
1633
+ "tableTo": "wallet",
1634
+ "columnsFrom": ["wallet_id"],
1635
+ "columnsTo": ["id"],
1636
+ "onDelete": "cascade",
1637
+ "onUpdate": "no action"
1638
+ },
1639
+ "transaction_run_id_workflow_run_id_fk": {
1640
+ "name": "transaction_run_id_workflow_run_id_fk",
1641
+ "tableFrom": "transaction",
1642
+ "tableTo": "workflow_run",
1643
+ "columnsFrom": ["run_id"],
1644
+ "columnsTo": ["id"],
1645
+ "onDelete": "set null",
1646
+ "onUpdate": "no action"
1647
+ }
1648
+ },
1649
+ "compositePrimaryKeys": {},
1650
+ "uniqueConstraints": {},
1651
+ "policies": {},
1652
+ "checkConstraints": {},
1653
+ "isRLSEnabled": false
1654
+ },
1655
+ "public.wallet": {
1656
+ "name": "wallet",
1657
+ "schema": "",
1658
+ "columns": {
1659
+ "id": {
1660
+ "name": "id",
1661
+ "type": "text",
1662
+ "primaryKey": true,
1663
+ "notNull": true
1664
+ },
1665
+ "tenant_id": {
1666
+ "name": "tenant_id",
1667
+ "type": "text",
1668
+ "primaryKey": false,
1669
+ "notNull": true
1670
+ },
1671
+ "name": {
1672
+ "name": "name",
1673
+ "type": "text",
1674
+ "primaryKey": false,
1675
+ "notNull": true
1676
+ },
1677
+ "backend_type": {
1678
+ "name": "backend_type",
1679
+ "type": "text",
1680
+ "primaryKey": false,
1681
+ "notNull": true
1682
+ },
1683
+ "currency": {
1684
+ "name": "currency",
1685
+ "type": "text",
1686
+ "primaryKey": false,
1687
+ "notNull": true
1688
+ },
1689
+ "balance": {
1690
+ "name": "balance",
1691
+ "type": "text",
1692
+ "primaryKey": false,
1693
+ "notNull": true,
1694
+ "default": "'0'"
1695
+ },
1696
+ "config": {
1697
+ "name": "config",
1698
+ "type": "jsonb",
1699
+ "primaryKey": false,
1700
+ "notNull": false
1701
+ },
1702
+ "created_at": {
1703
+ "name": "created_at",
1704
+ "type": "timestamp",
1705
+ "primaryKey": false,
1706
+ "notNull": true,
1707
+ "default": "now()"
1708
+ },
1709
+ "updated_at": {
1710
+ "name": "updated_at",
1711
+ "type": "timestamp",
1712
+ "primaryKey": false,
1713
+ "notNull": true,
1714
+ "default": "now()"
1715
+ }
1716
+ },
1717
+ "indexes": {},
1718
+ "foreignKeys": {
1719
+ "wallet_tenant_id_tenant_id_fk": {
1720
+ "name": "wallet_tenant_id_tenant_id_fk",
1721
+ "tableFrom": "wallet",
1722
+ "tableTo": "tenant",
1723
+ "columnsFrom": ["tenant_id"],
1724
+ "columnsTo": ["id"],
1725
+ "onDelete": "cascade",
1726
+ "onUpdate": "no action"
1727
+ }
1728
+ },
1729
+ "compositePrimaryKeys": {},
1730
+ "uniqueConstraints": {},
1731
+ "policies": {},
1732
+ "checkConstraints": {},
1733
+ "isRLSEnabled": false
1734
+ },
1735
+ "public.offering": {
1736
+ "name": "offering",
1737
+ "schema": "",
1738
+ "columns": {
1739
+ "id": {
1740
+ "name": "id",
1741
+ "type": "text",
1742
+ "primaryKey": true,
1743
+ "notNull": true
1744
+ },
1745
+ "agent_id": {
1746
+ "name": "agent_id",
1747
+ "type": "text",
1748
+ "primaryKey": false,
1749
+ "notNull": true
1750
+ },
1751
+ "tenant_id": {
1752
+ "name": "tenant_id",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true
1756
+ },
1757
+ "name": {
1758
+ "name": "name",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": true
1762
+ },
1763
+ "description": {
1764
+ "name": "description",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": false
1768
+ },
1769
+ "pricing": {
1770
+ "name": "pricing",
1771
+ "type": "jsonb",
1772
+ "primaryKey": false,
1773
+ "notNull": false
1774
+ },
1775
+ "schema": {
1776
+ "name": "schema",
1777
+ "type": "jsonb",
1778
+ "primaryKey": false,
1779
+ "notNull": false
1780
+ },
1781
+ "created_at": {
1782
+ "name": "created_at",
1783
+ "type": "timestamp",
1784
+ "primaryKey": false,
1785
+ "notNull": true,
1786
+ "default": "now()"
1787
+ },
1788
+ "updated_at": {
1789
+ "name": "updated_at",
1790
+ "type": "timestamp",
1791
+ "primaryKey": false,
1792
+ "notNull": true,
1793
+ "default": "now()"
1794
+ }
1795
+ },
1796
+ "indexes": {},
1797
+ "foreignKeys": {
1798
+ "offering_agent_id_workflow_definition_id_fk": {
1799
+ "name": "offering_agent_id_workflow_definition_id_fk",
1800
+ "tableFrom": "offering",
1801
+ "tableTo": "workflow_definition",
1802
+ "columnsFrom": ["agent_id"],
1803
+ "columnsTo": ["id"],
1804
+ "onDelete": "restrict",
1805
+ "onUpdate": "no action"
1806
+ },
1807
+ "offering_tenant_id_tenant_id_fk": {
1808
+ "name": "offering_tenant_id_tenant_id_fk",
1809
+ "tableFrom": "offering",
1810
+ "tableTo": "tenant",
1811
+ "columnsFrom": ["tenant_id"],
1812
+ "columnsTo": ["id"],
1813
+ "onDelete": "cascade",
1814
+ "onUpdate": "no action"
1815
+ }
1816
+ },
1817
+ "compositePrimaryKeys": {},
1818
+ "uniqueConstraints": {},
1819
+ "policies": {},
1820
+ "checkConstraints": {},
1821
+ "isRLSEnabled": false
1822
+ },
1823
+ "public.model": {
1824
+ "name": "model",
1825
+ "schema": "",
1826
+ "columns": {
1827
+ "id": {
1828
+ "name": "id",
1829
+ "type": "text",
1830
+ "primaryKey": true,
1831
+ "notNull": true
1832
+ },
1833
+ "tenant_id": {
1834
+ "name": "tenant_id",
1835
+ "type": "text",
1836
+ "primaryKey": false,
1837
+ "notNull": true
1838
+ },
1839
+ "canonical_name": {
1840
+ "name": "canonical_name",
1841
+ "type": "text",
1842
+ "primaryKey": false,
1843
+ "notNull": true
1844
+ },
1845
+ "display_name": {
1846
+ "name": "display_name",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": false
1850
+ },
1851
+ "description": {
1852
+ "name": "description",
1853
+ "type": "text",
1854
+ "primaryKey": false,
1855
+ "notNull": false
1856
+ },
1857
+ "disabled": {
1858
+ "name": "disabled",
1859
+ "type": "boolean",
1860
+ "primaryKey": false,
1861
+ "notNull": true,
1862
+ "default": false
1863
+ },
1864
+ "created_at": {
1865
+ "name": "created_at",
1866
+ "type": "timestamp",
1867
+ "primaryKey": false,
1868
+ "notNull": true,
1869
+ "default": "now()"
1870
+ },
1871
+ "updated_at": {
1872
+ "name": "updated_at",
1873
+ "type": "timestamp",
1874
+ "primaryKey": false,
1875
+ "notNull": true,
1876
+ "default": "now()"
1877
+ }
1878
+ },
1879
+ "indexes": {},
1880
+ "foreignKeys": {
1881
+ "model_tenant_id_tenant_id_fk": {
1882
+ "name": "model_tenant_id_tenant_id_fk",
1883
+ "tableFrom": "model",
1884
+ "tableTo": "tenant",
1885
+ "columnsFrom": ["tenant_id"],
1886
+ "columnsTo": ["id"],
1887
+ "onDelete": "cascade",
1888
+ "onUpdate": "no action"
1889
+ }
1890
+ },
1891
+ "compositePrimaryKeys": {},
1892
+ "uniqueConstraints": {
1893
+ "model_tenant_canonical_name": {
1894
+ "name": "model_tenant_canonical_name",
1895
+ "nullsNotDistinct": false,
1896
+ "columns": ["tenant_id", "canonical_name"]
1897
+ }
1898
+ },
1899
+ "policies": {},
1900
+ "checkConstraints": {},
1901
+ "isRLSEnabled": false
1902
+ },
1903
+ "public.model_offering": {
1904
+ "name": "model_offering",
1905
+ "schema": "",
1906
+ "columns": {
1907
+ "id": {
1908
+ "name": "id",
1909
+ "type": "text",
1910
+ "primaryKey": true,
1911
+ "notNull": true
1912
+ },
1913
+ "tenant_id": {
1914
+ "name": "tenant_id",
1915
+ "type": "text",
1916
+ "primaryKey": false,
1917
+ "notNull": true
1918
+ },
1919
+ "model_id": {
1920
+ "name": "model_id",
1921
+ "type": "text",
1922
+ "primaryKey": false,
1923
+ "notNull": true
1924
+ },
1925
+ "provider_id": {
1926
+ "name": "provider_id",
1927
+ "type": "text",
1928
+ "primaryKey": false,
1929
+ "notNull": true
1930
+ },
1931
+ "priority": {
1932
+ "name": "priority",
1933
+ "type": "integer",
1934
+ "primaryKey": false,
1935
+ "notNull": true
1936
+ },
1937
+ "deployment_tags": {
1938
+ "name": "deployment_tags",
1939
+ "type": "text[]",
1940
+ "primaryKey": false,
1941
+ "notNull": true,
1942
+ "default": "'{}'"
1943
+ },
1944
+ "capabilities": {
1945
+ "name": "capabilities",
1946
+ "type": "text[]",
1947
+ "primaryKey": false,
1948
+ "notNull": true,
1949
+ "default": "'{}'"
1950
+ },
1951
+ "quirks": {
1952
+ "name": "quirks",
1953
+ "type": "jsonb",
1954
+ "primaryKey": false,
1955
+ "notNull": false
1956
+ },
1957
+ "disabled": {
1958
+ "name": "disabled",
1959
+ "type": "boolean",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "default": false
1963
+ },
1964
+ "created_at": {
1965
+ "name": "created_at",
1966
+ "type": "timestamp",
1967
+ "primaryKey": false,
1968
+ "notNull": true,
1969
+ "default": "now()"
1970
+ },
1971
+ "updated_at": {
1972
+ "name": "updated_at",
1973
+ "type": "timestamp",
1974
+ "primaryKey": false,
1975
+ "notNull": true,
1976
+ "default": "now()"
1977
+ }
1978
+ },
1979
+ "indexes": {},
1980
+ "foreignKeys": {
1981
+ "model_offering_tenant_id_tenant_id_fk": {
1982
+ "name": "model_offering_tenant_id_tenant_id_fk",
1983
+ "tableFrom": "model_offering",
1984
+ "tableTo": "tenant",
1985
+ "columnsFrom": ["tenant_id"],
1986
+ "columnsTo": ["id"],
1987
+ "onDelete": "cascade",
1988
+ "onUpdate": "no action"
1989
+ },
1990
+ "model_offering_model_id_model_id_fk": {
1991
+ "name": "model_offering_model_id_model_id_fk",
1992
+ "tableFrom": "model_offering",
1993
+ "tableTo": "model",
1994
+ "columnsFrom": ["model_id"],
1995
+ "columnsTo": ["id"],
1996
+ "onDelete": "cascade",
1997
+ "onUpdate": "no action"
1998
+ },
1999
+ "model_offering_provider_id_model_provider_id_fk": {
2000
+ "name": "model_offering_provider_id_model_provider_id_fk",
2001
+ "tableFrom": "model_offering",
2002
+ "tableTo": "model_provider",
2003
+ "columnsFrom": ["provider_id"],
2004
+ "columnsTo": ["id"],
2005
+ "onDelete": "cascade",
2006
+ "onUpdate": "no action"
2007
+ }
2008
+ },
2009
+ "compositePrimaryKeys": {},
2010
+ "uniqueConstraints": {
2011
+ "model_offering_tenant_model_provider": {
2012
+ "name": "model_offering_tenant_model_provider",
2013
+ "nullsNotDistinct": false,
2014
+ "columns": ["tenant_id", "model_id", "provider_id"]
2015
+ }
2016
+ },
2017
+ "policies": {},
2018
+ "checkConstraints": {},
2019
+ "isRLSEnabled": false
2020
+ },
2021
+ "public.model_pricing": {
2022
+ "name": "model_pricing",
2023
+ "schema": "",
2024
+ "columns": {
2025
+ "id": {
2026
+ "name": "id",
2027
+ "type": "text",
2028
+ "primaryKey": true,
2029
+ "notNull": true
2030
+ },
2031
+ "tenant_id": {
2032
+ "name": "tenant_id",
2033
+ "type": "text",
2034
+ "primaryKey": false,
2035
+ "notNull": true
2036
+ },
2037
+ "offering_id": {
2038
+ "name": "offering_id",
2039
+ "type": "text",
2040
+ "primaryKey": false,
2041
+ "notNull": true
2042
+ },
2043
+ "currency": {
2044
+ "name": "currency",
2045
+ "type": "text",
2046
+ "primaryKey": false,
2047
+ "notNull": true
2048
+ },
2049
+ "input_token_price": {
2050
+ "name": "input_token_price",
2051
+ "type": "text",
2052
+ "primaryKey": false,
2053
+ "notNull": false
2054
+ },
2055
+ "output_token_price": {
2056
+ "name": "output_token_price",
2057
+ "type": "text",
2058
+ "primaryKey": false,
2059
+ "notNull": false
2060
+ },
2061
+ "cache_read_token_price": {
2062
+ "name": "cache_read_token_price",
2063
+ "type": "text",
2064
+ "primaryKey": false,
2065
+ "notNull": false
2066
+ },
2067
+ "cache_write_token_price": {
2068
+ "name": "cache_write_token_price",
2069
+ "type": "text",
2070
+ "primaryKey": false,
2071
+ "notNull": false
2072
+ },
2073
+ "thinking_token_price": {
2074
+ "name": "thinking_token_price",
2075
+ "type": "text",
2076
+ "primaryKey": false,
2077
+ "notNull": false
2078
+ },
2079
+ "per_request_fee": {
2080
+ "name": "per_request_fee",
2081
+ "type": "text",
2082
+ "primaryKey": false,
2083
+ "notNull": false
2084
+ },
2085
+ "per_image_fee": {
2086
+ "name": "per_image_fee",
2087
+ "type": "text",
2088
+ "primaryKey": false,
2089
+ "notNull": false
2090
+ },
2091
+ "per_audio_fee": {
2092
+ "name": "per_audio_fee",
2093
+ "type": "text",
2094
+ "primaryKey": false,
2095
+ "notNull": false
2096
+ },
2097
+ "effective_from": {
2098
+ "name": "effective_from",
2099
+ "type": "timestamp with time zone",
2100
+ "primaryKey": false,
2101
+ "notNull": true
2102
+ },
2103
+ "created_at": {
2104
+ "name": "created_at",
2105
+ "type": "timestamp with time zone",
2106
+ "primaryKey": false,
2107
+ "notNull": true,
2108
+ "default": "now()"
2109
+ }
2110
+ },
2111
+ "indexes": {},
2112
+ "foreignKeys": {
2113
+ "model_pricing_tenant_id_tenant_id_fk": {
2114
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2115
+ "tableFrom": "model_pricing",
2116
+ "tableTo": "tenant",
2117
+ "columnsFrom": ["tenant_id"],
2118
+ "columnsTo": ["id"],
2119
+ "onDelete": "cascade",
2120
+ "onUpdate": "no action"
2121
+ },
2122
+ "model_pricing_offering_id_model_offering_id_fk": {
2123
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2124
+ "tableFrom": "model_pricing",
2125
+ "tableTo": "model_offering",
2126
+ "columnsFrom": ["offering_id"],
2127
+ "columnsTo": ["id"],
2128
+ "onDelete": "cascade",
2129
+ "onUpdate": "no action"
2130
+ }
2131
+ },
2132
+ "compositePrimaryKeys": {},
2133
+ "uniqueConstraints": {
2134
+ "model_pricing_offering_currency_effective_from": {
2135
+ "name": "model_pricing_offering_currency_effective_from",
2136
+ "nullsNotDistinct": false,
2137
+ "columns": ["offering_id", "currency", "effective_from"]
2138
+ }
2139
+ },
2140
+ "policies": {},
2141
+ "checkConstraints": {},
2142
+ "isRLSEnabled": false
2143
+ },
2144
+ "public.model_provider": {
2145
+ "name": "model_provider",
2146
+ "schema": "",
2147
+ "columns": {
2148
+ "id": {
2149
+ "name": "id",
2150
+ "type": "text",
2151
+ "primaryKey": true,
2152
+ "notNull": true
2153
+ },
2154
+ "tenant_id": {
2155
+ "name": "tenant_id",
2156
+ "type": "text",
2157
+ "primaryKey": false,
2158
+ "notNull": true
2159
+ },
2160
+ "name": {
2161
+ "name": "name",
2162
+ "type": "text",
2163
+ "primaryKey": false,
2164
+ "notNull": true
2165
+ },
2166
+ "plugin": {
2167
+ "name": "plugin",
2168
+ "type": "text",
2169
+ "primaryKey": false,
2170
+ "notNull": true
2171
+ },
2172
+ "base_url": {
2173
+ "name": "base_url",
2174
+ "type": "text",
2175
+ "primaryKey": false,
2176
+ "notNull": true
2177
+ },
2178
+ "credential_id": {
2179
+ "name": "credential_id",
2180
+ "type": "text",
2181
+ "primaryKey": false,
2182
+ "notNull": false
2183
+ },
2184
+ "wallet_id": {
2185
+ "name": "wallet_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": false
2189
+ },
2190
+ "disabled": {
2191
+ "name": "disabled",
2192
+ "type": "boolean",
2193
+ "primaryKey": false,
2194
+ "notNull": true,
2195
+ "default": false
2196
+ },
2197
+ "created_at": {
2198
+ "name": "created_at",
2199
+ "type": "timestamp",
2200
+ "primaryKey": false,
2201
+ "notNull": true,
2202
+ "default": "now()"
2203
+ },
2204
+ "updated_at": {
2205
+ "name": "updated_at",
2206
+ "type": "timestamp",
2207
+ "primaryKey": false,
2208
+ "notNull": true,
2209
+ "default": "now()"
2210
+ }
2211
+ },
2212
+ "indexes": {},
2213
+ "foreignKeys": {
2214
+ "model_provider_tenant_id_tenant_id_fk": {
2215
+ "name": "model_provider_tenant_id_tenant_id_fk",
2216
+ "tableFrom": "model_provider",
2217
+ "tableTo": "tenant",
2218
+ "columnsFrom": ["tenant_id"],
2219
+ "columnsTo": ["id"],
2220
+ "onDelete": "cascade",
2221
+ "onUpdate": "no action"
2222
+ },
2223
+ "model_provider_credential_id_credential_id_fk": {
2224
+ "name": "model_provider_credential_id_credential_id_fk",
2225
+ "tableFrom": "model_provider",
2226
+ "tableTo": "credential",
2227
+ "columnsFrom": ["credential_id"],
2228
+ "columnsTo": ["id"],
2229
+ "onDelete": "restrict",
2230
+ "onUpdate": "no action"
2231
+ },
2232
+ "model_provider_wallet_id_wallet_id_fk": {
2233
+ "name": "model_provider_wallet_id_wallet_id_fk",
2234
+ "tableFrom": "model_provider",
2235
+ "tableTo": "wallet",
2236
+ "columnsFrom": ["wallet_id"],
2237
+ "columnsTo": ["id"],
2238
+ "onDelete": "restrict",
2239
+ "onUpdate": "no action"
2240
+ }
2241
+ },
2242
+ "compositePrimaryKeys": {},
2243
+ "uniqueConstraints": {
2244
+ "model_provider_tenant_name": {
2245
+ "name": "model_provider_tenant_name",
2246
+ "nullsNotDistinct": false,
2247
+ "columns": ["tenant_id", "name"]
2248
+ }
2249
+ },
2250
+ "policies": {},
2251
+ "checkConstraints": {
2252
+ "model_provider_auth_xor": {
2253
+ "name": "model_provider_auth_xor",
2254
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2255
+ }
2256
+ },
2257
+ "isRLSEnabled": false
2258
+ },
2259
+ "public.sidecar": {
2260
+ "name": "sidecar",
2261
+ "schema": "",
2262
+ "columns": {
2263
+ "id": {
2264
+ "name": "id",
2265
+ "type": "text",
2266
+ "primaryKey": true,
2267
+ "notNull": true
2268
+ },
2269
+ "url": {
2270
+ "name": "url",
2271
+ "type": "text",
2272
+ "primaryKey": false,
2273
+ "notNull": true
2274
+ },
2275
+ "token_hash_sha256": {
2276
+ "name": "token_hash_sha256",
2277
+ "type": "bytea",
2278
+ "primaryKey": false,
2279
+ "notNull": true
2280
+ },
2281
+ "status": {
2282
+ "name": "status",
2283
+ "type": "text",
2284
+ "primaryKey": false,
2285
+ "notNull": true,
2286
+ "default": "'online'"
2287
+ },
2288
+ "last_heartbeat": {
2289
+ "name": "last_heartbeat",
2290
+ "type": "timestamp",
2291
+ "primaryKey": false,
2292
+ "notNull": false
2293
+ },
2294
+ "created_at": {
2295
+ "name": "created_at",
2296
+ "type": "timestamp",
2297
+ "primaryKey": false,
2298
+ "notNull": true,
2299
+ "default": "now()"
2300
+ },
2301
+ "updated_at": {
2302
+ "name": "updated_at",
2303
+ "type": "timestamp",
2304
+ "primaryKey": false,
2305
+ "notNull": true,
2306
+ "default": "now()"
2307
+ }
2308
+ },
2309
+ "indexes": {},
2310
+ "foreignKeys": {},
2311
+ "compositePrimaryKeys": {},
2312
+ "uniqueConstraints": {
2313
+ "sidecar_token_hash_sha256_unique": {
2314
+ "name": "sidecar_token_hash_sha256_unique",
2315
+ "nullsNotDistinct": false,
2316
+ "columns": ["token_hash_sha256"]
2317
+ }
2318
+ },
2319
+ "policies": {},
2320
+ "checkConstraints": {},
2321
+ "isRLSEnabled": false
2322
+ },
2323
+ "public.agent_session": {
2324
+ "name": "agent_session",
2325
+ "schema": "",
2326
+ "columns": {
2327
+ "id": {
2328
+ "name": "id",
2329
+ "type": "text",
2330
+ "primaryKey": true,
2331
+ "notNull": true
2332
+ },
2333
+ "tenant_id": {
2334
+ "name": "tenant_id",
2335
+ "type": "text",
2336
+ "primaryKey": false,
2337
+ "notNull": true
2338
+ },
2339
+ "agent_id": {
2340
+ "name": "agent_id",
2341
+ "type": "text",
2342
+ "primaryKey": false,
2343
+ "notNull": true
2344
+ },
2345
+ "principal_id": {
2346
+ "name": "principal_id",
2347
+ "type": "text",
2348
+ "primaryKey": false,
2349
+ "notNull": true
2350
+ },
2351
+ "status": {
2352
+ "name": "status",
2353
+ "type": "text",
2354
+ "primaryKey": false,
2355
+ "notNull": true,
2356
+ "default": "'active'"
2357
+ },
2358
+ "created_at": {
2359
+ "name": "created_at",
2360
+ "type": "timestamp",
2361
+ "primaryKey": false,
2362
+ "notNull": true,
2363
+ "default": "now()"
2364
+ },
2365
+ "updated_at": {
2366
+ "name": "updated_at",
2367
+ "type": "timestamp",
2368
+ "primaryKey": false,
2369
+ "notNull": true,
2370
+ "default": "now()"
2371
+ },
2372
+ "ended_at": {
2373
+ "name": "ended_at",
2374
+ "type": "timestamp",
2375
+ "primaryKey": false,
2376
+ "notNull": false
2377
+ }
2378
+ },
2379
+ "indexes": {},
2380
+ "foreignKeys": {
2381
+ "agent_session_tenant_id_tenant_id_fk": {
2382
+ "name": "agent_session_tenant_id_tenant_id_fk",
2383
+ "tableFrom": "agent_session",
2384
+ "tableTo": "tenant",
2385
+ "columnsFrom": ["tenant_id"],
2386
+ "columnsTo": ["id"],
2387
+ "onDelete": "cascade",
2388
+ "onUpdate": "no action"
2389
+ },
2390
+ "agent_session_agent_id_workflow_definition_id_fk": {
2391
+ "name": "agent_session_agent_id_workflow_definition_id_fk",
2392
+ "tableFrom": "agent_session",
2393
+ "tableTo": "workflow_definition",
2394
+ "columnsFrom": ["agent_id"],
2395
+ "columnsTo": ["id"],
2396
+ "onDelete": "restrict",
2397
+ "onUpdate": "no action"
2398
+ },
2399
+ "agent_session_principal_id_principal_id_fk": {
2400
+ "name": "agent_session_principal_id_principal_id_fk",
2401
+ "tableFrom": "agent_session",
2402
+ "tableTo": "principal",
2403
+ "columnsFrom": ["principal_id"],
2404
+ "columnsTo": ["id"],
2405
+ "onDelete": "no action",
2406
+ "onUpdate": "no action"
2407
+ }
2408
+ },
2409
+ "compositePrimaryKeys": {},
2410
+ "uniqueConstraints": {},
2411
+ "policies": {},
2412
+ "checkConstraints": {},
2413
+ "isRLSEnabled": false
2414
+ },
2415
+ "public.session_asset": {
2416
+ "name": "session_asset",
2417
+ "schema": "",
2418
+ "columns": {
2419
+ "instance_id": {
2420
+ "name": "instance_id",
2421
+ "type": "text",
2422
+ "primaryKey": false,
2423
+ "notNull": true
2424
+ },
2425
+ "mount_path": {
2426
+ "name": "mount_path",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "asset_pack_sha": {
2432
+ "name": "asset_pack_sha",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": true
2436
+ },
2437
+ "source_commit_sha": {
2438
+ "name": "source_commit_sha",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": true
2442
+ },
2443
+ "materialized_at": {
2444
+ "name": "materialized_at",
2445
+ "type": "timestamp",
2446
+ "primaryKey": false,
2447
+ "notNull": true,
2448
+ "default": "now()"
2449
+ }
2450
+ },
2451
+ "indexes": {
2452
+ "session_asset_pack_sha_idx": {
2453
+ "name": "session_asset_pack_sha_idx",
2454
+ "columns": [
2455
+ {
2456
+ "expression": "asset_pack_sha",
2457
+ "isExpression": false,
2458
+ "asc": true,
2459
+ "nulls": "last"
2460
+ }
2461
+ ],
2462
+ "isUnique": false,
2463
+ "concurrently": false,
2464
+ "method": "btree",
2465
+ "with": {}
2466
+ }
2467
+ },
2468
+ "foreignKeys": {},
2469
+ "compositePrimaryKeys": {
2470
+ "session_asset_instance_id_mount_path_pk": {
2471
+ "name": "session_asset_instance_id_mount_path_pk",
2472
+ "columns": ["instance_id", "mount_path"]
2473
+ }
2474
+ },
2475
+ "uniqueConstraints": {},
2476
+ "policies": {},
2477
+ "checkConstraints": {},
2478
+ "isRLSEnabled": false
2479
+ },
2480
+ "public.inference_turn": {
2481
+ "name": "inference_turn",
2482
+ "schema": "",
2483
+ "columns": {
2484
+ "id": {
2485
+ "name": "id",
2486
+ "type": "text",
2487
+ "primaryKey": true,
2488
+ "notNull": true
2489
+ },
2490
+ "session_id": {
2491
+ "name": "session_id",
2492
+ "type": "text",
2493
+ "primaryKey": false,
2494
+ "notNull": true
2495
+ },
2496
+ "instance_id": {
2497
+ "name": "instance_id",
2498
+ "type": "text",
2499
+ "primaryKey": false,
2500
+ "notNull": true
2501
+ },
2502
+ "tenant_id": {
2503
+ "name": "tenant_id",
2504
+ "type": "text",
2505
+ "primaryKey": false,
2506
+ "notNull": true
2507
+ },
2508
+ "model": {
2509
+ "name": "model",
2510
+ "type": "text",
2511
+ "primaryKey": false,
2512
+ "notNull": true
2513
+ },
2514
+ "status": {
2515
+ "name": "status",
2516
+ "type": "text",
2517
+ "primaryKey": false,
2518
+ "notNull": true,
2519
+ "default": "'running'"
2520
+ },
2521
+ "started_at": {
2522
+ "name": "started_at",
2523
+ "type": "timestamp",
2524
+ "primaryKey": false,
2525
+ "notNull": true
2526
+ },
2527
+ "ended_at": {
2528
+ "name": "ended_at",
2529
+ "type": "timestamp",
2530
+ "primaryKey": false,
2531
+ "notNull": false
2532
+ }
2533
+ },
2534
+ "indexes": {
2535
+ "inference_turn_instance_id_started_at_idx": {
2536
+ "name": "inference_turn_instance_id_started_at_idx",
2537
+ "columns": [
2538
+ {
2539
+ "expression": "instance_id",
2540
+ "isExpression": false,
2541
+ "asc": true,
2542
+ "nulls": "last"
2543
+ },
2544
+ {
2545
+ "expression": "started_at",
2546
+ "isExpression": false,
2547
+ "asc": true,
2548
+ "nulls": "last"
2549
+ }
2550
+ ],
2551
+ "isUnique": false,
2552
+ "concurrently": false,
2553
+ "method": "btree",
2554
+ "with": {}
2555
+ }
2556
+ },
2557
+ "foreignKeys": {
2558
+ "inference_turn_session_id_agent_session_id_fk": {
2559
+ "name": "inference_turn_session_id_agent_session_id_fk",
2560
+ "tableFrom": "inference_turn",
2561
+ "tableTo": "agent_session",
2562
+ "columnsFrom": ["session_id"],
2563
+ "columnsTo": ["id"],
2564
+ "onDelete": "cascade",
2565
+ "onUpdate": "no action"
2566
+ },
2567
+ "inference_turn_tenant_id_tenant_id_fk": {
2568
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2569
+ "tableFrom": "inference_turn",
2570
+ "tableTo": "tenant",
2571
+ "columnsFrom": ["tenant_id"],
2572
+ "columnsTo": ["id"],
2573
+ "onDelete": "cascade",
2574
+ "onUpdate": "no action"
2575
+ }
2576
+ },
2577
+ "compositePrimaryKeys": {},
2578
+ "uniqueConstraints": {},
2579
+ "policies": {},
2580
+ "checkConstraints": {},
2581
+ "isRLSEnabled": false
2582
+ },
2583
+ "public.session_mail": {
2584
+ "name": "session_mail",
2585
+ "schema": "",
2586
+ "columns": {
2587
+ "id": {
2588
+ "name": "id",
2589
+ "type": "text",
2590
+ "primaryKey": true,
2591
+ "notNull": true
2592
+ },
2593
+ "session_id": {
2594
+ "name": "session_id",
2595
+ "type": "text",
2596
+ "primaryKey": false,
2597
+ "notNull": true
2598
+ },
2599
+ "instance_id": {
2600
+ "name": "instance_id",
2601
+ "type": "text",
2602
+ "primaryKey": false,
2603
+ "notNull": false
2604
+ },
2605
+ "tenant_id": {
2606
+ "name": "tenant_id",
2607
+ "type": "text",
2608
+ "primaryKey": false,
2609
+ "notNull": true
2610
+ },
2611
+ "direction": {
2612
+ "name": "direction",
2613
+ "type": "text",
2614
+ "primaryKey": false,
2615
+ "notNull": true
2616
+ },
2617
+ "status": {
2618
+ "name": "status",
2619
+ "type": "text",
2620
+ "primaryKey": false,
2621
+ "notNull": true,
2622
+ "default": "'pending'"
2623
+ },
2624
+ "raw": {
2625
+ "name": "raw",
2626
+ "type": "bytea",
2627
+ "primaryKey": false,
2628
+ "notNull": true
2629
+ },
2630
+ "created_at": {
2631
+ "name": "created_at",
2632
+ "type": "timestamp",
2633
+ "primaryKey": false,
2634
+ "notNull": true,
2635
+ "default": "now()"
2636
+ }
2637
+ },
2638
+ "indexes": {
2639
+ "session_mail_instance_id_created_at_idx": {
2640
+ "name": "session_mail_instance_id_created_at_idx",
2641
+ "columns": [
2642
+ {
2643
+ "expression": "instance_id",
2644
+ "isExpression": false,
2645
+ "asc": true,
2646
+ "nulls": "last"
2647
+ },
2648
+ {
2649
+ "expression": "created_at",
2650
+ "isExpression": false,
2651
+ "asc": true,
2652
+ "nulls": "last"
2653
+ }
2654
+ ],
2655
+ "isUnique": false,
2656
+ "concurrently": false,
2657
+ "method": "btree",
2658
+ "with": {}
2659
+ },
2660
+ "session_mail_session_id_created_at_idx": {
2661
+ "name": "session_mail_session_id_created_at_idx",
2662
+ "columns": [
2663
+ {
2664
+ "expression": "session_id",
2665
+ "isExpression": false,
2666
+ "asc": true,
2667
+ "nulls": "last"
2668
+ },
2669
+ {
2670
+ "expression": "created_at",
2671
+ "isExpression": false,
2672
+ "asc": true,
2673
+ "nulls": "last"
2674
+ }
2675
+ ],
2676
+ "isUnique": false,
2677
+ "concurrently": false,
2678
+ "method": "btree",
2679
+ "with": {}
2680
+ }
2681
+ },
2682
+ "foreignKeys": {
2683
+ "session_mail_session_id_agent_session_id_fk": {
2684
+ "name": "session_mail_session_id_agent_session_id_fk",
2685
+ "tableFrom": "session_mail",
2686
+ "tableTo": "agent_session",
2687
+ "columnsFrom": ["session_id"],
2688
+ "columnsTo": ["id"],
2689
+ "onDelete": "cascade",
2690
+ "onUpdate": "no action"
2691
+ },
2692
+ "session_mail_tenant_id_tenant_id_fk": {
2693
+ "name": "session_mail_tenant_id_tenant_id_fk",
2694
+ "tableFrom": "session_mail",
2695
+ "tableTo": "tenant",
2696
+ "columnsFrom": ["tenant_id"],
2697
+ "columnsTo": ["id"],
2698
+ "onDelete": "cascade",
2699
+ "onUpdate": "no action"
2700
+ }
2701
+ },
2702
+ "compositePrimaryKeys": {},
2703
+ "uniqueConstraints": {},
2704
+ "policies": {},
2705
+ "checkConstraints": {},
2706
+ "isRLSEnabled": false
2707
+ },
2708
+ "public.turn_part": {
2709
+ "name": "turn_part",
2710
+ "schema": "",
2711
+ "columns": {
2712
+ "id": {
2713
+ "name": "id",
2714
+ "type": "text",
2715
+ "primaryKey": true,
2716
+ "notNull": true
2717
+ },
2718
+ "turn_id": {
2719
+ "name": "turn_id",
2720
+ "type": "text",
2721
+ "primaryKey": false,
2722
+ "notNull": true
2723
+ },
2724
+ "session_id": {
2725
+ "name": "session_id",
2726
+ "type": "text",
2727
+ "primaryKey": false,
2728
+ "notNull": true
2729
+ },
2730
+ "type": {
2731
+ "name": "type",
2732
+ "type": "text",
2733
+ "primaryKey": false,
2734
+ "notNull": true
2735
+ },
2736
+ "content": {
2737
+ "name": "content",
2738
+ "type": "text",
2739
+ "primaryKey": false,
2740
+ "notNull": false
2741
+ },
2742
+ "metadata": {
2743
+ "name": "metadata",
2744
+ "type": "jsonb",
2745
+ "primaryKey": false,
2746
+ "notNull": false
2747
+ },
2748
+ "ordinal": {
2749
+ "name": "ordinal",
2750
+ "type": "integer",
2751
+ "primaryKey": false,
2752
+ "notNull": true
2753
+ }
2754
+ },
2755
+ "indexes": {},
2756
+ "foreignKeys": {
2757
+ "turn_part_turn_id_inference_turn_id_fk": {
2758
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2759
+ "tableFrom": "turn_part",
2760
+ "tableTo": "inference_turn",
2761
+ "columnsFrom": ["turn_id"],
2762
+ "columnsTo": ["id"],
2763
+ "onDelete": "cascade",
2764
+ "onUpdate": "no action"
2765
+ },
2766
+ "turn_part_session_id_agent_session_id_fk": {
2767
+ "name": "turn_part_session_id_agent_session_id_fk",
2768
+ "tableFrom": "turn_part",
2769
+ "tableTo": "agent_session",
2770
+ "columnsFrom": ["session_id"],
2771
+ "columnsTo": ["id"],
2772
+ "onDelete": "cascade",
2773
+ "onUpdate": "no action"
2774
+ }
2775
+ },
2776
+ "compositePrimaryKeys": {},
2777
+ "uniqueConstraints": {},
2778
+ "policies": {},
2779
+ "checkConstraints": {},
2780
+ "isRLSEnabled": false
2781
+ },
2782
+ "public.git_token": {
2783
+ "name": "git_token",
2784
+ "schema": "",
2785
+ "columns": {
2786
+ "id": {
2787
+ "name": "id",
2788
+ "type": "text",
2789
+ "primaryKey": true,
2790
+ "notNull": true
2791
+ },
2792
+ "tenant_id": {
2793
+ "name": "tenant_id",
2794
+ "type": "text",
2795
+ "primaryKey": false,
2796
+ "notNull": false
2797
+ },
2798
+ "user_id": {
2799
+ "name": "user_id",
2800
+ "type": "text",
2801
+ "primaryKey": false,
2802
+ "notNull": true
2803
+ },
2804
+ "principal_id": {
2805
+ "name": "principal_id",
2806
+ "type": "text",
2807
+ "primaryKey": false,
2808
+ "notNull": false
2809
+ },
2810
+ "name": {
2811
+ "name": "name",
2812
+ "type": "text",
2813
+ "primaryKey": false,
2814
+ "notNull": true
2815
+ },
2816
+ "kind": {
2817
+ "name": "kind",
2818
+ "type": "text",
2819
+ "primaryKey": false,
2820
+ "notNull": true
2821
+ },
2822
+ "token_hash_sha256": {
2823
+ "name": "token_hash_sha256",
2824
+ "type": "bytea",
2825
+ "primaryKey": false,
2826
+ "notNull": true
2827
+ },
2828
+ "resource": {
2829
+ "name": "resource",
2830
+ "type": "text",
2831
+ "primaryKey": false,
2832
+ "notNull": true
2833
+ },
2834
+ "ref_pattern": {
2835
+ "name": "ref_pattern",
2836
+ "type": "text",
2837
+ "primaryKey": false,
2838
+ "notNull": true
2839
+ },
2840
+ "actions": {
2841
+ "name": "actions",
2842
+ "type": "text[]",
2843
+ "primaryKey": false,
2844
+ "notNull": true
2845
+ },
2846
+ "expires_at": {
2847
+ "name": "expires_at",
2848
+ "type": "timestamp with time zone",
2849
+ "primaryKey": false,
2850
+ "notNull": true
2851
+ },
2852
+ "revoked_at": {
2853
+ "name": "revoked_at",
2854
+ "type": "timestamp with time zone",
2855
+ "primaryKey": false,
2856
+ "notNull": false
2857
+ },
2858
+ "created_at": {
2859
+ "name": "created_at",
2860
+ "type": "timestamp with time zone",
2861
+ "primaryKey": false,
2862
+ "notNull": true,
2863
+ "default": "now()"
2864
+ }
2865
+ },
2866
+ "indexes": {
2867
+ "git_token_user_id_name_active_idx": {
2868
+ "name": "git_token_user_id_name_active_idx",
2869
+ "columns": [
2870
+ {
2871
+ "expression": "user_id",
2872
+ "isExpression": false,
2873
+ "asc": true,
2874
+ "nulls": "last"
2875
+ },
2876
+ {
2877
+ "expression": "name",
2878
+ "isExpression": false,
2879
+ "asc": true,
2880
+ "nulls": "last"
2881
+ }
2882
+ ],
2883
+ "isUnique": true,
2884
+ "where": "\"git_token\".\"revoked_at\" is null",
2885
+ "concurrently": false,
2886
+ "method": "btree",
2887
+ "with": {}
2888
+ }
2889
+ },
2890
+ "foreignKeys": {
2891
+ "git_token_tenant_id_tenant_id_fk": {
2892
+ "name": "git_token_tenant_id_tenant_id_fk",
2893
+ "tableFrom": "git_token",
2894
+ "tableTo": "tenant",
2895
+ "columnsFrom": ["tenant_id"],
2896
+ "columnsTo": ["id"],
2897
+ "onDelete": "no action",
2898
+ "onUpdate": "no action"
2899
+ },
2900
+ "git_token_user_id_user_id_fk": {
2901
+ "name": "git_token_user_id_user_id_fk",
2902
+ "tableFrom": "git_token",
2903
+ "tableTo": "user",
2904
+ "columnsFrom": ["user_id"],
2905
+ "columnsTo": ["id"],
2906
+ "onDelete": "cascade",
2907
+ "onUpdate": "no action"
2908
+ },
2909
+ "git_token_principal_id_principal_id_fk": {
2910
+ "name": "git_token_principal_id_principal_id_fk",
2911
+ "tableFrom": "git_token",
2912
+ "tableTo": "principal",
2913
+ "columnsFrom": ["principal_id"],
2914
+ "columnsTo": ["id"],
2915
+ "onDelete": "cascade",
2916
+ "onUpdate": "no action"
2917
+ }
2918
+ },
2919
+ "compositePrimaryKeys": {},
2920
+ "uniqueConstraints": {
2921
+ "git_token_token_hash_sha256_unique": {
2922
+ "name": "git_token_token_hash_sha256_unique",
2923
+ "nullsNotDistinct": false,
2924
+ "columns": ["token_hash_sha256"]
2925
+ }
2926
+ },
2927
+ "policies": {},
2928
+ "checkConstraints": {},
2929
+ "isRLSEnabled": false
2930
+ },
2931
+ "public.workflow_definition": {
2932
+ "name": "workflow_definition",
2933
+ "schema": "",
2934
+ "columns": {
2935
+ "id": {
2936
+ "name": "id",
2937
+ "type": "text",
2938
+ "primaryKey": true,
2939
+ "notNull": true
2940
+ },
2941
+ "tenant_id": {
2942
+ "name": "tenant_id",
2943
+ "type": "text",
2944
+ "primaryKey": false,
2945
+ "notNull": true
2946
+ },
2947
+ "creator_principal_id": {
2948
+ "name": "creator_principal_id",
2949
+ "type": "text",
2950
+ "primaryKey": false,
2951
+ "notNull": false
2952
+ },
2953
+ "asset_id": {
2954
+ "name": "asset_id",
2955
+ "type": "text",
2956
+ "primaryKey": false,
2957
+ "notNull": false
2958
+ },
2959
+ "name": {
2960
+ "name": "name",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "description": {
2966
+ "name": "description",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": false
2970
+ },
2971
+ "grant_requirements": {
2972
+ "name": "grant_requirements",
2973
+ "type": "jsonb",
2974
+ "primaryKey": false,
2975
+ "notNull": false
2976
+ },
2977
+ "model_requirements": {
2978
+ "name": "model_requirements",
2979
+ "type": "jsonb",
2980
+ "primaryKey": false,
2981
+ "notNull": false
2982
+ },
2983
+ "credential_bindings": {
2984
+ "name": "credential_bindings",
2985
+ "type": "jsonb",
2986
+ "primaryKey": false,
2987
+ "notNull": false
2988
+ },
2989
+ "current_version": {
2990
+ "name": "current_version",
2991
+ "type": "text",
2992
+ "primaryKey": false,
2993
+ "notNull": true,
2994
+ "default": "'1'"
2995
+ },
2996
+ "status": {
2997
+ "name": "status",
2998
+ "type": "text",
2999
+ "primaryKey": false,
3000
+ "notNull": true,
3001
+ "default": "'deployed'"
3002
+ },
3003
+ "created_at": {
3004
+ "name": "created_at",
3005
+ "type": "timestamp",
3006
+ "primaryKey": false,
3007
+ "notNull": true,
3008
+ "default": "now()"
3009
+ },
3010
+ "updated_at": {
3011
+ "name": "updated_at",
3012
+ "type": "timestamp",
3013
+ "primaryKey": false,
3014
+ "notNull": true,
3015
+ "default": "now()"
3016
+ }
3017
+ },
3018
+ "indexes": {
3019
+ "workflow_definition_tenant_idx": {
3020
+ "name": "workflow_definition_tenant_idx",
3021
+ "columns": [
3022
+ {
3023
+ "expression": "tenant_id",
3024
+ "isExpression": false,
3025
+ "asc": true,
3026
+ "nulls": "last"
3027
+ },
3028
+ {
3029
+ "expression": "created_at",
3030
+ "isExpression": false,
3031
+ "asc": true,
3032
+ "nulls": "last"
3033
+ }
3034
+ ],
3035
+ "isUnique": false,
3036
+ "concurrently": false,
3037
+ "method": "btree",
3038
+ "with": {}
3039
+ },
3040
+ "workflow_definition_asset_idx": {
3041
+ "name": "workflow_definition_asset_idx",
3042
+ "columns": [
3043
+ {
3044
+ "expression": "asset_id",
3045
+ "isExpression": false,
3046
+ "asc": true,
3047
+ "nulls": "last"
3048
+ }
3049
+ ],
3050
+ "isUnique": true,
3051
+ "concurrently": false,
3052
+ "method": "btree",
3053
+ "with": {}
3054
+ }
3055
+ },
3056
+ "foreignKeys": {
3057
+ "workflow_definition_tenant_id_tenant_id_fk": {
3058
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3059
+ "tableFrom": "workflow_definition",
3060
+ "tableTo": "tenant",
3061
+ "columnsFrom": ["tenant_id"],
3062
+ "columnsTo": ["id"],
3063
+ "onDelete": "cascade",
3064
+ "onUpdate": "no action"
3065
+ },
3066
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3067
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3068
+ "tableFrom": "workflow_definition",
3069
+ "tableTo": "principal",
3070
+ "columnsFrom": ["creator_principal_id"],
3071
+ "columnsTo": ["id"],
3072
+ "onDelete": "no action",
3073
+ "onUpdate": "no action"
3074
+ },
3075
+ "workflow_definition_asset_id_asset_id_fk": {
3076
+ "name": "workflow_definition_asset_id_asset_id_fk",
3077
+ "tableFrom": "workflow_definition",
3078
+ "tableTo": "asset",
3079
+ "columnsFrom": ["asset_id"],
3080
+ "columnsTo": ["id"],
3081
+ "onDelete": "restrict",
3082
+ "onUpdate": "no action"
3083
+ }
3084
+ },
3085
+ "compositePrimaryKeys": {},
3086
+ "uniqueConstraints": {},
3087
+ "policies": {},
3088
+ "checkConstraints": {},
3089
+ "isRLSEnabled": false
3090
+ },
3091
+ "public.workflow_definition_version": {
3092
+ "name": "workflow_definition_version",
3093
+ "schema": "",
3094
+ "columns": {
3095
+ "id": {
3096
+ "name": "id",
3097
+ "type": "text",
3098
+ "primaryKey": true,
3099
+ "notNull": true
3100
+ },
3101
+ "definition_id": {
3102
+ "name": "definition_id",
3103
+ "type": "text",
3104
+ "primaryKey": false,
3105
+ "notNull": true
3106
+ },
3107
+ "version": {
3108
+ "name": "version",
3109
+ "type": "text",
3110
+ "primaryKey": false,
3111
+ "notNull": true
3112
+ },
3113
+ "status": {
3114
+ "name": "status",
3115
+ "type": "text",
3116
+ "primaryKey": false,
3117
+ "notNull": true,
3118
+ "default": "'active'"
3119
+ },
3120
+ "created_at": {
3121
+ "name": "created_at",
3122
+ "type": "timestamp",
3123
+ "primaryKey": false,
3124
+ "notNull": true,
3125
+ "default": "now()"
3126
+ }
3127
+ },
3128
+ "indexes": {
3129
+ "workflow_definition_version_definition_idx": {
3130
+ "name": "workflow_definition_version_definition_idx",
3131
+ "columns": [
3132
+ {
3133
+ "expression": "definition_id",
3134
+ "isExpression": false,
3135
+ "asc": true,
3136
+ "nulls": "last"
3137
+ }
3138
+ ],
3139
+ "isUnique": false,
3140
+ "concurrently": false,
3141
+ "method": "btree",
3142
+ "with": {}
3143
+ }
3144
+ },
3145
+ "foreignKeys": {
3146
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3147
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3148
+ "tableFrom": "workflow_definition_version",
3149
+ "tableTo": "workflow_definition",
3150
+ "columnsFrom": ["definition_id"],
3151
+ "columnsTo": ["id"],
3152
+ "onDelete": "cascade",
3153
+ "onUpdate": "no action"
3154
+ }
3155
+ },
3156
+ "compositePrimaryKeys": {},
3157
+ "uniqueConstraints": {
3158
+ "workflow_definition_version_definition_version": {
3159
+ "name": "workflow_definition_version_definition_version",
3160
+ "nullsNotDistinct": false,
3161
+ "columns": ["definition_id", "version"]
3162
+ }
3163
+ },
3164
+ "policies": {},
3165
+ "checkConstraints": {},
3166
+ "isRLSEnabled": false
3167
+ },
3168
+ "public.workflow_run": {
3169
+ "name": "workflow_run",
3170
+ "schema": "",
3171
+ "columns": {
3172
+ "id": {
3173
+ "name": "id",
3174
+ "type": "text",
3175
+ "primaryKey": true,
3176
+ "notNull": true
3177
+ },
3178
+ "definition_id": {
3179
+ "name": "definition_id",
3180
+ "type": "text",
3181
+ "primaryKey": false,
3182
+ "notNull": true
3183
+ },
3184
+ "deployment_id": {
3185
+ "name": "deployment_id",
3186
+ "type": "text",
3187
+ "primaryKey": false,
3188
+ "notNull": false
3189
+ },
3190
+ "tenant_id": {
3191
+ "name": "tenant_id",
3192
+ "type": "text",
3193
+ "primaryKey": false,
3194
+ "notNull": true
3195
+ },
3196
+ "principal_id": {
3197
+ "name": "principal_id",
3198
+ "type": "text",
3199
+ "primaryKey": false,
3200
+ "notNull": false
3201
+ },
3202
+ "status": {
3203
+ "name": "status",
3204
+ "type": "text",
3205
+ "primaryKey": false,
3206
+ "notNull": true,
3207
+ "default": "'running'"
3208
+ },
3209
+ "address": {
3210
+ "name": "address",
3211
+ "type": "text",
3212
+ "primaryKey": false,
3213
+ "notNull": false
3214
+ },
3215
+ "public_key": {
3216
+ "name": "public_key",
3217
+ "type": "text",
3218
+ "primaryKey": false,
3219
+ "notNull": false
3220
+ },
3221
+ "sidecar_id": {
3222
+ "name": "sidecar_id",
3223
+ "type": "text",
3224
+ "primaryKey": false,
3225
+ "notNull": false
3226
+ },
3227
+ "kernel_id": {
3228
+ "name": "kernel_id",
3229
+ "type": "text",
3230
+ "primaryKey": false,
3231
+ "notNull": false
3232
+ },
3233
+ "model_preferences": {
3234
+ "name": "model_preferences",
3235
+ "type": "jsonb",
3236
+ "primaryKey": false,
3237
+ "notNull": false
3238
+ },
3239
+ "created_at": {
3240
+ "name": "created_at",
3241
+ "type": "timestamp",
3242
+ "primaryKey": false,
3243
+ "notNull": true,
3244
+ "default": "now()"
3245
+ },
3246
+ "ended_at": {
3247
+ "name": "ended_at",
3248
+ "type": "timestamp",
3249
+ "primaryKey": false,
3250
+ "notNull": false
3251
+ }
3252
+ },
3253
+ "indexes": {
3254
+ "workflow_run_definition_idx": {
3255
+ "name": "workflow_run_definition_idx",
3256
+ "columns": [
3257
+ {
3258
+ "expression": "definition_id",
3259
+ "isExpression": false,
3260
+ "asc": true,
3261
+ "nulls": "last"
3262
+ }
3263
+ ],
3264
+ "isUnique": false,
3265
+ "concurrently": false,
3266
+ "method": "btree",
3267
+ "with": {}
3268
+ },
3269
+ "workflow_run_address_idx": {
3270
+ "name": "workflow_run_address_idx",
3271
+ "columns": [
3272
+ {
3273
+ "expression": "address",
3274
+ "isExpression": false,
3275
+ "asc": true,
3276
+ "nulls": "last"
3277
+ }
3278
+ ],
3279
+ "isUnique": true,
3280
+ "where": "\"workflow_run\".\"address\" is not null",
3281
+ "concurrently": false,
3282
+ "method": "btree",
3283
+ "with": {}
3284
+ }
3285
+ },
3286
+ "foreignKeys": {
3287
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3288
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3289
+ "tableFrom": "workflow_run",
3290
+ "tableTo": "workflow_definition",
3291
+ "columnsFrom": ["definition_id"],
3292
+ "columnsTo": ["id"],
3293
+ "onDelete": "cascade",
3294
+ "onUpdate": "no action"
3295
+ },
3296
+ "workflow_run_deployment_id_workflow_run_id_fk": {
3297
+ "name": "workflow_run_deployment_id_workflow_run_id_fk",
3298
+ "tableFrom": "workflow_run",
3299
+ "tableTo": "workflow_run",
3300
+ "columnsFrom": ["deployment_id"],
3301
+ "columnsTo": ["id"],
3302
+ "onDelete": "cascade",
3303
+ "onUpdate": "no action"
3304
+ },
3305
+ "workflow_run_tenant_id_tenant_id_fk": {
3306
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3307
+ "tableFrom": "workflow_run",
3308
+ "tableTo": "tenant",
3309
+ "columnsFrom": ["tenant_id"],
3310
+ "columnsTo": ["id"],
3311
+ "onDelete": "cascade",
3312
+ "onUpdate": "no action"
3313
+ },
3314
+ "workflow_run_principal_id_principal_id_fk": {
3315
+ "name": "workflow_run_principal_id_principal_id_fk",
3316
+ "tableFrom": "workflow_run",
3317
+ "tableTo": "principal",
3318
+ "columnsFrom": ["principal_id"],
3319
+ "columnsTo": ["id"],
3320
+ "onDelete": "set null",
3321
+ "onUpdate": "no action"
3322
+ },
3323
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3324
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3325
+ "tableFrom": "workflow_run",
3326
+ "tableTo": "sidecar",
3327
+ "columnsFrom": ["sidecar_id"],
3328
+ "columnsTo": ["id"],
3329
+ "onDelete": "set null",
3330
+ "onUpdate": "no action"
3331
+ }
3332
+ },
3333
+ "compositePrimaryKeys": {},
3334
+ "uniqueConstraints": {},
3335
+ "policies": {},
3336
+ "checkConstraints": {},
3337
+ "isRLSEnabled": false
3338
+ },
3339
+ "public.workflow_run_execution": {
3340
+ "name": "workflow_run_execution",
3341
+ "schema": "",
3342
+ "columns": {
3343
+ "id": {
3344
+ "name": "id",
3345
+ "type": "text",
3346
+ "primaryKey": true,
3347
+ "notNull": true
3348
+ },
3349
+ "run_id": {
3350
+ "name": "run_id",
3351
+ "type": "text",
3352
+ "primaryKey": false,
3353
+ "notNull": true
3354
+ },
3355
+ "message_id": {
3356
+ "name": "message_id",
3357
+ "type": "text",
3358
+ "primaryKey": false,
3359
+ "notNull": true
3360
+ },
3361
+ "status": {
3362
+ "name": "status",
3363
+ "type": "text",
3364
+ "primaryKey": false,
3365
+ "notNull": true,
3366
+ "default": "'running'"
3367
+ },
3368
+ "started_at": {
3369
+ "name": "started_at",
3370
+ "type": "timestamp",
3371
+ "primaryKey": false,
3372
+ "notNull": true,
3373
+ "default": "now()"
3374
+ },
3375
+ "ended_at": {
3376
+ "name": "ended_at",
3377
+ "type": "timestamp",
3378
+ "primaryKey": false,
3379
+ "notNull": false
3380
+ },
3381
+ "failure_reason": {
3382
+ "name": "failure_reason",
3383
+ "type": "text",
3384
+ "primaryKey": false,
3385
+ "notNull": false
3386
+ }
3387
+ },
3388
+ "indexes": {
3389
+ "workflow_run_execution_run_id_id_idx": {
3390
+ "name": "workflow_run_execution_run_id_id_idx",
3391
+ "columns": [
3392
+ {
3393
+ "expression": "run_id",
3394
+ "isExpression": false,
3395
+ "asc": true,
3396
+ "nulls": "last"
3397
+ },
3398
+ {
3399
+ "expression": "id",
3400
+ "isExpression": false,
3401
+ "asc": true,
3402
+ "nulls": "last"
3403
+ }
3404
+ ],
3405
+ "isUnique": true,
3406
+ "concurrently": false,
3407
+ "method": "btree",
3408
+ "with": {}
3409
+ },
3410
+ "workflow_run_execution_status_idx": {
3411
+ "name": "workflow_run_execution_status_idx",
3412
+ "columns": [
3413
+ {
3414
+ "expression": "status",
3415
+ "isExpression": false,
3416
+ "asc": true,
3417
+ "nulls": "last"
3418
+ }
3419
+ ],
3420
+ "isUnique": false,
3421
+ "concurrently": false,
3422
+ "method": "btree",
3423
+ "with": {}
3424
+ }
3425
+ },
3426
+ "foreignKeys": {
3427
+ "workflow_run_execution_run_id_workflow_run_id_fk": {
3428
+ "name": "workflow_run_execution_run_id_workflow_run_id_fk",
3429
+ "tableFrom": "workflow_run_execution",
3430
+ "tableTo": "workflow_run",
3431
+ "columnsFrom": ["run_id"],
3432
+ "columnsTo": ["id"],
3433
+ "onDelete": "cascade",
3434
+ "onUpdate": "no action"
3435
+ }
3436
+ },
3437
+ "compositePrimaryKeys": {},
3438
+ "uniqueConstraints": {},
3439
+ "policies": {},
3440
+ "checkConstraints": {},
3441
+ "isRLSEnabled": false
3442
+ }
3443
+ },
3444
+ "enums": {},
3445
+ "schemas": {},
3446
+ "sequences": {},
3447
+ "roles": {},
3448
+ "policies": {},
3449
+ "views": {},
3450
+ "_meta": {
3451
+ "columns": {},
3452
+ "schemas": {},
3453
+ "tables": {}
3454
+ }
3455
+ }