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