@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,4096 @@
1
+ {
2
+ "id": "b84ce2f6-fec4-4c5e-8938-0ca0f32eb128",
3
+ "prevId": "d956c545-4e86-4d86-a3f8-d408c98eea2e",
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
+ "anchor_run_id": {
847
+ "name": "anchor_run_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_anchor_run_idx": {
951
+ "name": "approval_anchor_run_idx",
952
+ "columns": [
953
+ {
954
+ "expression": "anchor_run_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_anchor_run_id_workflow_run_id_fk": {
977
+ "name": "approval_anchor_run_id_workflow_run_id_fk",
978
+ "tableFrom": "approval",
979
+ "tableTo": "workflow_run",
980
+ "columnsFrom": ["anchor_run_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
+ "anchor_run_id": {
1024
+ "name": "anchor_run_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_anchor_run_id_workflow_run_id_fk": {
1085
+ "name": "signal_correlation_anchor_run_id_workflow_run_id_fk",
1086
+ "tableFrom": "signal_correlation",
1087
+ "tableTo": "workflow_run",
1088
+ "columnsFrom": ["anchor_run_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
+ "api_base_url": {
1138
+ "name": "api_base_url",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": false
1142
+ },
1143
+ "authorization_url": {
1144
+ "name": "authorization_url",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": false
1148
+ },
1149
+ "token_url": {
1150
+ "name": "token_url",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ },
1155
+ "user_info_url": {
1156
+ "name": "user_info_url",
1157
+ "type": "text",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "scopes": {
1162
+ "name": "scopes",
1163
+ "type": "text[]",
1164
+ "primaryKey": false,
1165
+ "notNull": false
1166
+ },
1167
+ "metadata": {
1168
+ "name": "metadata",
1169
+ "type": "jsonb",
1170
+ "primaryKey": false,
1171
+ "notNull": false
1172
+ },
1173
+ "created_at": {
1174
+ "name": "created_at",
1175
+ "type": "timestamp",
1176
+ "primaryKey": false,
1177
+ "notNull": true,
1178
+ "default": "now()"
1179
+ },
1180
+ "updated_at": {
1181
+ "name": "updated_at",
1182
+ "type": "timestamp",
1183
+ "primaryKey": false,
1184
+ "notNull": true,
1185
+ "default": "now()"
1186
+ }
1187
+ },
1188
+ "indexes": {},
1189
+ "foreignKeys": {
1190
+ "provider_tenant_id_tenant_id_fk": {
1191
+ "name": "provider_tenant_id_tenant_id_fk",
1192
+ "tableFrom": "provider",
1193
+ "tableTo": "tenant",
1194
+ "columnsFrom": ["tenant_id"],
1195
+ "columnsTo": ["id"],
1196
+ "onDelete": "cascade",
1197
+ "onUpdate": "no action"
1198
+ }
1199
+ },
1200
+ "compositePrimaryKeys": {},
1201
+ "uniqueConstraints": {
1202
+ "provider_tenant_name": {
1203
+ "name": "provider_tenant_name",
1204
+ "nullsNotDistinct": false,
1205
+ "columns": ["tenant_id", "name"]
1206
+ }
1207
+ },
1208
+ "policies": {},
1209
+ "checkConstraints": {},
1210
+ "isRLSEnabled": false
1211
+ },
1212
+ "public.oauth_client": {
1213
+ "name": "oauth_client",
1214
+ "schema": "",
1215
+ "columns": {
1216
+ "id": {
1217
+ "name": "id",
1218
+ "type": "text",
1219
+ "primaryKey": true,
1220
+ "notNull": true
1221
+ },
1222
+ "tenant_id": {
1223
+ "name": "tenant_id",
1224
+ "type": "text",
1225
+ "primaryKey": false,
1226
+ "notNull": true
1227
+ },
1228
+ "provider_id": {
1229
+ "name": "provider_id",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": true
1233
+ },
1234
+ "name": {
1235
+ "name": "name",
1236
+ "type": "text",
1237
+ "primaryKey": false,
1238
+ "notNull": true
1239
+ },
1240
+ "client_id": {
1241
+ "name": "client_id",
1242
+ "type": "text",
1243
+ "primaryKey": false,
1244
+ "notNull": true
1245
+ },
1246
+ "client_secret": {
1247
+ "name": "client_secret",
1248
+ "type": "text",
1249
+ "primaryKey": false,
1250
+ "notNull": true
1251
+ },
1252
+ "redirect_uris": {
1253
+ "name": "redirect_uris",
1254
+ "type": "text[]",
1255
+ "primaryKey": false,
1256
+ "notNull": false
1257
+ },
1258
+ "default_scopes": {
1259
+ "name": "default_scopes",
1260
+ "type": "text[]",
1261
+ "primaryKey": false,
1262
+ "notNull": false
1263
+ },
1264
+ "metadata": {
1265
+ "name": "metadata",
1266
+ "type": "jsonb",
1267
+ "primaryKey": false,
1268
+ "notNull": false
1269
+ },
1270
+ "created_at": {
1271
+ "name": "created_at",
1272
+ "type": "timestamp",
1273
+ "primaryKey": false,
1274
+ "notNull": true,
1275
+ "default": "now()"
1276
+ },
1277
+ "updated_at": {
1278
+ "name": "updated_at",
1279
+ "type": "timestamp",
1280
+ "primaryKey": false,
1281
+ "notNull": true,
1282
+ "default": "now()"
1283
+ }
1284
+ },
1285
+ "indexes": {},
1286
+ "foreignKeys": {
1287
+ "oauth_client_tenant_id_tenant_id_fk": {
1288
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1289
+ "tableFrom": "oauth_client",
1290
+ "tableTo": "tenant",
1291
+ "columnsFrom": ["tenant_id"],
1292
+ "columnsTo": ["id"],
1293
+ "onDelete": "cascade",
1294
+ "onUpdate": "no action"
1295
+ },
1296
+ "oauth_client_provider_id_provider_id_fk": {
1297
+ "name": "oauth_client_provider_id_provider_id_fk",
1298
+ "tableFrom": "oauth_client",
1299
+ "tableTo": "provider",
1300
+ "columnsFrom": ["provider_id"],
1301
+ "columnsTo": ["id"],
1302
+ "onDelete": "cascade",
1303
+ "onUpdate": "no action"
1304
+ }
1305
+ },
1306
+ "compositePrimaryKeys": {},
1307
+ "uniqueConstraints": {
1308
+ "oauth_client_tenant_provider": {
1309
+ "name": "oauth_client_tenant_provider",
1310
+ "nullsNotDistinct": false,
1311
+ "columns": ["tenant_id", "provider_id"]
1312
+ }
1313
+ },
1314
+ "policies": {},
1315
+ "checkConstraints": {},
1316
+ "isRLSEnabled": false
1317
+ },
1318
+ "public.credential": {
1319
+ "name": "credential",
1320
+ "schema": "",
1321
+ "columns": {
1322
+ "id": {
1323
+ "name": "id",
1324
+ "type": "text",
1325
+ "primaryKey": true,
1326
+ "notNull": true
1327
+ },
1328
+ "tenant_id": {
1329
+ "name": "tenant_id",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true
1333
+ },
1334
+ "principal_id": {
1335
+ "name": "principal_id",
1336
+ "type": "text",
1337
+ "primaryKey": false,
1338
+ "notNull": false
1339
+ },
1340
+ "provider_id": {
1341
+ "name": "provider_id",
1342
+ "type": "text",
1343
+ "primaryKey": false,
1344
+ "notNull": true
1345
+ },
1346
+ "oauth_client_id": {
1347
+ "name": "oauth_client_id",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": false
1351
+ },
1352
+ "name": {
1353
+ "name": "name",
1354
+ "type": "text",
1355
+ "primaryKey": false,
1356
+ "notNull": true
1357
+ },
1358
+ "type": {
1359
+ "name": "type",
1360
+ "type": "text",
1361
+ "primaryKey": false,
1362
+ "notNull": true
1363
+ },
1364
+ "description": {
1365
+ "name": "description",
1366
+ "type": "text",
1367
+ "primaryKey": false,
1368
+ "notNull": false
1369
+ },
1370
+ "secret": {
1371
+ "name": "secret",
1372
+ "type": "text",
1373
+ "primaryKey": false,
1374
+ "notNull": true
1375
+ },
1376
+ "refresh_secret": {
1377
+ "name": "refresh_secret",
1378
+ "type": "text",
1379
+ "primaryKey": false,
1380
+ "notNull": false
1381
+ },
1382
+ "scopes": {
1383
+ "name": "scopes",
1384
+ "type": "text[]",
1385
+ "primaryKey": false,
1386
+ "notNull": false
1387
+ },
1388
+ "expires_at": {
1389
+ "name": "expires_at",
1390
+ "type": "timestamp",
1391
+ "primaryKey": false,
1392
+ "notNull": false
1393
+ },
1394
+ "status": {
1395
+ "name": "status",
1396
+ "type": "text",
1397
+ "primaryKey": false,
1398
+ "notNull": true,
1399
+ "default": "'active'"
1400
+ },
1401
+ "metadata": {
1402
+ "name": "metadata",
1403
+ "type": "jsonb",
1404
+ "primaryKey": false,
1405
+ "notNull": false
1406
+ },
1407
+ "created_at": {
1408
+ "name": "created_at",
1409
+ "type": "timestamp",
1410
+ "primaryKey": false,
1411
+ "notNull": true,
1412
+ "default": "now()"
1413
+ },
1414
+ "updated_at": {
1415
+ "name": "updated_at",
1416
+ "type": "timestamp",
1417
+ "primaryKey": false,
1418
+ "notNull": true,
1419
+ "default": "now()"
1420
+ }
1421
+ },
1422
+ "indexes": {},
1423
+ "foreignKeys": {
1424
+ "credential_tenant_id_tenant_id_fk": {
1425
+ "name": "credential_tenant_id_tenant_id_fk",
1426
+ "tableFrom": "credential",
1427
+ "tableTo": "tenant",
1428
+ "columnsFrom": ["tenant_id"],
1429
+ "columnsTo": ["id"],
1430
+ "onDelete": "cascade",
1431
+ "onUpdate": "no action"
1432
+ },
1433
+ "credential_principal_id_principal_id_fk": {
1434
+ "name": "credential_principal_id_principal_id_fk",
1435
+ "tableFrom": "credential",
1436
+ "tableTo": "principal",
1437
+ "columnsFrom": ["principal_id"],
1438
+ "columnsTo": ["id"],
1439
+ "onDelete": "set null",
1440
+ "onUpdate": "no action"
1441
+ },
1442
+ "credential_provider_id_provider_id_fk": {
1443
+ "name": "credential_provider_id_provider_id_fk",
1444
+ "tableFrom": "credential",
1445
+ "tableTo": "provider",
1446
+ "columnsFrom": ["provider_id"],
1447
+ "columnsTo": ["id"],
1448
+ "onDelete": "cascade",
1449
+ "onUpdate": "no action"
1450
+ },
1451
+ "credential_oauth_client_id_oauth_client_id_fk": {
1452
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1453
+ "tableFrom": "credential",
1454
+ "tableTo": "oauth_client",
1455
+ "columnsFrom": ["oauth_client_id"],
1456
+ "columnsTo": ["id"],
1457
+ "onDelete": "set null",
1458
+ "onUpdate": "no action"
1459
+ }
1460
+ },
1461
+ "compositePrimaryKeys": {},
1462
+ "uniqueConstraints": {
1463
+ "credential_tenant_name": {
1464
+ "name": "credential_tenant_name",
1465
+ "nullsNotDistinct": false,
1466
+ "columns": ["tenant_id", "name"]
1467
+ }
1468
+ },
1469
+ "policies": {},
1470
+ "checkConstraints": {},
1471
+ "isRLSEnabled": false
1472
+ },
1473
+ "public.asset": {
1474
+ "name": "asset",
1475
+ "schema": "",
1476
+ "columns": {
1477
+ "id": {
1478
+ "name": "id",
1479
+ "type": "text",
1480
+ "primaryKey": true,
1481
+ "notNull": true
1482
+ },
1483
+ "tenant_id": {
1484
+ "name": "tenant_id",
1485
+ "type": "text",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ },
1489
+ "kind": {
1490
+ "name": "kind",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "name": {
1496
+ "name": "name",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ },
1501
+ "display_name": {
1502
+ "name": "display_name",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": false
1506
+ },
1507
+ "creator_principal_id": {
1508
+ "name": "creator_principal_id",
1509
+ "type": "text",
1510
+ "primaryKey": false,
1511
+ "notNull": false
1512
+ },
1513
+ "created_at": {
1514
+ "name": "created_at",
1515
+ "type": "timestamp",
1516
+ "primaryKey": false,
1517
+ "notNull": true,
1518
+ "default": "now()"
1519
+ },
1520
+ "updated_at": {
1521
+ "name": "updated_at",
1522
+ "type": "timestamp",
1523
+ "primaryKey": false,
1524
+ "notNull": true,
1525
+ "default": "now()"
1526
+ }
1527
+ },
1528
+ "indexes": {},
1529
+ "foreignKeys": {
1530
+ "asset_tenant_id_tenant_id_fk": {
1531
+ "name": "asset_tenant_id_tenant_id_fk",
1532
+ "tableFrom": "asset",
1533
+ "tableTo": "tenant",
1534
+ "columnsFrom": ["tenant_id"],
1535
+ "columnsTo": ["id"],
1536
+ "onDelete": "cascade",
1537
+ "onUpdate": "no action"
1538
+ },
1539
+ "asset_creator_principal_id_principal_id_fk": {
1540
+ "name": "asset_creator_principal_id_principal_id_fk",
1541
+ "tableFrom": "asset",
1542
+ "tableTo": "principal",
1543
+ "columnsFrom": ["creator_principal_id"],
1544
+ "columnsTo": ["id"],
1545
+ "onDelete": "set null",
1546
+ "onUpdate": "no action"
1547
+ }
1548
+ },
1549
+ "compositePrimaryKeys": {},
1550
+ "uniqueConstraints": {
1551
+ "asset_tenant_kind_name": {
1552
+ "name": "asset_tenant_kind_name",
1553
+ "nullsNotDistinct": false,
1554
+ "columns": ["tenant_id", "kind", "name"]
1555
+ }
1556
+ },
1557
+ "policies": {},
1558
+ "checkConstraints": {},
1559
+ "isRLSEnabled": false
1560
+ },
1561
+ "public.transaction": {
1562
+ "name": "transaction",
1563
+ "schema": "",
1564
+ "columns": {
1565
+ "id": {
1566
+ "name": "id",
1567
+ "type": "text",
1568
+ "primaryKey": true,
1569
+ "notNull": true
1570
+ },
1571
+ "wallet_id": {
1572
+ "name": "wallet_id",
1573
+ "type": "text",
1574
+ "primaryKey": false,
1575
+ "notNull": true
1576
+ },
1577
+ "run_id": {
1578
+ "name": "run_id",
1579
+ "type": "text",
1580
+ "primaryKey": false,
1581
+ "notNull": false
1582
+ },
1583
+ "direction": {
1584
+ "name": "direction",
1585
+ "type": "text",
1586
+ "primaryKey": false,
1587
+ "notNull": true
1588
+ },
1589
+ "amount": {
1590
+ "name": "amount",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": true
1594
+ },
1595
+ "currency": {
1596
+ "name": "currency",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": true
1600
+ },
1601
+ "recipient_id": {
1602
+ "name": "recipient_id",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": false
1606
+ },
1607
+ "sender_id": {
1608
+ "name": "sender_id",
1609
+ "type": "text",
1610
+ "primaryKey": false,
1611
+ "notNull": false
1612
+ },
1613
+ "request_id": {
1614
+ "name": "request_id",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": false
1618
+ },
1619
+ "status": {
1620
+ "name": "status",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "default": "'pending'"
1625
+ },
1626
+ "created_at": {
1627
+ "name": "created_at",
1628
+ "type": "timestamp",
1629
+ "primaryKey": false,
1630
+ "notNull": true,
1631
+ "default": "now()"
1632
+ }
1633
+ },
1634
+ "indexes": {},
1635
+ "foreignKeys": {
1636
+ "transaction_wallet_id_wallet_id_fk": {
1637
+ "name": "transaction_wallet_id_wallet_id_fk",
1638
+ "tableFrom": "transaction",
1639
+ "tableTo": "wallet",
1640
+ "columnsFrom": ["wallet_id"],
1641
+ "columnsTo": ["id"],
1642
+ "onDelete": "cascade",
1643
+ "onUpdate": "no action"
1644
+ },
1645
+ "transaction_run_id_workflow_run_id_fk": {
1646
+ "name": "transaction_run_id_workflow_run_id_fk",
1647
+ "tableFrom": "transaction",
1648
+ "tableTo": "workflow_run",
1649
+ "columnsFrom": ["run_id"],
1650
+ "columnsTo": ["id"],
1651
+ "onDelete": "set null",
1652
+ "onUpdate": "no action"
1653
+ }
1654
+ },
1655
+ "compositePrimaryKeys": {},
1656
+ "uniqueConstraints": {},
1657
+ "policies": {},
1658
+ "checkConstraints": {},
1659
+ "isRLSEnabled": false
1660
+ },
1661
+ "public.wallet": {
1662
+ "name": "wallet",
1663
+ "schema": "",
1664
+ "columns": {
1665
+ "id": {
1666
+ "name": "id",
1667
+ "type": "text",
1668
+ "primaryKey": true,
1669
+ "notNull": true
1670
+ },
1671
+ "tenant_id": {
1672
+ "name": "tenant_id",
1673
+ "type": "text",
1674
+ "primaryKey": false,
1675
+ "notNull": true
1676
+ },
1677
+ "name": {
1678
+ "name": "name",
1679
+ "type": "text",
1680
+ "primaryKey": false,
1681
+ "notNull": true
1682
+ },
1683
+ "backend_type": {
1684
+ "name": "backend_type",
1685
+ "type": "text",
1686
+ "primaryKey": false,
1687
+ "notNull": true
1688
+ },
1689
+ "currency": {
1690
+ "name": "currency",
1691
+ "type": "text",
1692
+ "primaryKey": false,
1693
+ "notNull": true
1694
+ },
1695
+ "balance": {
1696
+ "name": "balance",
1697
+ "type": "text",
1698
+ "primaryKey": false,
1699
+ "notNull": true,
1700
+ "default": "'0'"
1701
+ },
1702
+ "config": {
1703
+ "name": "config",
1704
+ "type": "jsonb",
1705
+ "primaryKey": false,
1706
+ "notNull": false
1707
+ },
1708
+ "created_at": {
1709
+ "name": "created_at",
1710
+ "type": "timestamp",
1711
+ "primaryKey": false,
1712
+ "notNull": true,
1713
+ "default": "now()"
1714
+ },
1715
+ "updated_at": {
1716
+ "name": "updated_at",
1717
+ "type": "timestamp",
1718
+ "primaryKey": false,
1719
+ "notNull": true,
1720
+ "default": "now()"
1721
+ }
1722
+ },
1723
+ "indexes": {},
1724
+ "foreignKeys": {
1725
+ "wallet_tenant_id_tenant_id_fk": {
1726
+ "name": "wallet_tenant_id_tenant_id_fk",
1727
+ "tableFrom": "wallet",
1728
+ "tableTo": "tenant",
1729
+ "columnsFrom": ["tenant_id"],
1730
+ "columnsTo": ["id"],
1731
+ "onDelete": "cascade",
1732
+ "onUpdate": "no action"
1733
+ }
1734
+ },
1735
+ "compositePrimaryKeys": {},
1736
+ "uniqueConstraints": {},
1737
+ "policies": {},
1738
+ "checkConstraints": {},
1739
+ "isRLSEnabled": false
1740
+ },
1741
+ "public.offering": {
1742
+ "name": "offering",
1743
+ "schema": "",
1744
+ "columns": {
1745
+ "id": {
1746
+ "name": "id",
1747
+ "type": "text",
1748
+ "primaryKey": true,
1749
+ "notNull": true
1750
+ },
1751
+ "agent_id": {
1752
+ "name": "agent_id",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true
1756
+ },
1757
+ "tenant_id": {
1758
+ "name": "tenant_id",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": true
1762
+ },
1763
+ "name": {
1764
+ "name": "name",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "description": {
1770
+ "name": "description",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": false
1774
+ },
1775
+ "pricing": {
1776
+ "name": "pricing",
1777
+ "type": "jsonb",
1778
+ "primaryKey": false,
1779
+ "notNull": false
1780
+ },
1781
+ "schema": {
1782
+ "name": "schema",
1783
+ "type": "jsonb",
1784
+ "primaryKey": false,
1785
+ "notNull": false
1786
+ },
1787
+ "created_at": {
1788
+ "name": "created_at",
1789
+ "type": "timestamp",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "default": "now()"
1793
+ },
1794
+ "updated_at": {
1795
+ "name": "updated_at",
1796
+ "type": "timestamp",
1797
+ "primaryKey": false,
1798
+ "notNull": true,
1799
+ "default": "now()"
1800
+ }
1801
+ },
1802
+ "indexes": {},
1803
+ "foreignKeys": {
1804
+ "offering_agent_id_workflow_definition_id_fk": {
1805
+ "name": "offering_agent_id_workflow_definition_id_fk",
1806
+ "tableFrom": "offering",
1807
+ "tableTo": "workflow_definition",
1808
+ "columnsFrom": ["agent_id"],
1809
+ "columnsTo": ["id"],
1810
+ "onDelete": "restrict",
1811
+ "onUpdate": "no action"
1812
+ },
1813
+ "offering_tenant_id_tenant_id_fk": {
1814
+ "name": "offering_tenant_id_tenant_id_fk",
1815
+ "tableFrom": "offering",
1816
+ "tableTo": "tenant",
1817
+ "columnsFrom": ["tenant_id"],
1818
+ "columnsTo": ["id"],
1819
+ "onDelete": "cascade",
1820
+ "onUpdate": "no action"
1821
+ }
1822
+ },
1823
+ "compositePrimaryKeys": {},
1824
+ "uniqueConstraints": {},
1825
+ "policies": {},
1826
+ "checkConstraints": {},
1827
+ "isRLSEnabled": false
1828
+ },
1829
+ "public.model": {
1830
+ "name": "model",
1831
+ "schema": "",
1832
+ "columns": {
1833
+ "id": {
1834
+ "name": "id",
1835
+ "type": "text",
1836
+ "primaryKey": true,
1837
+ "notNull": true
1838
+ },
1839
+ "tenant_id": {
1840
+ "name": "tenant_id",
1841
+ "type": "text",
1842
+ "primaryKey": false,
1843
+ "notNull": true
1844
+ },
1845
+ "canonical_name": {
1846
+ "name": "canonical_name",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": true
1850
+ },
1851
+ "display_name": {
1852
+ "name": "display_name",
1853
+ "type": "text",
1854
+ "primaryKey": false,
1855
+ "notNull": false
1856
+ },
1857
+ "description": {
1858
+ "name": "description",
1859
+ "type": "text",
1860
+ "primaryKey": false,
1861
+ "notNull": false
1862
+ },
1863
+ "disabled": {
1864
+ "name": "disabled",
1865
+ "type": "boolean",
1866
+ "primaryKey": false,
1867
+ "notNull": true,
1868
+ "default": false
1869
+ },
1870
+ "created_at": {
1871
+ "name": "created_at",
1872
+ "type": "timestamp",
1873
+ "primaryKey": false,
1874
+ "notNull": true,
1875
+ "default": "now()"
1876
+ },
1877
+ "updated_at": {
1878
+ "name": "updated_at",
1879
+ "type": "timestamp",
1880
+ "primaryKey": false,
1881
+ "notNull": true,
1882
+ "default": "now()"
1883
+ }
1884
+ },
1885
+ "indexes": {},
1886
+ "foreignKeys": {
1887
+ "model_tenant_id_tenant_id_fk": {
1888
+ "name": "model_tenant_id_tenant_id_fk",
1889
+ "tableFrom": "model",
1890
+ "tableTo": "tenant",
1891
+ "columnsFrom": ["tenant_id"],
1892
+ "columnsTo": ["id"],
1893
+ "onDelete": "cascade",
1894
+ "onUpdate": "no action"
1895
+ }
1896
+ },
1897
+ "compositePrimaryKeys": {},
1898
+ "uniqueConstraints": {
1899
+ "model_tenant_canonical_name": {
1900
+ "name": "model_tenant_canonical_name",
1901
+ "nullsNotDistinct": false,
1902
+ "columns": ["tenant_id", "canonical_name"]
1903
+ }
1904
+ },
1905
+ "policies": {},
1906
+ "checkConstraints": {},
1907
+ "isRLSEnabled": false
1908
+ },
1909
+ "public.model_offering": {
1910
+ "name": "model_offering",
1911
+ "schema": "",
1912
+ "columns": {
1913
+ "id": {
1914
+ "name": "id",
1915
+ "type": "text",
1916
+ "primaryKey": true,
1917
+ "notNull": true
1918
+ },
1919
+ "tenant_id": {
1920
+ "name": "tenant_id",
1921
+ "type": "text",
1922
+ "primaryKey": false,
1923
+ "notNull": true
1924
+ },
1925
+ "model_id": {
1926
+ "name": "model_id",
1927
+ "type": "text",
1928
+ "primaryKey": false,
1929
+ "notNull": true
1930
+ },
1931
+ "provider_id": {
1932
+ "name": "provider_id",
1933
+ "type": "text",
1934
+ "primaryKey": false,
1935
+ "notNull": true
1936
+ },
1937
+ "priority": {
1938
+ "name": "priority",
1939
+ "type": "integer",
1940
+ "primaryKey": false,
1941
+ "notNull": true
1942
+ },
1943
+ "deployment_tags": {
1944
+ "name": "deployment_tags",
1945
+ "type": "text[]",
1946
+ "primaryKey": false,
1947
+ "notNull": true,
1948
+ "default": "'{}'"
1949
+ },
1950
+ "capabilities": {
1951
+ "name": "capabilities",
1952
+ "type": "text[]",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "default": "'{}'"
1956
+ },
1957
+ "quirks": {
1958
+ "name": "quirks",
1959
+ "type": "jsonb",
1960
+ "primaryKey": false,
1961
+ "notNull": false
1962
+ },
1963
+ "disabled": {
1964
+ "name": "disabled",
1965
+ "type": "boolean",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "default": false
1969
+ },
1970
+ "created_at": {
1971
+ "name": "created_at",
1972
+ "type": "timestamp",
1973
+ "primaryKey": false,
1974
+ "notNull": true,
1975
+ "default": "now()"
1976
+ },
1977
+ "updated_at": {
1978
+ "name": "updated_at",
1979
+ "type": "timestamp",
1980
+ "primaryKey": false,
1981
+ "notNull": true,
1982
+ "default": "now()"
1983
+ }
1984
+ },
1985
+ "indexes": {},
1986
+ "foreignKeys": {
1987
+ "model_offering_tenant_id_tenant_id_fk": {
1988
+ "name": "model_offering_tenant_id_tenant_id_fk",
1989
+ "tableFrom": "model_offering",
1990
+ "tableTo": "tenant",
1991
+ "columnsFrom": ["tenant_id"],
1992
+ "columnsTo": ["id"],
1993
+ "onDelete": "cascade",
1994
+ "onUpdate": "no action"
1995
+ },
1996
+ "model_offering_model_id_model_id_fk": {
1997
+ "name": "model_offering_model_id_model_id_fk",
1998
+ "tableFrom": "model_offering",
1999
+ "tableTo": "model",
2000
+ "columnsFrom": ["model_id"],
2001
+ "columnsTo": ["id"],
2002
+ "onDelete": "cascade",
2003
+ "onUpdate": "no action"
2004
+ },
2005
+ "model_offering_provider_id_model_provider_id_fk": {
2006
+ "name": "model_offering_provider_id_model_provider_id_fk",
2007
+ "tableFrom": "model_offering",
2008
+ "tableTo": "model_provider",
2009
+ "columnsFrom": ["provider_id"],
2010
+ "columnsTo": ["id"],
2011
+ "onDelete": "cascade",
2012
+ "onUpdate": "no action"
2013
+ }
2014
+ },
2015
+ "compositePrimaryKeys": {},
2016
+ "uniqueConstraints": {
2017
+ "model_offering_tenant_model_provider": {
2018
+ "name": "model_offering_tenant_model_provider",
2019
+ "nullsNotDistinct": false,
2020
+ "columns": ["tenant_id", "model_id", "provider_id"]
2021
+ }
2022
+ },
2023
+ "policies": {},
2024
+ "checkConstraints": {},
2025
+ "isRLSEnabled": false
2026
+ },
2027
+ "public.model_pricing": {
2028
+ "name": "model_pricing",
2029
+ "schema": "",
2030
+ "columns": {
2031
+ "id": {
2032
+ "name": "id",
2033
+ "type": "text",
2034
+ "primaryKey": true,
2035
+ "notNull": true
2036
+ },
2037
+ "tenant_id": {
2038
+ "name": "tenant_id",
2039
+ "type": "text",
2040
+ "primaryKey": false,
2041
+ "notNull": true
2042
+ },
2043
+ "offering_id": {
2044
+ "name": "offering_id",
2045
+ "type": "text",
2046
+ "primaryKey": false,
2047
+ "notNull": true
2048
+ },
2049
+ "currency": {
2050
+ "name": "currency",
2051
+ "type": "text",
2052
+ "primaryKey": false,
2053
+ "notNull": true
2054
+ },
2055
+ "input_token_price": {
2056
+ "name": "input_token_price",
2057
+ "type": "text",
2058
+ "primaryKey": false,
2059
+ "notNull": false
2060
+ },
2061
+ "output_token_price": {
2062
+ "name": "output_token_price",
2063
+ "type": "text",
2064
+ "primaryKey": false,
2065
+ "notNull": false
2066
+ },
2067
+ "cache_read_token_price": {
2068
+ "name": "cache_read_token_price",
2069
+ "type": "text",
2070
+ "primaryKey": false,
2071
+ "notNull": false
2072
+ },
2073
+ "cache_write_token_price": {
2074
+ "name": "cache_write_token_price",
2075
+ "type": "text",
2076
+ "primaryKey": false,
2077
+ "notNull": false
2078
+ },
2079
+ "thinking_token_price": {
2080
+ "name": "thinking_token_price",
2081
+ "type": "text",
2082
+ "primaryKey": false,
2083
+ "notNull": false
2084
+ },
2085
+ "per_request_fee": {
2086
+ "name": "per_request_fee",
2087
+ "type": "text",
2088
+ "primaryKey": false,
2089
+ "notNull": false
2090
+ },
2091
+ "per_image_fee": {
2092
+ "name": "per_image_fee",
2093
+ "type": "text",
2094
+ "primaryKey": false,
2095
+ "notNull": false
2096
+ },
2097
+ "per_audio_fee": {
2098
+ "name": "per_audio_fee",
2099
+ "type": "text",
2100
+ "primaryKey": false,
2101
+ "notNull": false
2102
+ },
2103
+ "effective_from": {
2104
+ "name": "effective_from",
2105
+ "type": "timestamp with time zone",
2106
+ "primaryKey": false,
2107
+ "notNull": true
2108
+ },
2109
+ "created_at": {
2110
+ "name": "created_at",
2111
+ "type": "timestamp with time zone",
2112
+ "primaryKey": false,
2113
+ "notNull": true,
2114
+ "default": "now()"
2115
+ }
2116
+ },
2117
+ "indexes": {},
2118
+ "foreignKeys": {
2119
+ "model_pricing_tenant_id_tenant_id_fk": {
2120
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2121
+ "tableFrom": "model_pricing",
2122
+ "tableTo": "tenant",
2123
+ "columnsFrom": ["tenant_id"],
2124
+ "columnsTo": ["id"],
2125
+ "onDelete": "cascade",
2126
+ "onUpdate": "no action"
2127
+ },
2128
+ "model_pricing_offering_id_model_offering_id_fk": {
2129
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2130
+ "tableFrom": "model_pricing",
2131
+ "tableTo": "model_offering",
2132
+ "columnsFrom": ["offering_id"],
2133
+ "columnsTo": ["id"],
2134
+ "onDelete": "cascade",
2135
+ "onUpdate": "no action"
2136
+ }
2137
+ },
2138
+ "compositePrimaryKeys": {},
2139
+ "uniqueConstraints": {
2140
+ "model_pricing_offering_currency_effective_from": {
2141
+ "name": "model_pricing_offering_currency_effective_from",
2142
+ "nullsNotDistinct": false,
2143
+ "columns": ["offering_id", "currency", "effective_from"]
2144
+ }
2145
+ },
2146
+ "policies": {},
2147
+ "checkConstraints": {},
2148
+ "isRLSEnabled": false
2149
+ },
2150
+ "public.model_provider": {
2151
+ "name": "model_provider",
2152
+ "schema": "",
2153
+ "columns": {
2154
+ "id": {
2155
+ "name": "id",
2156
+ "type": "text",
2157
+ "primaryKey": true,
2158
+ "notNull": true
2159
+ },
2160
+ "tenant_id": {
2161
+ "name": "tenant_id",
2162
+ "type": "text",
2163
+ "primaryKey": false,
2164
+ "notNull": true
2165
+ },
2166
+ "name": {
2167
+ "name": "name",
2168
+ "type": "text",
2169
+ "primaryKey": false,
2170
+ "notNull": true
2171
+ },
2172
+ "plugin": {
2173
+ "name": "plugin",
2174
+ "type": "text",
2175
+ "primaryKey": false,
2176
+ "notNull": true
2177
+ },
2178
+ "base_url": {
2179
+ "name": "base_url",
2180
+ "type": "text",
2181
+ "primaryKey": false,
2182
+ "notNull": true
2183
+ },
2184
+ "credential_id": {
2185
+ "name": "credential_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": false
2189
+ },
2190
+ "wallet_id": {
2191
+ "name": "wallet_id",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": false
2195
+ },
2196
+ "disabled": {
2197
+ "name": "disabled",
2198
+ "type": "boolean",
2199
+ "primaryKey": false,
2200
+ "notNull": true,
2201
+ "default": false
2202
+ },
2203
+ "created_at": {
2204
+ "name": "created_at",
2205
+ "type": "timestamp",
2206
+ "primaryKey": false,
2207
+ "notNull": true,
2208
+ "default": "now()"
2209
+ },
2210
+ "updated_at": {
2211
+ "name": "updated_at",
2212
+ "type": "timestamp",
2213
+ "primaryKey": false,
2214
+ "notNull": true,
2215
+ "default": "now()"
2216
+ }
2217
+ },
2218
+ "indexes": {},
2219
+ "foreignKeys": {
2220
+ "model_provider_tenant_id_tenant_id_fk": {
2221
+ "name": "model_provider_tenant_id_tenant_id_fk",
2222
+ "tableFrom": "model_provider",
2223
+ "tableTo": "tenant",
2224
+ "columnsFrom": ["tenant_id"],
2225
+ "columnsTo": ["id"],
2226
+ "onDelete": "cascade",
2227
+ "onUpdate": "no action"
2228
+ },
2229
+ "model_provider_credential_id_credential_id_fk": {
2230
+ "name": "model_provider_credential_id_credential_id_fk",
2231
+ "tableFrom": "model_provider",
2232
+ "tableTo": "credential",
2233
+ "columnsFrom": ["credential_id"],
2234
+ "columnsTo": ["id"],
2235
+ "onDelete": "restrict",
2236
+ "onUpdate": "no action"
2237
+ },
2238
+ "model_provider_wallet_id_wallet_id_fk": {
2239
+ "name": "model_provider_wallet_id_wallet_id_fk",
2240
+ "tableFrom": "model_provider",
2241
+ "tableTo": "wallet",
2242
+ "columnsFrom": ["wallet_id"],
2243
+ "columnsTo": ["id"],
2244
+ "onDelete": "restrict",
2245
+ "onUpdate": "no action"
2246
+ }
2247
+ },
2248
+ "compositePrimaryKeys": {},
2249
+ "uniqueConstraints": {
2250
+ "model_provider_tenant_name": {
2251
+ "name": "model_provider_tenant_name",
2252
+ "nullsNotDistinct": false,
2253
+ "columns": ["tenant_id", "name"]
2254
+ }
2255
+ },
2256
+ "policies": {},
2257
+ "checkConstraints": {
2258
+ "model_provider_auth_xor": {
2259
+ "name": "model_provider_auth_xor",
2260
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2261
+ }
2262
+ },
2263
+ "isRLSEnabled": false
2264
+ },
2265
+ "public.sidecar": {
2266
+ "name": "sidecar",
2267
+ "schema": "",
2268
+ "columns": {
2269
+ "id": {
2270
+ "name": "id",
2271
+ "type": "text",
2272
+ "primaryKey": true,
2273
+ "notNull": true
2274
+ },
2275
+ "url": {
2276
+ "name": "url",
2277
+ "type": "text",
2278
+ "primaryKey": false,
2279
+ "notNull": false
2280
+ },
2281
+ "token_hash_sha256": {
2282
+ "name": "token_hash_sha256",
2283
+ "type": "bytea",
2284
+ "primaryKey": false,
2285
+ "notNull": true
2286
+ },
2287
+ "credential_scope": {
2288
+ "name": "credential_scope",
2289
+ "type": "text",
2290
+ "primaryKey": false,
2291
+ "notNull": true,
2292
+ "default": "'shared'"
2293
+ },
2294
+ "status": {
2295
+ "name": "status",
2296
+ "type": "text",
2297
+ "primaryKey": false,
2298
+ "notNull": true,
2299
+ "default": "'online'"
2300
+ },
2301
+ "last_heartbeat": {
2302
+ "name": "last_heartbeat",
2303
+ "type": "timestamp",
2304
+ "primaryKey": false,
2305
+ "notNull": false
2306
+ },
2307
+ "created_at": {
2308
+ "name": "created_at",
2309
+ "type": "timestamp",
2310
+ "primaryKey": false,
2311
+ "notNull": true,
2312
+ "default": "now()"
2313
+ },
2314
+ "updated_at": {
2315
+ "name": "updated_at",
2316
+ "type": "timestamp",
2317
+ "primaryKey": false,
2318
+ "notNull": true,
2319
+ "default": "now()"
2320
+ }
2321
+ },
2322
+ "indexes": {},
2323
+ "foreignKeys": {},
2324
+ "compositePrimaryKeys": {},
2325
+ "uniqueConstraints": {
2326
+ "sidecar_token_hash_sha256_unique": {
2327
+ "name": "sidecar_token_hash_sha256_unique",
2328
+ "nullsNotDistinct": false,
2329
+ "columns": ["token_hash_sha256"]
2330
+ }
2331
+ },
2332
+ "policies": {},
2333
+ "checkConstraints": {
2334
+ "sidecar_credential_scope_check": {
2335
+ "name": "sidecar_credential_scope_check",
2336
+ "value": "\"sidecar\".\"credential_scope\" in ('shared', 'allocated')"
2337
+ }
2338
+ },
2339
+ "isRLSEnabled": false
2340
+ },
2341
+ "public.sidecar_allocation": {
2342
+ "name": "sidecar_allocation",
2343
+ "schema": "",
2344
+ "columns": {
2345
+ "id": {
2346
+ "name": "id",
2347
+ "type": "text",
2348
+ "primaryKey": true,
2349
+ "notNull": true
2350
+ },
2351
+ "anchor_run_id": {
2352
+ "name": "anchor_run_id",
2353
+ "type": "text",
2354
+ "primaryKey": false,
2355
+ "notNull": true
2356
+ },
2357
+ "tenant_id": {
2358
+ "name": "tenant_id",
2359
+ "type": "text",
2360
+ "primaryKey": false,
2361
+ "notNull": true
2362
+ },
2363
+ "provisioner_id": {
2364
+ "name": "provisioner_id",
2365
+ "type": "text",
2366
+ "primaryKey": false,
2367
+ "notNull": true
2368
+ },
2369
+ "provisioner_api_version": {
2370
+ "name": "provisioner_api_version",
2371
+ "type": "integer",
2372
+ "primaryKey": false,
2373
+ "notNull": true
2374
+ },
2375
+ "provisioner_binding_fingerprint": {
2376
+ "name": "provisioner_binding_fingerprint",
2377
+ "type": "text",
2378
+ "primaryKey": false,
2379
+ "notNull": true
2380
+ },
2381
+ "sidecar_id": {
2382
+ "name": "sidecar_id",
2383
+ "type": "text",
2384
+ "primaryKey": false,
2385
+ "notNull": false
2386
+ },
2387
+ "placement_sharing": {
2388
+ "name": "placement_sharing",
2389
+ "type": "text",
2390
+ "primaryKey": false,
2391
+ "notNull": true
2392
+ },
2393
+ "sidecar_reuse": {
2394
+ "name": "sidecar_reuse",
2395
+ "type": "text",
2396
+ "primaryKey": false,
2397
+ "notNull": true,
2398
+ "default": "'never'"
2399
+ },
2400
+ "status": {
2401
+ "name": "status",
2402
+ "type": "text",
2403
+ "primaryKey": false,
2404
+ "notNull": true,
2405
+ "default": "'pending'"
2406
+ },
2407
+ "generation": {
2408
+ "name": "generation",
2409
+ "type": "integer",
2410
+ "primaryKey": false,
2411
+ "notNull": true,
2412
+ "default": 0
2413
+ },
2414
+ "ensure_accepted_generation": {
2415
+ "name": "ensure_accepted_generation",
2416
+ "type": "integer",
2417
+ "primaryKey": false,
2418
+ "notNull": false
2419
+ },
2420
+ "external_ref": {
2421
+ "name": "external_ref",
2422
+ "type": "text",
2423
+ "primaryKey": false,
2424
+ "notNull": false
2425
+ },
2426
+ "next_attempt_at": {
2427
+ "name": "next_attempt_at",
2428
+ "type": "timestamp",
2429
+ "primaryKey": false,
2430
+ "notNull": false
2431
+ },
2432
+ "reconciliation_lease_id": {
2433
+ "name": "reconciliation_lease_id",
2434
+ "type": "text",
2435
+ "primaryKey": false,
2436
+ "notNull": false
2437
+ },
2438
+ "reconciliation_lease_expires_at": {
2439
+ "name": "reconciliation_lease_expires_at",
2440
+ "type": "timestamp",
2441
+ "primaryKey": false,
2442
+ "notNull": false
2443
+ },
2444
+ "ensure_attempts": {
2445
+ "name": "ensure_attempts",
2446
+ "type": "integer",
2447
+ "primaryKey": false,
2448
+ "notNull": true,
2449
+ "default": 0
2450
+ },
2451
+ "destroy_attempts": {
2452
+ "name": "destroy_attempts",
2453
+ "type": "integer",
2454
+ "primaryKey": false,
2455
+ "notNull": true,
2456
+ "default": 0
2457
+ },
2458
+ "connect_deadline": {
2459
+ "name": "connect_deadline",
2460
+ "type": "timestamp",
2461
+ "primaryKey": false,
2462
+ "notNull": false
2463
+ },
2464
+ "failure_code": {
2465
+ "name": "failure_code",
2466
+ "type": "text",
2467
+ "primaryKey": false,
2468
+ "notNull": false
2469
+ },
2470
+ "failure_message": {
2471
+ "name": "failure_message",
2472
+ "type": "text",
2473
+ "primaryKey": false,
2474
+ "notNull": false
2475
+ },
2476
+ "created_at": {
2477
+ "name": "created_at",
2478
+ "type": "timestamp",
2479
+ "primaryKey": false,
2480
+ "notNull": true,
2481
+ "default": "now()"
2482
+ },
2483
+ "updated_at": {
2484
+ "name": "updated_at",
2485
+ "type": "timestamp",
2486
+ "primaryKey": false,
2487
+ "notNull": true,
2488
+ "default": "now()"
2489
+ }
2490
+ },
2491
+ "indexes": {
2492
+ "sidecar_allocation_anchor_run_idx": {
2493
+ "name": "sidecar_allocation_anchor_run_idx",
2494
+ "columns": [
2495
+ {
2496
+ "expression": "anchor_run_id",
2497
+ "isExpression": false,
2498
+ "asc": true,
2499
+ "nulls": "last"
2500
+ }
2501
+ ],
2502
+ "isUnique": true,
2503
+ "concurrently": false,
2504
+ "method": "btree",
2505
+ "with": {}
2506
+ },
2507
+ "sidecar_allocation_active_sidecar_idx": {
2508
+ "name": "sidecar_allocation_active_sidecar_idx",
2509
+ "columns": [
2510
+ {
2511
+ "expression": "sidecar_id",
2512
+ "isExpression": false,
2513
+ "asc": true,
2514
+ "nulls": "last"
2515
+ }
2516
+ ],
2517
+ "isUnique": true,
2518
+ "where": "\"sidecar_allocation\".\"status\" in ('provisioning', 'allocated', 'replacing', 'releasing')",
2519
+ "concurrently": false,
2520
+ "method": "btree",
2521
+ "with": {}
2522
+ },
2523
+ "sidecar_allocation_sidecar_idx": {
2524
+ "name": "sidecar_allocation_sidecar_idx",
2525
+ "columns": [
2526
+ {
2527
+ "expression": "sidecar_id",
2528
+ "isExpression": false,
2529
+ "asc": true,
2530
+ "nulls": "last"
2531
+ }
2532
+ ],
2533
+ "isUnique": false,
2534
+ "concurrently": false,
2535
+ "method": "btree",
2536
+ "with": {}
2537
+ },
2538
+ "sidecar_allocation_reconciliation_idx": {
2539
+ "name": "sidecar_allocation_reconciliation_idx",
2540
+ "columns": [
2541
+ {
2542
+ "expression": "next_attempt_at",
2543
+ "isExpression": false,
2544
+ "asc": true,
2545
+ "nulls": "last"
2546
+ },
2547
+ {
2548
+ "expression": "created_at",
2549
+ "isExpression": false,
2550
+ "asc": true,
2551
+ "nulls": "last"
2552
+ }
2553
+ ],
2554
+ "isUnique": false,
2555
+ "where": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing') and \"sidecar_allocation\".\"next_attempt_at\" is not null",
2556
+ "concurrently": false,
2557
+ "method": "btree",
2558
+ "with": {}
2559
+ }
2560
+ },
2561
+ "foreignKeys": {
2562
+ "sidecar_allocation_anchor_run_id_workflow_run_id_fk": {
2563
+ "name": "sidecar_allocation_anchor_run_id_workflow_run_id_fk",
2564
+ "tableFrom": "sidecar_allocation",
2565
+ "tableTo": "workflow_run",
2566
+ "columnsFrom": ["anchor_run_id"],
2567
+ "columnsTo": ["id"],
2568
+ "onDelete": "cascade",
2569
+ "onUpdate": "no action"
2570
+ },
2571
+ "sidecar_allocation_tenant_id_tenant_id_fk": {
2572
+ "name": "sidecar_allocation_tenant_id_tenant_id_fk",
2573
+ "tableFrom": "sidecar_allocation",
2574
+ "tableTo": "tenant",
2575
+ "columnsFrom": ["tenant_id"],
2576
+ "columnsTo": ["id"],
2577
+ "onDelete": "restrict",
2578
+ "onUpdate": "no action"
2579
+ },
2580
+ "sidecar_allocation_sidecar_id_sidecar_id_fk": {
2581
+ "name": "sidecar_allocation_sidecar_id_sidecar_id_fk",
2582
+ "tableFrom": "sidecar_allocation",
2583
+ "tableTo": "sidecar",
2584
+ "columnsFrom": ["sidecar_id"],
2585
+ "columnsTo": ["id"],
2586
+ "onDelete": "restrict",
2587
+ "onUpdate": "no action"
2588
+ }
2589
+ },
2590
+ "compositePrimaryKeys": {},
2591
+ "uniqueConstraints": {},
2592
+ "policies": {},
2593
+ "checkConstraints": {
2594
+ "sidecar_allocation_status_check": {
2595
+ "name": "sidecar_allocation_status_check",
2596
+ "value": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing', 'released', 'failed')"
2597
+ },
2598
+ "sidecar_allocation_placement_check": {
2599
+ "name": "sidecar_allocation_placement_check",
2600
+ "value": "\"sidecar_allocation\".\"placement_sharing\" = 'exclusive'"
2601
+ },
2602
+ "sidecar_allocation_generation_check": {
2603
+ "name": "sidecar_allocation_generation_check",
2604
+ "value": "\"sidecar_allocation\".\"generation\" >= 0"
2605
+ },
2606
+ "sidecar_allocation_accepted_generation_check": {
2607
+ "name": "sidecar_allocation_accepted_generation_check",
2608
+ "value": "\"sidecar_allocation\".\"ensure_accepted_generation\" is null or \"sidecar_allocation\".\"ensure_accepted_generation\" <= \"sidecar_allocation\".\"generation\""
2609
+ }
2610
+ },
2611
+ "isRLSEnabled": false
2612
+ },
2613
+ "public.agent_session": {
2614
+ "name": "agent_session",
2615
+ "schema": "",
2616
+ "columns": {
2617
+ "id": {
2618
+ "name": "id",
2619
+ "type": "text",
2620
+ "primaryKey": true,
2621
+ "notNull": true
2622
+ },
2623
+ "tenant_id": {
2624
+ "name": "tenant_id",
2625
+ "type": "text",
2626
+ "primaryKey": false,
2627
+ "notNull": true
2628
+ },
2629
+ "agent_id": {
2630
+ "name": "agent_id",
2631
+ "type": "text",
2632
+ "primaryKey": false,
2633
+ "notNull": true
2634
+ },
2635
+ "principal_id": {
2636
+ "name": "principal_id",
2637
+ "type": "text",
2638
+ "primaryKey": false,
2639
+ "notNull": true
2640
+ },
2641
+ "status": {
2642
+ "name": "status",
2643
+ "type": "text",
2644
+ "primaryKey": false,
2645
+ "notNull": true,
2646
+ "default": "'active'"
2647
+ },
2648
+ "created_at": {
2649
+ "name": "created_at",
2650
+ "type": "timestamp",
2651
+ "primaryKey": false,
2652
+ "notNull": true,
2653
+ "default": "now()"
2654
+ },
2655
+ "updated_at": {
2656
+ "name": "updated_at",
2657
+ "type": "timestamp",
2658
+ "primaryKey": false,
2659
+ "notNull": true,
2660
+ "default": "now()"
2661
+ },
2662
+ "ended_at": {
2663
+ "name": "ended_at",
2664
+ "type": "timestamp",
2665
+ "primaryKey": false,
2666
+ "notNull": false
2667
+ }
2668
+ },
2669
+ "indexes": {},
2670
+ "foreignKeys": {
2671
+ "agent_session_tenant_id_tenant_id_fk": {
2672
+ "name": "agent_session_tenant_id_tenant_id_fk",
2673
+ "tableFrom": "agent_session",
2674
+ "tableTo": "tenant",
2675
+ "columnsFrom": ["tenant_id"],
2676
+ "columnsTo": ["id"],
2677
+ "onDelete": "cascade",
2678
+ "onUpdate": "no action"
2679
+ },
2680
+ "agent_session_agent_id_workflow_definition_id_fk": {
2681
+ "name": "agent_session_agent_id_workflow_definition_id_fk",
2682
+ "tableFrom": "agent_session",
2683
+ "tableTo": "workflow_definition",
2684
+ "columnsFrom": ["agent_id"],
2685
+ "columnsTo": ["id"],
2686
+ "onDelete": "restrict",
2687
+ "onUpdate": "no action"
2688
+ },
2689
+ "agent_session_principal_id_principal_id_fk": {
2690
+ "name": "agent_session_principal_id_principal_id_fk",
2691
+ "tableFrom": "agent_session",
2692
+ "tableTo": "principal",
2693
+ "columnsFrom": ["principal_id"],
2694
+ "columnsTo": ["id"],
2695
+ "onDelete": "no action",
2696
+ "onUpdate": "no action"
2697
+ }
2698
+ },
2699
+ "compositePrimaryKeys": {},
2700
+ "uniqueConstraints": {},
2701
+ "policies": {},
2702
+ "checkConstraints": {},
2703
+ "isRLSEnabled": false
2704
+ },
2705
+ "public.session_asset": {
2706
+ "name": "session_asset",
2707
+ "schema": "",
2708
+ "columns": {
2709
+ "instance_id": {
2710
+ "name": "instance_id",
2711
+ "type": "text",
2712
+ "primaryKey": false,
2713
+ "notNull": true
2714
+ },
2715
+ "mount_path": {
2716
+ "name": "mount_path",
2717
+ "type": "text",
2718
+ "primaryKey": false,
2719
+ "notNull": true
2720
+ },
2721
+ "asset_pack_sha": {
2722
+ "name": "asset_pack_sha",
2723
+ "type": "text",
2724
+ "primaryKey": false,
2725
+ "notNull": true
2726
+ },
2727
+ "source_commit_sha": {
2728
+ "name": "source_commit_sha",
2729
+ "type": "text",
2730
+ "primaryKey": false,
2731
+ "notNull": true
2732
+ },
2733
+ "materialized_at": {
2734
+ "name": "materialized_at",
2735
+ "type": "timestamp",
2736
+ "primaryKey": false,
2737
+ "notNull": true,
2738
+ "default": "now()"
2739
+ }
2740
+ },
2741
+ "indexes": {
2742
+ "session_asset_pack_sha_idx": {
2743
+ "name": "session_asset_pack_sha_idx",
2744
+ "columns": [
2745
+ {
2746
+ "expression": "asset_pack_sha",
2747
+ "isExpression": false,
2748
+ "asc": true,
2749
+ "nulls": "last"
2750
+ }
2751
+ ],
2752
+ "isUnique": false,
2753
+ "concurrently": false,
2754
+ "method": "btree",
2755
+ "with": {}
2756
+ }
2757
+ },
2758
+ "foreignKeys": {},
2759
+ "compositePrimaryKeys": {
2760
+ "session_asset_instance_id_mount_path_pk": {
2761
+ "name": "session_asset_instance_id_mount_path_pk",
2762
+ "columns": ["instance_id", "mount_path"]
2763
+ }
2764
+ },
2765
+ "uniqueConstraints": {},
2766
+ "policies": {},
2767
+ "checkConstraints": {},
2768
+ "isRLSEnabled": false
2769
+ },
2770
+ "public.inference_turn": {
2771
+ "name": "inference_turn",
2772
+ "schema": "",
2773
+ "columns": {
2774
+ "id": {
2775
+ "name": "id",
2776
+ "type": "text",
2777
+ "primaryKey": true,
2778
+ "notNull": true
2779
+ },
2780
+ "session_id": {
2781
+ "name": "session_id",
2782
+ "type": "text",
2783
+ "primaryKey": false,
2784
+ "notNull": true
2785
+ },
2786
+ "instance_id": {
2787
+ "name": "instance_id",
2788
+ "type": "text",
2789
+ "primaryKey": false,
2790
+ "notNull": true
2791
+ },
2792
+ "tenant_id": {
2793
+ "name": "tenant_id",
2794
+ "type": "text",
2795
+ "primaryKey": false,
2796
+ "notNull": true
2797
+ },
2798
+ "model": {
2799
+ "name": "model",
2800
+ "type": "text",
2801
+ "primaryKey": false,
2802
+ "notNull": true
2803
+ },
2804
+ "status": {
2805
+ "name": "status",
2806
+ "type": "text",
2807
+ "primaryKey": false,
2808
+ "notNull": true,
2809
+ "default": "'running'"
2810
+ },
2811
+ "started_at": {
2812
+ "name": "started_at",
2813
+ "type": "timestamp",
2814
+ "primaryKey": false,
2815
+ "notNull": true
2816
+ },
2817
+ "ended_at": {
2818
+ "name": "ended_at",
2819
+ "type": "timestamp",
2820
+ "primaryKey": false,
2821
+ "notNull": false
2822
+ }
2823
+ },
2824
+ "indexes": {
2825
+ "inference_turn_instance_id_started_at_idx": {
2826
+ "name": "inference_turn_instance_id_started_at_idx",
2827
+ "columns": [
2828
+ {
2829
+ "expression": "instance_id",
2830
+ "isExpression": false,
2831
+ "asc": true,
2832
+ "nulls": "last"
2833
+ },
2834
+ {
2835
+ "expression": "started_at",
2836
+ "isExpression": false,
2837
+ "asc": true,
2838
+ "nulls": "last"
2839
+ }
2840
+ ],
2841
+ "isUnique": false,
2842
+ "concurrently": false,
2843
+ "method": "btree",
2844
+ "with": {}
2845
+ }
2846
+ },
2847
+ "foreignKeys": {
2848
+ "inference_turn_session_id_agent_session_id_fk": {
2849
+ "name": "inference_turn_session_id_agent_session_id_fk",
2850
+ "tableFrom": "inference_turn",
2851
+ "tableTo": "agent_session",
2852
+ "columnsFrom": ["session_id"],
2853
+ "columnsTo": ["id"],
2854
+ "onDelete": "cascade",
2855
+ "onUpdate": "no action"
2856
+ },
2857
+ "inference_turn_tenant_id_tenant_id_fk": {
2858
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2859
+ "tableFrom": "inference_turn",
2860
+ "tableTo": "tenant",
2861
+ "columnsFrom": ["tenant_id"],
2862
+ "columnsTo": ["id"],
2863
+ "onDelete": "cascade",
2864
+ "onUpdate": "no action"
2865
+ }
2866
+ },
2867
+ "compositePrimaryKeys": {},
2868
+ "uniqueConstraints": {},
2869
+ "policies": {},
2870
+ "checkConstraints": {},
2871
+ "isRLSEnabled": false
2872
+ },
2873
+ "public.session_mail": {
2874
+ "name": "session_mail",
2875
+ "schema": "",
2876
+ "columns": {
2877
+ "id": {
2878
+ "name": "id",
2879
+ "type": "text",
2880
+ "primaryKey": true,
2881
+ "notNull": true
2882
+ },
2883
+ "session_id": {
2884
+ "name": "session_id",
2885
+ "type": "text",
2886
+ "primaryKey": false,
2887
+ "notNull": true
2888
+ },
2889
+ "instance_id": {
2890
+ "name": "instance_id",
2891
+ "type": "text",
2892
+ "primaryKey": false,
2893
+ "notNull": false
2894
+ },
2895
+ "tenant_id": {
2896
+ "name": "tenant_id",
2897
+ "type": "text",
2898
+ "primaryKey": false,
2899
+ "notNull": true
2900
+ },
2901
+ "direction": {
2902
+ "name": "direction",
2903
+ "type": "text",
2904
+ "primaryKey": false,
2905
+ "notNull": true
2906
+ },
2907
+ "status": {
2908
+ "name": "status",
2909
+ "type": "text",
2910
+ "primaryKey": false,
2911
+ "notNull": true,
2912
+ "default": "'pending'"
2913
+ },
2914
+ "raw": {
2915
+ "name": "raw",
2916
+ "type": "bytea",
2917
+ "primaryKey": false,
2918
+ "notNull": true
2919
+ },
2920
+ "created_at": {
2921
+ "name": "created_at",
2922
+ "type": "timestamp",
2923
+ "primaryKey": false,
2924
+ "notNull": true,
2925
+ "default": "now()"
2926
+ }
2927
+ },
2928
+ "indexes": {
2929
+ "session_mail_instance_id_created_at_idx": {
2930
+ "name": "session_mail_instance_id_created_at_idx",
2931
+ "columns": [
2932
+ {
2933
+ "expression": "instance_id",
2934
+ "isExpression": false,
2935
+ "asc": true,
2936
+ "nulls": "last"
2937
+ },
2938
+ {
2939
+ "expression": "created_at",
2940
+ "isExpression": false,
2941
+ "asc": true,
2942
+ "nulls": "last"
2943
+ }
2944
+ ],
2945
+ "isUnique": false,
2946
+ "concurrently": false,
2947
+ "method": "btree",
2948
+ "with": {}
2949
+ },
2950
+ "session_mail_session_id_created_at_idx": {
2951
+ "name": "session_mail_session_id_created_at_idx",
2952
+ "columns": [
2953
+ {
2954
+ "expression": "session_id",
2955
+ "isExpression": false,
2956
+ "asc": true,
2957
+ "nulls": "last"
2958
+ },
2959
+ {
2960
+ "expression": "created_at",
2961
+ "isExpression": false,
2962
+ "asc": true,
2963
+ "nulls": "last"
2964
+ }
2965
+ ],
2966
+ "isUnique": false,
2967
+ "concurrently": false,
2968
+ "method": "btree",
2969
+ "with": {}
2970
+ }
2971
+ },
2972
+ "foreignKeys": {
2973
+ "session_mail_session_id_agent_session_id_fk": {
2974
+ "name": "session_mail_session_id_agent_session_id_fk",
2975
+ "tableFrom": "session_mail",
2976
+ "tableTo": "agent_session",
2977
+ "columnsFrom": ["session_id"],
2978
+ "columnsTo": ["id"],
2979
+ "onDelete": "cascade",
2980
+ "onUpdate": "no action"
2981
+ },
2982
+ "session_mail_tenant_id_tenant_id_fk": {
2983
+ "name": "session_mail_tenant_id_tenant_id_fk",
2984
+ "tableFrom": "session_mail",
2985
+ "tableTo": "tenant",
2986
+ "columnsFrom": ["tenant_id"],
2987
+ "columnsTo": ["id"],
2988
+ "onDelete": "cascade",
2989
+ "onUpdate": "no action"
2990
+ }
2991
+ },
2992
+ "compositePrimaryKeys": {},
2993
+ "uniqueConstraints": {},
2994
+ "policies": {},
2995
+ "checkConstraints": {},
2996
+ "isRLSEnabled": false
2997
+ },
2998
+ "public.turn_part": {
2999
+ "name": "turn_part",
3000
+ "schema": "",
3001
+ "columns": {
3002
+ "id": {
3003
+ "name": "id",
3004
+ "type": "text",
3005
+ "primaryKey": true,
3006
+ "notNull": true
3007
+ },
3008
+ "turn_id": {
3009
+ "name": "turn_id",
3010
+ "type": "text",
3011
+ "primaryKey": false,
3012
+ "notNull": true
3013
+ },
3014
+ "session_id": {
3015
+ "name": "session_id",
3016
+ "type": "text",
3017
+ "primaryKey": false,
3018
+ "notNull": true
3019
+ },
3020
+ "type": {
3021
+ "name": "type",
3022
+ "type": "text",
3023
+ "primaryKey": false,
3024
+ "notNull": true
3025
+ },
3026
+ "content": {
3027
+ "name": "content",
3028
+ "type": "text",
3029
+ "primaryKey": false,
3030
+ "notNull": false
3031
+ },
3032
+ "metadata": {
3033
+ "name": "metadata",
3034
+ "type": "jsonb",
3035
+ "primaryKey": false,
3036
+ "notNull": false
3037
+ },
3038
+ "ordinal": {
3039
+ "name": "ordinal",
3040
+ "type": "integer",
3041
+ "primaryKey": false,
3042
+ "notNull": true
3043
+ }
3044
+ },
3045
+ "indexes": {},
3046
+ "foreignKeys": {
3047
+ "turn_part_turn_id_inference_turn_id_fk": {
3048
+ "name": "turn_part_turn_id_inference_turn_id_fk",
3049
+ "tableFrom": "turn_part",
3050
+ "tableTo": "inference_turn",
3051
+ "columnsFrom": ["turn_id"],
3052
+ "columnsTo": ["id"],
3053
+ "onDelete": "cascade",
3054
+ "onUpdate": "no action"
3055
+ },
3056
+ "turn_part_session_id_agent_session_id_fk": {
3057
+ "name": "turn_part_session_id_agent_session_id_fk",
3058
+ "tableFrom": "turn_part",
3059
+ "tableTo": "agent_session",
3060
+ "columnsFrom": ["session_id"],
3061
+ "columnsTo": ["id"],
3062
+ "onDelete": "cascade",
3063
+ "onUpdate": "no action"
3064
+ }
3065
+ },
3066
+ "compositePrimaryKeys": {},
3067
+ "uniqueConstraints": {},
3068
+ "policies": {},
3069
+ "checkConstraints": {},
3070
+ "isRLSEnabled": false
3071
+ },
3072
+ "public.git_token": {
3073
+ "name": "git_token",
3074
+ "schema": "",
3075
+ "columns": {
3076
+ "id": {
3077
+ "name": "id",
3078
+ "type": "text",
3079
+ "primaryKey": true,
3080
+ "notNull": true
3081
+ },
3082
+ "tenant_id": {
3083
+ "name": "tenant_id",
3084
+ "type": "text",
3085
+ "primaryKey": false,
3086
+ "notNull": false
3087
+ },
3088
+ "user_id": {
3089
+ "name": "user_id",
3090
+ "type": "text",
3091
+ "primaryKey": false,
3092
+ "notNull": true
3093
+ },
3094
+ "principal_id": {
3095
+ "name": "principal_id",
3096
+ "type": "text",
3097
+ "primaryKey": false,
3098
+ "notNull": false
3099
+ },
3100
+ "name": {
3101
+ "name": "name",
3102
+ "type": "text",
3103
+ "primaryKey": false,
3104
+ "notNull": true
3105
+ },
3106
+ "kind": {
3107
+ "name": "kind",
3108
+ "type": "text",
3109
+ "primaryKey": false,
3110
+ "notNull": true
3111
+ },
3112
+ "token_hash_sha256": {
3113
+ "name": "token_hash_sha256",
3114
+ "type": "bytea",
3115
+ "primaryKey": false,
3116
+ "notNull": true
3117
+ },
3118
+ "resource": {
3119
+ "name": "resource",
3120
+ "type": "text",
3121
+ "primaryKey": false,
3122
+ "notNull": true
3123
+ },
3124
+ "ref_pattern": {
3125
+ "name": "ref_pattern",
3126
+ "type": "text",
3127
+ "primaryKey": false,
3128
+ "notNull": true
3129
+ },
3130
+ "actions": {
3131
+ "name": "actions",
3132
+ "type": "text[]",
3133
+ "primaryKey": false,
3134
+ "notNull": true
3135
+ },
3136
+ "expires_at": {
3137
+ "name": "expires_at",
3138
+ "type": "timestamp with time zone",
3139
+ "primaryKey": false,
3140
+ "notNull": true
3141
+ },
3142
+ "revoked_at": {
3143
+ "name": "revoked_at",
3144
+ "type": "timestamp with time zone",
3145
+ "primaryKey": false,
3146
+ "notNull": false
3147
+ },
3148
+ "created_at": {
3149
+ "name": "created_at",
3150
+ "type": "timestamp with time zone",
3151
+ "primaryKey": false,
3152
+ "notNull": true,
3153
+ "default": "now()"
3154
+ }
3155
+ },
3156
+ "indexes": {
3157
+ "git_token_user_id_name_active_idx": {
3158
+ "name": "git_token_user_id_name_active_idx",
3159
+ "columns": [
3160
+ {
3161
+ "expression": "user_id",
3162
+ "isExpression": false,
3163
+ "asc": true,
3164
+ "nulls": "last"
3165
+ },
3166
+ {
3167
+ "expression": "name",
3168
+ "isExpression": false,
3169
+ "asc": true,
3170
+ "nulls": "last"
3171
+ }
3172
+ ],
3173
+ "isUnique": true,
3174
+ "where": "\"git_token\".\"revoked_at\" is null",
3175
+ "concurrently": false,
3176
+ "method": "btree",
3177
+ "with": {}
3178
+ }
3179
+ },
3180
+ "foreignKeys": {
3181
+ "git_token_tenant_id_tenant_id_fk": {
3182
+ "name": "git_token_tenant_id_tenant_id_fk",
3183
+ "tableFrom": "git_token",
3184
+ "tableTo": "tenant",
3185
+ "columnsFrom": ["tenant_id"],
3186
+ "columnsTo": ["id"],
3187
+ "onDelete": "no action",
3188
+ "onUpdate": "no action"
3189
+ },
3190
+ "git_token_user_id_user_id_fk": {
3191
+ "name": "git_token_user_id_user_id_fk",
3192
+ "tableFrom": "git_token",
3193
+ "tableTo": "user",
3194
+ "columnsFrom": ["user_id"],
3195
+ "columnsTo": ["id"],
3196
+ "onDelete": "cascade",
3197
+ "onUpdate": "no action"
3198
+ },
3199
+ "git_token_principal_id_principal_id_fk": {
3200
+ "name": "git_token_principal_id_principal_id_fk",
3201
+ "tableFrom": "git_token",
3202
+ "tableTo": "principal",
3203
+ "columnsFrom": ["principal_id"],
3204
+ "columnsTo": ["id"],
3205
+ "onDelete": "cascade",
3206
+ "onUpdate": "no action"
3207
+ }
3208
+ },
3209
+ "compositePrimaryKeys": {},
3210
+ "uniqueConstraints": {
3211
+ "git_token_token_hash_sha256_unique": {
3212
+ "name": "git_token_token_hash_sha256_unique",
3213
+ "nullsNotDistinct": false,
3214
+ "columns": ["token_hash_sha256"]
3215
+ }
3216
+ },
3217
+ "policies": {},
3218
+ "checkConstraints": {},
3219
+ "isRLSEnabled": false
3220
+ },
3221
+ "public.workflow_definition": {
3222
+ "name": "workflow_definition",
3223
+ "schema": "",
3224
+ "columns": {
3225
+ "id": {
3226
+ "name": "id",
3227
+ "type": "text",
3228
+ "primaryKey": true,
3229
+ "notNull": true
3230
+ },
3231
+ "tenant_id": {
3232
+ "name": "tenant_id",
3233
+ "type": "text",
3234
+ "primaryKey": false,
3235
+ "notNull": true
3236
+ },
3237
+ "creator_principal_id": {
3238
+ "name": "creator_principal_id",
3239
+ "type": "text",
3240
+ "primaryKey": false,
3241
+ "notNull": false
3242
+ },
3243
+ "asset_id": {
3244
+ "name": "asset_id",
3245
+ "type": "text",
3246
+ "primaryKey": false,
3247
+ "notNull": false
3248
+ },
3249
+ "wire_hash": {
3250
+ "name": "wire_hash",
3251
+ "type": "text",
3252
+ "primaryKey": false,
3253
+ "notNull": false
3254
+ },
3255
+ "name": {
3256
+ "name": "name",
3257
+ "type": "text",
3258
+ "primaryKey": false,
3259
+ "notNull": true
3260
+ },
3261
+ "description": {
3262
+ "name": "description",
3263
+ "type": "text",
3264
+ "primaryKey": false,
3265
+ "notNull": false
3266
+ },
3267
+ "grant_requirements": {
3268
+ "name": "grant_requirements",
3269
+ "type": "jsonb",
3270
+ "primaryKey": false,
3271
+ "notNull": false
3272
+ },
3273
+ "model_requirements": {
3274
+ "name": "model_requirements",
3275
+ "type": "jsonb",
3276
+ "primaryKey": false,
3277
+ "notNull": false
3278
+ },
3279
+ "credential_bindings": {
3280
+ "name": "credential_bindings",
3281
+ "type": "jsonb",
3282
+ "primaryKey": false,
3283
+ "notNull": false
3284
+ },
3285
+ "current_version": {
3286
+ "name": "current_version",
3287
+ "type": "text",
3288
+ "primaryKey": false,
3289
+ "notNull": true,
3290
+ "default": "'1'"
3291
+ },
3292
+ "status": {
3293
+ "name": "status",
3294
+ "type": "text",
3295
+ "primaryKey": false,
3296
+ "notNull": true,
3297
+ "default": "'deployed'"
3298
+ },
3299
+ "created_at": {
3300
+ "name": "created_at",
3301
+ "type": "timestamp",
3302
+ "primaryKey": false,
3303
+ "notNull": true,
3304
+ "default": "now()"
3305
+ },
3306
+ "updated_at": {
3307
+ "name": "updated_at",
3308
+ "type": "timestamp",
3309
+ "primaryKey": false,
3310
+ "notNull": true,
3311
+ "default": "now()"
3312
+ }
3313
+ },
3314
+ "indexes": {
3315
+ "workflow_definition_tenant_idx": {
3316
+ "name": "workflow_definition_tenant_idx",
3317
+ "columns": [
3318
+ {
3319
+ "expression": "tenant_id",
3320
+ "isExpression": false,
3321
+ "asc": true,
3322
+ "nulls": "last"
3323
+ },
3324
+ {
3325
+ "expression": "created_at",
3326
+ "isExpression": false,
3327
+ "asc": true,
3328
+ "nulls": "last"
3329
+ }
3330
+ ],
3331
+ "isUnique": false,
3332
+ "concurrently": false,
3333
+ "method": "btree",
3334
+ "with": {}
3335
+ },
3336
+ "workflow_definition_asset_wire_hash_idx": {
3337
+ "name": "workflow_definition_asset_wire_hash_idx",
3338
+ "columns": [
3339
+ {
3340
+ "expression": "asset_id",
3341
+ "isExpression": false,
3342
+ "asc": true,
3343
+ "nulls": "last"
3344
+ },
3345
+ {
3346
+ "expression": "wire_hash",
3347
+ "isExpression": false,
3348
+ "asc": true,
3349
+ "nulls": "last"
3350
+ }
3351
+ ],
3352
+ "isUnique": true,
3353
+ "concurrently": false,
3354
+ "method": "btree",
3355
+ "with": {}
3356
+ }
3357
+ },
3358
+ "foreignKeys": {
3359
+ "workflow_definition_tenant_id_tenant_id_fk": {
3360
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3361
+ "tableFrom": "workflow_definition",
3362
+ "tableTo": "tenant",
3363
+ "columnsFrom": ["tenant_id"],
3364
+ "columnsTo": ["id"],
3365
+ "onDelete": "cascade",
3366
+ "onUpdate": "no action"
3367
+ },
3368
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3369
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3370
+ "tableFrom": "workflow_definition",
3371
+ "tableTo": "principal",
3372
+ "columnsFrom": ["creator_principal_id"],
3373
+ "columnsTo": ["id"],
3374
+ "onDelete": "no action",
3375
+ "onUpdate": "no action"
3376
+ },
3377
+ "workflow_definition_asset_id_asset_id_fk": {
3378
+ "name": "workflow_definition_asset_id_asset_id_fk",
3379
+ "tableFrom": "workflow_definition",
3380
+ "tableTo": "asset",
3381
+ "columnsFrom": ["asset_id"],
3382
+ "columnsTo": ["id"],
3383
+ "onDelete": "restrict",
3384
+ "onUpdate": "no action"
3385
+ }
3386
+ },
3387
+ "compositePrimaryKeys": {},
3388
+ "uniqueConstraints": {},
3389
+ "policies": {},
3390
+ "checkConstraints": {},
3391
+ "isRLSEnabled": false
3392
+ },
3393
+ "public.workflow_definition_version": {
3394
+ "name": "workflow_definition_version",
3395
+ "schema": "",
3396
+ "columns": {
3397
+ "id": {
3398
+ "name": "id",
3399
+ "type": "text",
3400
+ "primaryKey": true,
3401
+ "notNull": true
3402
+ },
3403
+ "definition_id": {
3404
+ "name": "definition_id",
3405
+ "type": "text",
3406
+ "primaryKey": false,
3407
+ "notNull": true
3408
+ },
3409
+ "version": {
3410
+ "name": "version",
3411
+ "type": "text",
3412
+ "primaryKey": false,
3413
+ "notNull": true
3414
+ },
3415
+ "status": {
3416
+ "name": "status",
3417
+ "type": "text",
3418
+ "primaryKey": false,
3419
+ "notNull": true,
3420
+ "default": "'active'"
3421
+ },
3422
+ "approved_wire_hash": {
3423
+ "name": "approved_wire_hash",
3424
+ "type": "text",
3425
+ "primaryKey": false,
3426
+ "notNull": false
3427
+ },
3428
+ "grant_snapshot": {
3429
+ "name": "grant_snapshot",
3430
+ "type": "jsonb",
3431
+ "primaryKey": false,
3432
+ "notNull": false
3433
+ },
3434
+ "created_at": {
3435
+ "name": "created_at",
3436
+ "type": "timestamp",
3437
+ "primaryKey": false,
3438
+ "notNull": true,
3439
+ "default": "now()"
3440
+ }
3441
+ },
3442
+ "indexes": {
3443
+ "workflow_definition_version_definition_idx": {
3444
+ "name": "workflow_definition_version_definition_idx",
3445
+ "columns": [
3446
+ {
3447
+ "expression": "definition_id",
3448
+ "isExpression": false,
3449
+ "asc": true,
3450
+ "nulls": "last"
3451
+ }
3452
+ ],
3453
+ "isUnique": false,
3454
+ "concurrently": false,
3455
+ "method": "btree",
3456
+ "with": {}
3457
+ }
3458
+ },
3459
+ "foreignKeys": {
3460
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3461
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3462
+ "tableFrom": "workflow_definition_version",
3463
+ "tableTo": "workflow_definition",
3464
+ "columnsFrom": ["definition_id"],
3465
+ "columnsTo": ["id"],
3466
+ "onDelete": "cascade",
3467
+ "onUpdate": "no action"
3468
+ }
3469
+ },
3470
+ "compositePrimaryKeys": {},
3471
+ "uniqueConstraints": {
3472
+ "workflow_definition_version_definition_version": {
3473
+ "name": "workflow_definition_version_definition_version",
3474
+ "nullsNotDistinct": false,
3475
+ "columns": ["definition_id", "version"]
3476
+ }
3477
+ },
3478
+ "policies": {},
3479
+ "checkConstraints": {},
3480
+ "isRLSEnabled": false
3481
+ },
3482
+ "public.workflow_run": {
3483
+ "name": "workflow_run",
3484
+ "schema": "",
3485
+ "columns": {
3486
+ "id": {
3487
+ "name": "id",
3488
+ "type": "text",
3489
+ "primaryKey": true,
3490
+ "notNull": true
3491
+ },
3492
+ "definition_id": {
3493
+ "name": "definition_id",
3494
+ "type": "text",
3495
+ "primaryKey": false,
3496
+ "notNull": true
3497
+ },
3498
+ "anchor_run_id": {
3499
+ "name": "anchor_run_id",
3500
+ "type": "text",
3501
+ "primaryKey": false,
3502
+ "notNull": false
3503
+ },
3504
+ "tenant_id": {
3505
+ "name": "tenant_id",
3506
+ "type": "text",
3507
+ "primaryKey": false,
3508
+ "notNull": true
3509
+ },
3510
+ "principal_id": {
3511
+ "name": "principal_id",
3512
+ "type": "text",
3513
+ "primaryKey": false,
3514
+ "notNull": false
3515
+ },
3516
+ "status": {
3517
+ "name": "status",
3518
+ "type": "text",
3519
+ "primaryKey": false,
3520
+ "notNull": true,
3521
+ "default": "'running'"
3522
+ },
3523
+ "address": {
3524
+ "name": "address",
3525
+ "type": "text",
3526
+ "primaryKey": false,
3527
+ "notNull": false
3528
+ },
3529
+ "public_key": {
3530
+ "name": "public_key",
3531
+ "type": "text",
3532
+ "primaryKey": false,
3533
+ "notNull": false
3534
+ },
3535
+ "sidecar_id": {
3536
+ "name": "sidecar_id",
3537
+ "type": "text",
3538
+ "primaryKey": false,
3539
+ "notNull": false
3540
+ },
3541
+ "kernel_id": {
3542
+ "name": "kernel_id",
3543
+ "type": "text",
3544
+ "primaryKey": false,
3545
+ "notNull": false
3546
+ },
3547
+ "model_preferences": {
3548
+ "name": "model_preferences",
3549
+ "type": "jsonb",
3550
+ "primaryKey": false,
3551
+ "notNull": false
3552
+ },
3553
+ "created_at": {
3554
+ "name": "created_at",
3555
+ "type": "timestamp",
3556
+ "primaryKey": false,
3557
+ "notNull": true,
3558
+ "default": "now()"
3559
+ },
3560
+ "ended_at": {
3561
+ "name": "ended_at",
3562
+ "type": "timestamp",
3563
+ "primaryKey": false,
3564
+ "notNull": false
3565
+ }
3566
+ },
3567
+ "indexes": {
3568
+ "workflow_run_definition_idx": {
3569
+ "name": "workflow_run_definition_idx",
3570
+ "columns": [
3571
+ {
3572
+ "expression": "definition_id",
3573
+ "isExpression": false,
3574
+ "asc": true,
3575
+ "nulls": "last"
3576
+ }
3577
+ ],
3578
+ "isUnique": false,
3579
+ "concurrently": false,
3580
+ "method": "btree",
3581
+ "with": {}
3582
+ },
3583
+ "workflow_run_address_idx": {
3584
+ "name": "workflow_run_address_idx",
3585
+ "columns": [
3586
+ {
3587
+ "expression": "address",
3588
+ "isExpression": false,
3589
+ "asc": true,
3590
+ "nulls": "last"
3591
+ }
3592
+ ],
3593
+ "isUnique": true,
3594
+ "where": "\"workflow_run\".\"address\" is not null",
3595
+ "concurrently": false,
3596
+ "method": "btree",
3597
+ "with": {}
3598
+ }
3599
+ },
3600
+ "foreignKeys": {
3601
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3602
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3603
+ "tableFrom": "workflow_run",
3604
+ "tableTo": "workflow_definition",
3605
+ "columnsFrom": ["definition_id"],
3606
+ "columnsTo": ["id"],
3607
+ "onDelete": "cascade",
3608
+ "onUpdate": "no action"
3609
+ },
3610
+ "workflow_run_anchor_run_id_workflow_run_id_fk": {
3611
+ "name": "workflow_run_anchor_run_id_workflow_run_id_fk",
3612
+ "tableFrom": "workflow_run",
3613
+ "tableTo": "workflow_run",
3614
+ "columnsFrom": ["anchor_run_id"],
3615
+ "columnsTo": ["id"],
3616
+ "onDelete": "cascade",
3617
+ "onUpdate": "no action"
3618
+ },
3619
+ "workflow_run_tenant_id_tenant_id_fk": {
3620
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3621
+ "tableFrom": "workflow_run",
3622
+ "tableTo": "tenant",
3623
+ "columnsFrom": ["tenant_id"],
3624
+ "columnsTo": ["id"],
3625
+ "onDelete": "cascade",
3626
+ "onUpdate": "no action"
3627
+ },
3628
+ "workflow_run_principal_id_principal_id_fk": {
3629
+ "name": "workflow_run_principal_id_principal_id_fk",
3630
+ "tableFrom": "workflow_run",
3631
+ "tableTo": "principal",
3632
+ "columnsFrom": ["principal_id"],
3633
+ "columnsTo": ["id"],
3634
+ "onDelete": "set null",
3635
+ "onUpdate": "no action"
3636
+ },
3637
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3638
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3639
+ "tableFrom": "workflow_run",
3640
+ "tableTo": "sidecar",
3641
+ "columnsFrom": ["sidecar_id"],
3642
+ "columnsTo": ["id"],
3643
+ "onDelete": "set null",
3644
+ "onUpdate": "no action"
3645
+ }
3646
+ },
3647
+ "compositePrimaryKeys": {},
3648
+ "uniqueConstraints": {},
3649
+ "policies": {},
3650
+ "checkConstraints": {},
3651
+ "isRLSEnabled": false
3652
+ },
3653
+ "public.workflow_run_dispatch": {
3654
+ "name": "workflow_run_dispatch",
3655
+ "schema": "",
3656
+ "columns": {
3657
+ "id": {
3658
+ "name": "id",
3659
+ "type": "text",
3660
+ "primaryKey": true,
3661
+ "notNull": true
3662
+ },
3663
+ "anchor_run_id": {
3664
+ "name": "anchor_run_id",
3665
+ "type": "text",
3666
+ "primaryKey": false,
3667
+ "notNull": true
3668
+ },
3669
+ "message_id": {
3670
+ "name": "message_id",
3671
+ "type": "text",
3672
+ "primaryKey": false,
3673
+ "notNull": true
3674
+ },
3675
+ "kind": {
3676
+ "name": "kind",
3677
+ "type": "text",
3678
+ "primaryKey": false,
3679
+ "notNull": true,
3680
+ "default": "'mail'"
3681
+ },
3682
+ "raw_message": {
3683
+ "name": "raw_message",
3684
+ "type": "bytea",
3685
+ "primaryKey": false,
3686
+ "notNull": true
3687
+ },
3688
+ "step_grants": {
3689
+ "name": "step_grants",
3690
+ "type": "jsonb",
3691
+ "primaryKey": false,
3692
+ "notNull": true
3693
+ },
3694
+ "status": {
3695
+ "name": "status",
3696
+ "type": "text",
3697
+ "primaryKey": false,
3698
+ "notNull": true,
3699
+ "default": "'pending'"
3700
+ },
3701
+ "acknowledged_generation": {
3702
+ "name": "acknowledged_generation",
3703
+ "type": "integer",
3704
+ "primaryKey": false,
3705
+ "notNull": false
3706
+ },
3707
+ "attempt_count": {
3708
+ "name": "attempt_count",
3709
+ "type": "integer",
3710
+ "primaryKey": false,
3711
+ "notNull": true,
3712
+ "default": 0
3713
+ },
3714
+ "next_attempt_at": {
3715
+ "name": "next_attempt_at",
3716
+ "type": "timestamp",
3717
+ "primaryKey": false,
3718
+ "notNull": false,
3719
+ "default": "now()"
3720
+ },
3721
+ "delivery_lease_id": {
3722
+ "name": "delivery_lease_id",
3723
+ "type": "text",
3724
+ "primaryKey": false,
3725
+ "notNull": false
3726
+ },
3727
+ "delivery_lease_expires_at": {
3728
+ "name": "delivery_lease_expires_at",
3729
+ "type": "timestamp",
3730
+ "primaryKey": false,
3731
+ "notNull": false
3732
+ },
3733
+ "failure_code": {
3734
+ "name": "failure_code",
3735
+ "type": "text",
3736
+ "primaryKey": false,
3737
+ "notNull": false
3738
+ },
3739
+ "failure_message": {
3740
+ "name": "failure_message",
3741
+ "type": "text",
3742
+ "primaryKey": false,
3743
+ "notNull": false
3744
+ },
3745
+ "created_at": {
3746
+ "name": "created_at",
3747
+ "type": "timestamp",
3748
+ "primaryKey": false,
3749
+ "notNull": true,
3750
+ "default": "now()"
3751
+ },
3752
+ "updated_at": {
3753
+ "name": "updated_at",
3754
+ "type": "timestamp",
3755
+ "primaryKey": false,
3756
+ "notNull": true,
3757
+ "default": "now()"
3758
+ },
3759
+ "acknowledged_at": {
3760
+ "name": "acknowledged_at",
3761
+ "type": "timestamp",
3762
+ "primaryKey": false,
3763
+ "notNull": false
3764
+ },
3765
+ "settled_at": {
3766
+ "name": "settled_at",
3767
+ "type": "timestamp",
3768
+ "primaryKey": false,
3769
+ "notNull": false
3770
+ }
3771
+ },
3772
+ "indexes": {
3773
+ "workflow_run_dispatch_anchor_message_idx": {
3774
+ "name": "workflow_run_dispatch_anchor_message_idx",
3775
+ "columns": [
3776
+ {
3777
+ "expression": "anchor_run_id",
3778
+ "isExpression": false,
3779
+ "asc": true,
3780
+ "nulls": "last"
3781
+ },
3782
+ {
3783
+ "expression": "message_id",
3784
+ "isExpression": false,
3785
+ "asc": true,
3786
+ "nulls": "last"
3787
+ }
3788
+ ],
3789
+ "isUnique": true,
3790
+ "concurrently": false,
3791
+ "method": "btree",
3792
+ "with": {}
3793
+ },
3794
+ "workflow_run_dispatch_delivery_idx": {
3795
+ "name": "workflow_run_dispatch_delivery_idx",
3796
+ "columns": [
3797
+ {
3798
+ "expression": "next_attempt_at",
3799
+ "isExpression": false,
3800
+ "asc": true,
3801
+ "nulls": "last"
3802
+ },
3803
+ {
3804
+ "expression": "created_at",
3805
+ "isExpression": false,
3806
+ "asc": true,
3807
+ "nulls": "last"
3808
+ }
3809
+ ],
3810
+ "isUnique": false,
3811
+ "where": "\"workflow_run_dispatch\".\"status\" = 'pending'",
3812
+ "concurrently": false,
3813
+ "method": "btree",
3814
+ "with": {}
3815
+ },
3816
+ "workflow_run_dispatch_anchor_status_idx": {
3817
+ "name": "workflow_run_dispatch_anchor_status_idx",
3818
+ "columns": [
3819
+ {
3820
+ "expression": "anchor_run_id",
3821
+ "isExpression": false,
3822
+ "asc": true,
3823
+ "nulls": "last"
3824
+ },
3825
+ {
3826
+ "expression": "status",
3827
+ "isExpression": false,
3828
+ "asc": true,
3829
+ "nulls": "last"
3830
+ }
3831
+ ],
3832
+ "isUnique": false,
3833
+ "concurrently": false,
3834
+ "method": "btree",
3835
+ "with": {}
3836
+ }
3837
+ },
3838
+ "foreignKeys": {
3839
+ "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk": {
3840
+ "name": "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk",
3841
+ "tableFrom": "workflow_run_dispatch",
3842
+ "tableTo": "workflow_run",
3843
+ "columnsFrom": ["anchor_run_id"],
3844
+ "columnsTo": ["id"],
3845
+ "onDelete": "cascade",
3846
+ "onUpdate": "no action"
3847
+ }
3848
+ },
3849
+ "compositePrimaryKeys": {},
3850
+ "uniqueConstraints": {},
3851
+ "policies": {},
3852
+ "checkConstraints": {
3853
+ "workflow_run_dispatch_status_check": {
3854
+ "name": "workflow_run_dispatch_status_check",
3855
+ "value": "\"workflow_run_dispatch\".\"status\" in ('pending', 'acknowledged', 'settled', 'failed')"
3856
+ },
3857
+ "workflow_run_dispatch_kind_check": {
3858
+ "name": "workflow_run_dispatch_kind_check",
3859
+ "value": "\"workflow_run_dispatch\".\"kind\" in ('mail', 'signal')"
3860
+ },
3861
+ "workflow_run_dispatch_attempt_count_check": {
3862
+ "name": "workflow_run_dispatch_attempt_count_check",
3863
+ "value": "\"workflow_run_dispatch\".\"attempt_count\" >= 0"
3864
+ },
3865
+ "workflow_run_dispatch_acknowledged_generation_check": {
3866
+ "name": "workflow_run_dispatch_acknowledged_generation_check",
3867
+ "value": "\"workflow_run_dispatch\".\"acknowledged_generation\" is null or \"workflow_run_dispatch\".\"acknowledged_generation\" >= 0"
3868
+ },
3869
+ "workflow_run_dispatch_acknowledged_state_check": {
3870
+ "name": "workflow_run_dispatch_acknowledged_state_check",
3871
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'acknowledged' or \"workflow_run_dispatch\".\"acknowledged_generation\" is not null"
3872
+ },
3873
+ "workflow_run_dispatch_pending_schedule_check": {
3874
+ "name": "workflow_run_dispatch_pending_schedule_check",
3875
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'pending' or \"workflow_run_dispatch\".\"next_attempt_at\" is not null"
3876
+ }
3877
+ },
3878
+ "isRLSEnabled": false
3879
+ },
3880
+ "public.workflow_run_launch_spec": {
3881
+ "name": "workflow_run_launch_spec",
3882
+ "schema": "",
3883
+ "columns": {
3884
+ "anchor_run_id": {
3885
+ "name": "anchor_run_id",
3886
+ "type": "text",
3887
+ "primaryKey": true,
3888
+ "notNull": true
3889
+ },
3890
+ "schema_version": {
3891
+ "name": "schema_version",
3892
+ "type": "integer",
3893
+ "primaryKey": false,
3894
+ "notNull": true,
3895
+ "default": 1
3896
+ },
3897
+ "session_id": {
3898
+ "name": "session_id",
3899
+ "type": "text",
3900
+ "primaryKey": false,
3901
+ "notNull": true
3902
+ },
3903
+ "deployment_domain": {
3904
+ "name": "deployment_domain",
3905
+ "type": "text",
3906
+ "primaryKey": false,
3907
+ "notNull": true
3908
+ },
3909
+ "source_authority_principal_id": {
3910
+ "name": "source_authority_principal_id",
3911
+ "type": "text",
3912
+ "primaryKey": false,
3913
+ "notNull": true
3914
+ },
3915
+ "frozen_approval_bundle": {
3916
+ "name": "frozen_approval_bundle",
3917
+ "type": "jsonb",
3918
+ "primaryKey": false,
3919
+ "notNull": true
3920
+ },
3921
+ "source_offering_ids": {
3922
+ "name": "source_offering_ids",
3923
+ "type": "jsonb",
3924
+ "primaryKey": false,
3925
+ "notNull": true
3926
+ },
3927
+ "default_source_offering_id": {
3928
+ "name": "default_source_offering_id",
3929
+ "type": "text",
3930
+ "primaryKey": false,
3931
+ "notNull": true
3932
+ },
3933
+ "deploy_content": {
3934
+ "name": "deploy_content",
3935
+ "type": "jsonb",
3936
+ "primaryKey": false,
3937
+ "notNull": true
3938
+ },
3939
+ "tool_package_pins": {
3940
+ "name": "tool_package_pins",
3941
+ "type": "jsonb",
3942
+ "primaryKey": false,
3943
+ "notNull": false
3944
+ },
3945
+ "created_at": {
3946
+ "name": "created_at",
3947
+ "type": "timestamp",
3948
+ "primaryKey": false,
3949
+ "notNull": true,
3950
+ "default": "now()"
3951
+ }
3952
+ },
3953
+ "indexes": {},
3954
+ "foreignKeys": {
3955
+ "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk": {
3956
+ "name": "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk",
3957
+ "tableFrom": "workflow_run_launch_spec",
3958
+ "tableTo": "workflow_run",
3959
+ "columnsFrom": ["anchor_run_id"],
3960
+ "columnsTo": ["id"],
3961
+ "onDelete": "cascade",
3962
+ "onUpdate": "no action"
3963
+ },
3964
+ "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk": {
3965
+ "name": "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk",
3966
+ "tableFrom": "workflow_run_launch_spec",
3967
+ "tableTo": "principal",
3968
+ "columnsFrom": ["source_authority_principal_id"],
3969
+ "columnsTo": ["id"],
3970
+ "onDelete": "restrict",
3971
+ "onUpdate": "no action"
3972
+ }
3973
+ },
3974
+ "compositePrimaryKeys": {},
3975
+ "uniqueConstraints": {},
3976
+ "policies": {},
3977
+ "checkConstraints": {},
3978
+ "isRLSEnabled": false
3979
+ },
3980
+ "public.workflow_run_execution": {
3981
+ "name": "workflow_run_execution",
3982
+ "schema": "",
3983
+ "columns": {
3984
+ "id": {
3985
+ "name": "id",
3986
+ "type": "text",
3987
+ "primaryKey": true,
3988
+ "notNull": true
3989
+ },
3990
+ "run_id": {
3991
+ "name": "run_id",
3992
+ "type": "text",
3993
+ "primaryKey": false,
3994
+ "notNull": true
3995
+ },
3996
+ "message_id": {
3997
+ "name": "message_id",
3998
+ "type": "text",
3999
+ "primaryKey": false,
4000
+ "notNull": true
4001
+ },
4002
+ "status": {
4003
+ "name": "status",
4004
+ "type": "text",
4005
+ "primaryKey": false,
4006
+ "notNull": true,
4007
+ "default": "'running'"
4008
+ },
4009
+ "started_at": {
4010
+ "name": "started_at",
4011
+ "type": "timestamp",
4012
+ "primaryKey": false,
4013
+ "notNull": true,
4014
+ "default": "now()"
4015
+ },
4016
+ "ended_at": {
4017
+ "name": "ended_at",
4018
+ "type": "timestamp",
4019
+ "primaryKey": false,
4020
+ "notNull": false
4021
+ },
4022
+ "failure_reason": {
4023
+ "name": "failure_reason",
4024
+ "type": "text",
4025
+ "primaryKey": false,
4026
+ "notNull": false
4027
+ }
4028
+ },
4029
+ "indexes": {
4030
+ "workflow_run_execution_run_id_id_idx": {
4031
+ "name": "workflow_run_execution_run_id_id_idx",
4032
+ "columns": [
4033
+ {
4034
+ "expression": "run_id",
4035
+ "isExpression": false,
4036
+ "asc": true,
4037
+ "nulls": "last"
4038
+ },
4039
+ {
4040
+ "expression": "id",
4041
+ "isExpression": false,
4042
+ "asc": true,
4043
+ "nulls": "last"
4044
+ }
4045
+ ],
4046
+ "isUnique": true,
4047
+ "concurrently": false,
4048
+ "method": "btree",
4049
+ "with": {}
4050
+ },
4051
+ "workflow_run_execution_status_idx": {
4052
+ "name": "workflow_run_execution_status_idx",
4053
+ "columns": [
4054
+ {
4055
+ "expression": "status",
4056
+ "isExpression": false,
4057
+ "asc": true,
4058
+ "nulls": "last"
4059
+ }
4060
+ ],
4061
+ "isUnique": false,
4062
+ "concurrently": false,
4063
+ "method": "btree",
4064
+ "with": {}
4065
+ }
4066
+ },
4067
+ "foreignKeys": {
4068
+ "workflow_run_execution_run_id_workflow_run_id_fk": {
4069
+ "name": "workflow_run_execution_run_id_workflow_run_id_fk",
4070
+ "tableFrom": "workflow_run_execution",
4071
+ "tableTo": "workflow_run",
4072
+ "columnsFrom": ["run_id"],
4073
+ "columnsTo": ["id"],
4074
+ "onDelete": "cascade",
4075
+ "onUpdate": "no action"
4076
+ }
4077
+ },
4078
+ "compositePrimaryKeys": {},
4079
+ "uniqueConstraints": {},
4080
+ "policies": {},
4081
+ "checkConstraints": {},
4082
+ "isRLSEnabled": false
4083
+ }
4084
+ },
4085
+ "enums": {},
4086
+ "schemas": {},
4087
+ "sequences": {},
4088
+ "roles": {},
4089
+ "policies": {},
4090
+ "views": {},
4091
+ "_meta": {
4092
+ "columns": {},
4093
+ "schemas": {},
4094
+ "tables": {}
4095
+ }
4096
+ }