@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,4286 @@
1
+ {
2
+ "id": "bdac2dcb-57fe-4ec7-a524-42a2bbe2bc0d",
3
+ "prevId": "b673a276-410f-4e34-99f9-b563273d63e1",
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
+ "status": {
2303
+ "name": "status",
2304
+ "type": "text",
2305
+ "primaryKey": false,
2306
+ "notNull": true,
2307
+ "default": "'online'"
2308
+ },
2309
+ "last_heartbeat": {
2310
+ "name": "last_heartbeat",
2311
+ "type": "timestamp",
2312
+ "primaryKey": false,
2313
+ "notNull": false
2314
+ },
2315
+ "created_at": {
2316
+ "name": "created_at",
2317
+ "type": "timestamp",
2318
+ "primaryKey": false,
2319
+ "notNull": true,
2320
+ "default": "now()"
2321
+ },
2322
+ "updated_at": {
2323
+ "name": "updated_at",
2324
+ "type": "timestamp",
2325
+ "primaryKey": false,
2326
+ "notNull": true,
2327
+ "default": "now()"
2328
+ }
2329
+ },
2330
+ "indexes": {},
2331
+ "foreignKeys": {},
2332
+ "compositePrimaryKeys": {},
2333
+ "uniqueConstraints": {
2334
+ "sidecar_token_hash_sha256_unique": {
2335
+ "name": "sidecar_token_hash_sha256_unique",
2336
+ "nullsNotDistinct": false,
2337
+ "columns": ["token_hash_sha256"]
2338
+ }
2339
+ },
2340
+ "policies": {},
2341
+ "checkConstraints": {},
2342
+ "isRLSEnabled": false
2343
+ },
2344
+ "public.sidecar_allocation": {
2345
+ "name": "sidecar_allocation",
2346
+ "schema": "",
2347
+ "columns": {
2348
+ "id": {
2349
+ "name": "id",
2350
+ "type": "text",
2351
+ "primaryKey": true,
2352
+ "notNull": true
2353
+ },
2354
+ "anchor_run_id": {
2355
+ "name": "anchor_run_id",
2356
+ "type": "text",
2357
+ "primaryKey": false,
2358
+ "notNull": true
2359
+ },
2360
+ "tenant_id": {
2361
+ "name": "tenant_id",
2362
+ "type": "text",
2363
+ "primaryKey": false,
2364
+ "notNull": true
2365
+ },
2366
+ "provisioner_id": {
2367
+ "name": "provisioner_id",
2368
+ "type": "text",
2369
+ "primaryKey": false,
2370
+ "notNull": true
2371
+ },
2372
+ "provisioner_api_version": {
2373
+ "name": "provisioner_api_version",
2374
+ "type": "integer",
2375
+ "primaryKey": false,
2376
+ "notNull": true
2377
+ },
2378
+ "provisioner_binding_fingerprint": {
2379
+ "name": "provisioner_binding_fingerprint",
2380
+ "type": "text",
2381
+ "primaryKey": false,
2382
+ "notNull": true
2383
+ },
2384
+ "sidecar_id": {
2385
+ "name": "sidecar_id",
2386
+ "type": "text",
2387
+ "primaryKey": false,
2388
+ "notNull": false
2389
+ },
2390
+ "status": {
2391
+ "name": "status",
2392
+ "type": "text",
2393
+ "primaryKey": false,
2394
+ "notNull": true,
2395
+ "default": "'pending'"
2396
+ },
2397
+ "generation": {
2398
+ "name": "generation",
2399
+ "type": "integer",
2400
+ "primaryKey": false,
2401
+ "notNull": true,
2402
+ "default": 0
2403
+ },
2404
+ "ensure_accepted_generation": {
2405
+ "name": "ensure_accepted_generation",
2406
+ "type": "integer",
2407
+ "primaryKey": false,
2408
+ "notNull": false
2409
+ },
2410
+ "external_ref": {
2411
+ "name": "external_ref",
2412
+ "type": "text",
2413
+ "primaryKey": false,
2414
+ "notNull": false
2415
+ },
2416
+ "next_attempt_at": {
2417
+ "name": "next_attempt_at",
2418
+ "type": "timestamp",
2419
+ "primaryKey": false,
2420
+ "notNull": false
2421
+ },
2422
+ "reconciliation_lease_id": {
2423
+ "name": "reconciliation_lease_id",
2424
+ "type": "text",
2425
+ "primaryKey": false,
2426
+ "notNull": false
2427
+ },
2428
+ "reconciliation_lease_expires_at": {
2429
+ "name": "reconciliation_lease_expires_at",
2430
+ "type": "timestamp",
2431
+ "primaryKey": false,
2432
+ "notNull": false
2433
+ },
2434
+ "ensure_attempts": {
2435
+ "name": "ensure_attempts",
2436
+ "type": "integer",
2437
+ "primaryKey": false,
2438
+ "notNull": true,
2439
+ "default": 0
2440
+ },
2441
+ "destroy_attempts": {
2442
+ "name": "destroy_attempts",
2443
+ "type": "integer",
2444
+ "primaryKey": false,
2445
+ "notNull": true,
2446
+ "default": 0
2447
+ },
2448
+ "connect_deadline": {
2449
+ "name": "connect_deadline",
2450
+ "type": "timestamp",
2451
+ "primaryKey": false,
2452
+ "notNull": false
2453
+ },
2454
+ "failure_code": {
2455
+ "name": "failure_code",
2456
+ "type": "text",
2457
+ "primaryKey": false,
2458
+ "notNull": false
2459
+ },
2460
+ "failure_message": {
2461
+ "name": "failure_message",
2462
+ "type": "text",
2463
+ "primaryKey": false,
2464
+ "notNull": false
2465
+ },
2466
+ "created_at": {
2467
+ "name": "created_at",
2468
+ "type": "timestamp",
2469
+ "primaryKey": false,
2470
+ "notNull": true,
2471
+ "default": "now()"
2472
+ },
2473
+ "updated_at": {
2474
+ "name": "updated_at",
2475
+ "type": "timestamp",
2476
+ "primaryKey": false,
2477
+ "notNull": true,
2478
+ "default": "now()"
2479
+ }
2480
+ },
2481
+ "indexes": {
2482
+ "sidecar_allocation_anchor_run_idx": {
2483
+ "name": "sidecar_allocation_anchor_run_idx",
2484
+ "columns": [
2485
+ {
2486
+ "expression": "anchor_run_id",
2487
+ "isExpression": false,
2488
+ "asc": true,
2489
+ "nulls": "last"
2490
+ }
2491
+ ],
2492
+ "isUnique": true,
2493
+ "concurrently": false,
2494
+ "method": "btree",
2495
+ "with": {}
2496
+ },
2497
+ "sidecar_allocation_active_sidecar_idx": {
2498
+ "name": "sidecar_allocation_active_sidecar_idx",
2499
+ "columns": [
2500
+ {
2501
+ "expression": "sidecar_id",
2502
+ "isExpression": false,
2503
+ "asc": true,
2504
+ "nulls": "last"
2505
+ }
2506
+ ],
2507
+ "isUnique": true,
2508
+ "where": "\"sidecar_allocation\".\"status\" in ('provisioning', 'allocated', 'replacing', 'releasing')",
2509
+ "concurrently": false,
2510
+ "method": "btree",
2511
+ "with": {}
2512
+ },
2513
+ "sidecar_allocation_sidecar_idx": {
2514
+ "name": "sidecar_allocation_sidecar_idx",
2515
+ "columns": [
2516
+ {
2517
+ "expression": "sidecar_id",
2518
+ "isExpression": false,
2519
+ "asc": true,
2520
+ "nulls": "last"
2521
+ }
2522
+ ],
2523
+ "isUnique": false,
2524
+ "concurrently": false,
2525
+ "method": "btree",
2526
+ "with": {}
2527
+ },
2528
+ "sidecar_allocation_reconciliation_idx": {
2529
+ "name": "sidecar_allocation_reconciliation_idx",
2530
+ "columns": [
2531
+ {
2532
+ "expression": "next_attempt_at",
2533
+ "isExpression": false,
2534
+ "asc": true,
2535
+ "nulls": "last"
2536
+ },
2537
+ {
2538
+ "expression": "created_at",
2539
+ "isExpression": false,
2540
+ "asc": true,
2541
+ "nulls": "last"
2542
+ }
2543
+ ],
2544
+ "isUnique": false,
2545
+ "where": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing') and \"sidecar_allocation\".\"next_attempt_at\" is not null",
2546
+ "concurrently": false,
2547
+ "method": "btree",
2548
+ "with": {}
2549
+ }
2550
+ },
2551
+ "foreignKeys": {
2552
+ "sidecar_allocation_anchor_run_id_workflow_run_id_fk": {
2553
+ "name": "sidecar_allocation_anchor_run_id_workflow_run_id_fk",
2554
+ "tableFrom": "sidecar_allocation",
2555
+ "tableTo": "workflow_run",
2556
+ "columnsFrom": ["anchor_run_id"],
2557
+ "columnsTo": ["id"],
2558
+ "onDelete": "cascade",
2559
+ "onUpdate": "no action"
2560
+ },
2561
+ "sidecar_allocation_tenant_id_tenant_id_fk": {
2562
+ "name": "sidecar_allocation_tenant_id_tenant_id_fk",
2563
+ "tableFrom": "sidecar_allocation",
2564
+ "tableTo": "tenant",
2565
+ "columnsFrom": ["tenant_id"],
2566
+ "columnsTo": ["id"],
2567
+ "onDelete": "restrict",
2568
+ "onUpdate": "no action"
2569
+ },
2570
+ "sidecar_allocation_sidecar_id_sidecar_id_fk": {
2571
+ "name": "sidecar_allocation_sidecar_id_sidecar_id_fk",
2572
+ "tableFrom": "sidecar_allocation",
2573
+ "tableTo": "sidecar",
2574
+ "columnsFrom": ["sidecar_id"],
2575
+ "columnsTo": ["id"],
2576
+ "onDelete": "restrict",
2577
+ "onUpdate": "no action"
2578
+ }
2579
+ },
2580
+ "compositePrimaryKeys": {},
2581
+ "uniqueConstraints": {},
2582
+ "policies": {},
2583
+ "checkConstraints": {
2584
+ "sidecar_allocation_status_check": {
2585
+ "name": "sidecar_allocation_status_check",
2586
+ "value": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing', 'released', 'failed')"
2587
+ },
2588
+ "sidecar_allocation_generation_check": {
2589
+ "name": "sidecar_allocation_generation_check",
2590
+ "value": "\"sidecar_allocation\".\"generation\" >= 0"
2591
+ },
2592
+ "sidecar_allocation_accepted_generation_check": {
2593
+ "name": "sidecar_allocation_accepted_generation_check",
2594
+ "value": "\"sidecar_allocation\".\"ensure_accepted_generation\" is null or \"sidecar_allocation\".\"ensure_accepted_generation\" <= \"sidecar_allocation\".\"generation\""
2595
+ }
2596
+ },
2597
+ "isRLSEnabled": false
2598
+ },
2599
+ "public.agent_session": {
2600
+ "name": "agent_session",
2601
+ "schema": "",
2602
+ "columns": {
2603
+ "id": {
2604
+ "name": "id",
2605
+ "type": "text",
2606
+ "primaryKey": true,
2607
+ "notNull": true
2608
+ },
2609
+ "tenant_id": {
2610
+ "name": "tenant_id",
2611
+ "type": "text",
2612
+ "primaryKey": false,
2613
+ "notNull": true
2614
+ },
2615
+ "agent_id": {
2616
+ "name": "agent_id",
2617
+ "type": "text",
2618
+ "primaryKey": false,
2619
+ "notNull": true
2620
+ },
2621
+ "principal_id": {
2622
+ "name": "principal_id",
2623
+ "type": "text",
2624
+ "primaryKey": false,
2625
+ "notNull": true
2626
+ },
2627
+ "status": {
2628
+ "name": "status",
2629
+ "type": "text",
2630
+ "primaryKey": false,
2631
+ "notNull": true,
2632
+ "default": "'active'"
2633
+ },
2634
+ "created_at": {
2635
+ "name": "created_at",
2636
+ "type": "timestamp",
2637
+ "primaryKey": false,
2638
+ "notNull": true,
2639
+ "default": "now()"
2640
+ },
2641
+ "updated_at": {
2642
+ "name": "updated_at",
2643
+ "type": "timestamp",
2644
+ "primaryKey": false,
2645
+ "notNull": true,
2646
+ "default": "now()"
2647
+ },
2648
+ "ended_at": {
2649
+ "name": "ended_at",
2650
+ "type": "timestamp",
2651
+ "primaryKey": false,
2652
+ "notNull": false
2653
+ }
2654
+ },
2655
+ "indexes": {},
2656
+ "foreignKeys": {
2657
+ "agent_session_tenant_id_tenant_id_fk": {
2658
+ "name": "agent_session_tenant_id_tenant_id_fk",
2659
+ "tableFrom": "agent_session",
2660
+ "tableTo": "tenant",
2661
+ "columnsFrom": ["tenant_id"],
2662
+ "columnsTo": ["id"],
2663
+ "onDelete": "cascade",
2664
+ "onUpdate": "no action"
2665
+ },
2666
+ "agent_session_agent_id_workflow_definition_id_fk": {
2667
+ "name": "agent_session_agent_id_workflow_definition_id_fk",
2668
+ "tableFrom": "agent_session",
2669
+ "tableTo": "workflow_definition",
2670
+ "columnsFrom": ["agent_id"],
2671
+ "columnsTo": ["id"],
2672
+ "onDelete": "restrict",
2673
+ "onUpdate": "no action"
2674
+ },
2675
+ "agent_session_principal_id_principal_id_fk": {
2676
+ "name": "agent_session_principal_id_principal_id_fk",
2677
+ "tableFrom": "agent_session",
2678
+ "tableTo": "principal",
2679
+ "columnsFrom": ["principal_id"],
2680
+ "columnsTo": ["id"],
2681
+ "onDelete": "no action",
2682
+ "onUpdate": "no action"
2683
+ }
2684
+ },
2685
+ "compositePrimaryKeys": {},
2686
+ "uniqueConstraints": {},
2687
+ "policies": {},
2688
+ "checkConstraints": {},
2689
+ "isRLSEnabled": false
2690
+ },
2691
+ "public.session_asset": {
2692
+ "name": "session_asset",
2693
+ "schema": "",
2694
+ "columns": {
2695
+ "instance_id": {
2696
+ "name": "instance_id",
2697
+ "type": "text",
2698
+ "primaryKey": false,
2699
+ "notNull": true
2700
+ },
2701
+ "mount_path": {
2702
+ "name": "mount_path",
2703
+ "type": "text",
2704
+ "primaryKey": false,
2705
+ "notNull": true
2706
+ },
2707
+ "asset_pack_sha": {
2708
+ "name": "asset_pack_sha",
2709
+ "type": "text",
2710
+ "primaryKey": false,
2711
+ "notNull": true
2712
+ },
2713
+ "source_commit_sha": {
2714
+ "name": "source_commit_sha",
2715
+ "type": "text",
2716
+ "primaryKey": false,
2717
+ "notNull": true
2718
+ },
2719
+ "materialized_at": {
2720
+ "name": "materialized_at",
2721
+ "type": "timestamp",
2722
+ "primaryKey": false,
2723
+ "notNull": true,
2724
+ "default": "now()"
2725
+ }
2726
+ },
2727
+ "indexes": {
2728
+ "session_asset_pack_sha_idx": {
2729
+ "name": "session_asset_pack_sha_idx",
2730
+ "columns": [
2731
+ {
2732
+ "expression": "asset_pack_sha",
2733
+ "isExpression": false,
2734
+ "asc": true,
2735
+ "nulls": "last"
2736
+ }
2737
+ ],
2738
+ "isUnique": false,
2739
+ "concurrently": false,
2740
+ "method": "btree",
2741
+ "with": {}
2742
+ }
2743
+ },
2744
+ "foreignKeys": {},
2745
+ "compositePrimaryKeys": {
2746
+ "session_asset_instance_id_mount_path_pk": {
2747
+ "name": "session_asset_instance_id_mount_path_pk",
2748
+ "columns": ["instance_id", "mount_path"]
2749
+ }
2750
+ },
2751
+ "uniqueConstraints": {},
2752
+ "policies": {},
2753
+ "checkConstraints": {},
2754
+ "isRLSEnabled": false
2755
+ },
2756
+ "public.inference_turn": {
2757
+ "name": "inference_turn",
2758
+ "schema": "",
2759
+ "columns": {
2760
+ "id": {
2761
+ "name": "id",
2762
+ "type": "text",
2763
+ "primaryKey": true,
2764
+ "notNull": true
2765
+ },
2766
+ "session_id": {
2767
+ "name": "session_id",
2768
+ "type": "text",
2769
+ "primaryKey": false,
2770
+ "notNull": true
2771
+ },
2772
+ "instance_id": {
2773
+ "name": "instance_id",
2774
+ "type": "text",
2775
+ "primaryKey": false,
2776
+ "notNull": true
2777
+ },
2778
+ "tenant_id": {
2779
+ "name": "tenant_id",
2780
+ "type": "text",
2781
+ "primaryKey": false,
2782
+ "notNull": true
2783
+ },
2784
+ "model": {
2785
+ "name": "model",
2786
+ "type": "text",
2787
+ "primaryKey": false,
2788
+ "notNull": true
2789
+ },
2790
+ "status": {
2791
+ "name": "status",
2792
+ "type": "text",
2793
+ "primaryKey": false,
2794
+ "notNull": true,
2795
+ "default": "'running'"
2796
+ },
2797
+ "started_at": {
2798
+ "name": "started_at",
2799
+ "type": "timestamp",
2800
+ "primaryKey": false,
2801
+ "notNull": true
2802
+ },
2803
+ "ended_at": {
2804
+ "name": "ended_at",
2805
+ "type": "timestamp",
2806
+ "primaryKey": false,
2807
+ "notNull": false
2808
+ }
2809
+ },
2810
+ "indexes": {
2811
+ "inference_turn_instance_id_started_at_idx": {
2812
+ "name": "inference_turn_instance_id_started_at_idx",
2813
+ "columns": [
2814
+ {
2815
+ "expression": "instance_id",
2816
+ "isExpression": false,
2817
+ "asc": true,
2818
+ "nulls": "last"
2819
+ },
2820
+ {
2821
+ "expression": "started_at",
2822
+ "isExpression": false,
2823
+ "asc": true,
2824
+ "nulls": "last"
2825
+ }
2826
+ ],
2827
+ "isUnique": false,
2828
+ "concurrently": false,
2829
+ "method": "btree",
2830
+ "with": {}
2831
+ }
2832
+ },
2833
+ "foreignKeys": {
2834
+ "inference_turn_session_id_agent_session_id_fk": {
2835
+ "name": "inference_turn_session_id_agent_session_id_fk",
2836
+ "tableFrom": "inference_turn",
2837
+ "tableTo": "agent_session",
2838
+ "columnsFrom": ["session_id"],
2839
+ "columnsTo": ["id"],
2840
+ "onDelete": "cascade",
2841
+ "onUpdate": "no action"
2842
+ },
2843
+ "inference_turn_tenant_id_tenant_id_fk": {
2844
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2845
+ "tableFrom": "inference_turn",
2846
+ "tableTo": "tenant",
2847
+ "columnsFrom": ["tenant_id"],
2848
+ "columnsTo": ["id"],
2849
+ "onDelete": "cascade",
2850
+ "onUpdate": "no action"
2851
+ }
2852
+ },
2853
+ "compositePrimaryKeys": {},
2854
+ "uniqueConstraints": {},
2855
+ "policies": {},
2856
+ "checkConstraints": {},
2857
+ "isRLSEnabled": false
2858
+ },
2859
+ "public.session_mail": {
2860
+ "name": "session_mail",
2861
+ "schema": "",
2862
+ "columns": {
2863
+ "id": {
2864
+ "name": "id",
2865
+ "type": "text",
2866
+ "primaryKey": true,
2867
+ "notNull": true
2868
+ },
2869
+ "session_id": {
2870
+ "name": "session_id",
2871
+ "type": "text",
2872
+ "primaryKey": false,
2873
+ "notNull": true
2874
+ },
2875
+ "instance_id": {
2876
+ "name": "instance_id",
2877
+ "type": "text",
2878
+ "primaryKey": false,
2879
+ "notNull": false
2880
+ },
2881
+ "tenant_id": {
2882
+ "name": "tenant_id",
2883
+ "type": "text",
2884
+ "primaryKey": false,
2885
+ "notNull": true
2886
+ },
2887
+ "direction": {
2888
+ "name": "direction",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "status": {
2894
+ "name": "status",
2895
+ "type": "text",
2896
+ "primaryKey": false,
2897
+ "notNull": true,
2898
+ "default": "'pending'"
2899
+ },
2900
+ "raw": {
2901
+ "name": "raw",
2902
+ "type": "bytea",
2903
+ "primaryKey": false,
2904
+ "notNull": true
2905
+ },
2906
+ "created_at": {
2907
+ "name": "created_at",
2908
+ "type": "timestamp",
2909
+ "primaryKey": false,
2910
+ "notNull": true,
2911
+ "default": "now()"
2912
+ }
2913
+ },
2914
+ "indexes": {
2915
+ "session_mail_instance_id_created_at_idx": {
2916
+ "name": "session_mail_instance_id_created_at_idx",
2917
+ "columns": [
2918
+ {
2919
+ "expression": "instance_id",
2920
+ "isExpression": false,
2921
+ "asc": true,
2922
+ "nulls": "last"
2923
+ },
2924
+ {
2925
+ "expression": "created_at",
2926
+ "isExpression": false,
2927
+ "asc": true,
2928
+ "nulls": "last"
2929
+ }
2930
+ ],
2931
+ "isUnique": false,
2932
+ "concurrently": false,
2933
+ "method": "btree",
2934
+ "with": {}
2935
+ },
2936
+ "session_mail_session_id_created_at_idx": {
2937
+ "name": "session_mail_session_id_created_at_idx",
2938
+ "columns": [
2939
+ {
2940
+ "expression": "session_id",
2941
+ "isExpression": false,
2942
+ "asc": true,
2943
+ "nulls": "last"
2944
+ },
2945
+ {
2946
+ "expression": "created_at",
2947
+ "isExpression": false,
2948
+ "asc": true,
2949
+ "nulls": "last"
2950
+ }
2951
+ ],
2952
+ "isUnique": false,
2953
+ "concurrently": false,
2954
+ "method": "btree",
2955
+ "with": {}
2956
+ }
2957
+ },
2958
+ "foreignKeys": {
2959
+ "session_mail_session_id_agent_session_id_fk": {
2960
+ "name": "session_mail_session_id_agent_session_id_fk",
2961
+ "tableFrom": "session_mail",
2962
+ "tableTo": "agent_session",
2963
+ "columnsFrom": ["session_id"],
2964
+ "columnsTo": ["id"],
2965
+ "onDelete": "cascade",
2966
+ "onUpdate": "no action"
2967
+ },
2968
+ "session_mail_tenant_id_tenant_id_fk": {
2969
+ "name": "session_mail_tenant_id_tenant_id_fk",
2970
+ "tableFrom": "session_mail",
2971
+ "tableTo": "tenant",
2972
+ "columnsFrom": ["tenant_id"],
2973
+ "columnsTo": ["id"],
2974
+ "onDelete": "cascade",
2975
+ "onUpdate": "no action"
2976
+ }
2977
+ },
2978
+ "compositePrimaryKeys": {},
2979
+ "uniqueConstraints": {},
2980
+ "policies": {},
2981
+ "checkConstraints": {},
2982
+ "isRLSEnabled": false
2983
+ },
2984
+ "public.turn_part": {
2985
+ "name": "turn_part",
2986
+ "schema": "",
2987
+ "columns": {
2988
+ "id": {
2989
+ "name": "id",
2990
+ "type": "text",
2991
+ "primaryKey": true,
2992
+ "notNull": true
2993
+ },
2994
+ "turn_id": {
2995
+ "name": "turn_id",
2996
+ "type": "text",
2997
+ "primaryKey": false,
2998
+ "notNull": true
2999
+ },
3000
+ "session_id": {
3001
+ "name": "session_id",
3002
+ "type": "text",
3003
+ "primaryKey": false,
3004
+ "notNull": true
3005
+ },
3006
+ "type": {
3007
+ "name": "type",
3008
+ "type": "text",
3009
+ "primaryKey": false,
3010
+ "notNull": true
3011
+ },
3012
+ "content": {
3013
+ "name": "content",
3014
+ "type": "text",
3015
+ "primaryKey": false,
3016
+ "notNull": false
3017
+ },
3018
+ "metadata": {
3019
+ "name": "metadata",
3020
+ "type": "jsonb",
3021
+ "primaryKey": false,
3022
+ "notNull": false
3023
+ },
3024
+ "ordinal": {
3025
+ "name": "ordinal",
3026
+ "type": "integer",
3027
+ "primaryKey": false,
3028
+ "notNull": true
3029
+ }
3030
+ },
3031
+ "indexes": {},
3032
+ "foreignKeys": {
3033
+ "turn_part_turn_id_inference_turn_id_fk": {
3034
+ "name": "turn_part_turn_id_inference_turn_id_fk",
3035
+ "tableFrom": "turn_part",
3036
+ "tableTo": "inference_turn",
3037
+ "columnsFrom": ["turn_id"],
3038
+ "columnsTo": ["id"],
3039
+ "onDelete": "cascade",
3040
+ "onUpdate": "no action"
3041
+ },
3042
+ "turn_part_session_id_agent_session_id_fk": {
3043
+ "name": "turn_part_session_id_agent_session_id_fk",
3044
+ "tableFrom": "turn_part",
3045
+ "tableTo": "agent_session",
3046
+ "columnsFrom": ["session_id"],
3047
+ "columnsTo": ["id"],
3048
+ "onDelete": "cascade",
3049
+ "onUpdate": "no action"
3050
+ }
3051
+ },
3052
+ "compositePrimaryKeys": {},
3053
+ "uniqueConstraints": {},
3054
+ "policies": {},
3055
+ "checkConstraints": {},
3056
+ "isRLSEnabled": false
3057
+ },
3058
+ "public.git_token": {
3059
+ "name": "git_token",
3060
+ "schema": "",
3061
+ "columns": {
3062
+ "id": {
3063
+ "name": "id",
3064
+ "type": "text",
3065
+ "primaryKey": true,
3066
+ "notNull": true
3067
+ },
3068
+ "tenant_id": {
3069
+ "name": "tenant_id",
3070
+ "type": "text",
3071
+ "primaryKey": false,
3072
+ "notNull": false
3073
+ },
3074
+ "user_id": {
3075
+ "name": "user_id",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": true
3079
+ },
3080
+ "principal_id": {
3081
+ "name": "principal_id",
3082
+ "type": "text",
3083
+ "primaryKey": false,
3084
+ "notNull": false
3085
+ },
3086
+ "name": {
3087
+ "name": "name",
3088
+ "type": "text",
3089
+ "primaryKey": false,
3090
+ "notNull": true
3091
+ },
3092
+ "kind": {
3093
+ "name": "kind",
3094
+ "type": "text",
3095
+ "primaryKey": false,
3096
+ "notNull": true
3097
+ },
3098
+ "token_hash_sha256": {
3099
+ "name": "token_hash_sha256",
3100
+ "type": "bytea",
3101
+ "primaryKey": false,
3102
+ "notNull": true
3103
+ },
3104
+ "resource": {
3105
+ "name": "resource",
3106
+ "type": "text",
3107
+ "primaryKey": false,
3108
+ "notNull": true
3109
+ },
3110
+ "ref_pattern": {
3111
+ "name": "ref_pattern",
3112
+ "type": "text",
3113
+ "primaryKey": false,
3114
+ "notNull": true
3115
+ },
3116
+ "actions": {
3117
+ "name": "actions",
3118
+ "type": "text[]",
3119
+ "primaryKey": false,
3120
+ "notNull": true
3121
+ },
3122
+ "expires_at": {
3123
+ "name": "expires_at",
3124
+ "type": "timestamp with time zone",
3125
+ "primaryKey": false,
3126
+ "notNull": true
3127
+ },
3128
+ "revoked_at": {
3129
+ "name": "revoked_at",
3130
+ "type": "timestamp with time zone",
3131
+ "primaryKey": false,
3132
+ "notNull": false
3133
+ },
3134
+ "created_at": {
3135
+ "name": "created_at",
3136
+ "type": "timestamp with time zone",
3137
+ "primaryKey": false,
3138
+ "notNull": true,
3139
+ "default": "now()"
3140
+ }
3141
+ },
3142
+ "indexes": {
3143
+ "git_token_user_id_name_active_idx": {
3144
+ "name": "git_token_user_id_name_active_idx",
3145
+ "columns": [
3146
+ {
3147
+ "expression": "user_id",
3148
+ "isExpression": false,
3149
+ "asc": true,
3150
+ "nulls": "last"
3151
+ },
3152
+ {
3153
+ "expression": "name",
3154
+ "isExpression": false,
3155
+ "asc": true,
3156
+ "nulls": "last"
3157
+ }
3158
+ ],
3159
+ "isUnique": true,
3160
+ "where": "\"git_token\".\"revoked_at\" is null",
3161
+ "concurrently": false,
3162
+ "method": "btree",
3163
+ "with": {}
3164
+ }
3165
+ },
3166
+ "foreignKeys": {
3167
+ "git_token_tenant_id_tenant_id_fk": {
3168
+ "name": "git_token_tenant_id_tenant_id_fk",
3169
+ "tableFrom": "git_token",
3170
+ "tableTo": "tenant",
3171
+ "columnsFrom": ["tenant_id"],
3172
+ "columnsTo": ["id"],
3173
+ "onDelete": "no action",
3174
+ "onUpdate": "no action"
3175
+ },
3176
+ "git_token_user_id_user_id_fk": {
3177
+ "name": "git_token_user_id_user_id_fk",
3178
+ "tableFrom": "git_token",
3179
+ "tableTo": "user",
3180
+ "columnsFrom": ["user_id"],
3181
+ "columnsTo": ["id"],
3182
+ "onDelete": "cascade",
3183
+ "onUpdate": "no action"
3184
+ },
3185
+ "git_token_principal_id_principal_id_fk": {
3186
+ "name": "git_token_principal_id_principal_id_fk",
3187
+ "tableFrom": "git_token",
3188
+ "tableTo": "principal",
3189
+ "columnsFrom": ["principal_id"],
3190
+ "columnsTo": ["id"],
3191
+ "onDelete": "cascade",
3192
+ "onUpdate": "no action"
3193
+ }
3194
+ },
3195
+ "compositePrimaryKeys": {},
3196
+ "uniqueConstraints": {
3197
+ "git_token_token_hash_sha256_unique": {
3198
+ "name": "git_token_token_hash_sha256_unique",
3199
+ "nullsNotDistinct": false,
3200
+ "columns": ["token_hash_sha256"]
3201
+ }
3202
+ },
3203
+ "policies": {},
3204
+ "checkConstraints": {},
3205
+ "isRLSEnabled": false
3206
+ },
3207
+ "public.workflow_definition": {
3208
+ "name": "workflow_definition",
3209
+ "schema": "",
3210
+ "columns": {
3211
+ "id": {
3212
+ "name": "id",
3213
+ "type": "text",
3214
+ "primaryKey": true,
3215
+ "notNull": true
3216
+ },
3217
+ "tenant_id": {
3218
+ "name": "tenant_id",
3219
+ "type": "text",
3220
+ "primaryKey": false,
3221
+ "notNull": true
3222
+ },
3223
+ "creator_principal_id": {
3224
+ "name": "creator_principal_id",
3225
+ "type": "text",
3226
+ "primaryKey": false,
3227
+ "notNull": false
3228
+ },
3229
+ "asset_id": {
3230
+ "name": "asset_id",
3231
+ "type": "text",
3232
+ "primaryKey": false,
3233
+ "notNull": false
3234
+ },
3235
+ "wire_hash": {
3236
+ "name": "wire_hash",
3237
+ "type": "text",
3238
+ "primaryKey": false,
3239
+ "notNull": false
3240
+ },
3241
+ "name": {
3242
+ "name": "name",
3243
+ "type": "text",
3244
+ "primaryKey": false,
3245
+ "notNull": true
3246
+ },
3247
+ "description": {
3248
+ "name": "description",
3249
+ "type": "text",
3250
+ "primaryKey": false,
3251
+ "notNull": false
3252
+ },
3253
+ "grant_requirements": {
3254
+ "name": "grant_requirements",
3255
+ "type": "jsonb",
3256
+ "primaryKey": false,
3257
+ "notNull": false
3258
+ },
3259
+ "model_requirements": {
3260
+ "name": "model_requirements",
3261
+ "type": "jsonb",
3262
+ "primaryKey": false,
3263
+ "notNull": false
3264
+ },
3265
+ "credential_bindings": {
3266
+ "name": "credential_bindings",
3267
+ "type": "jsonb",
3268
+ "primaryKey": false,
3269
+ "notNull": false
3270
+ },
3271
+ "current_version": {
3272
+ "name": "current_version",
3273
+ "type": "text",
3274
+ "primaryKey": false,
3275
+ "notNull": true,
3276
+ "default": "'1'"
3277
+ },
3278
+ "status": {
3279
+ "name": "status",
3280
+ "type": "text",
3281
+ "primaryKey": false,
3282
+ "notNull": true,
3283
+ "default": "'deployed'"
3284
+ },
3285
+ "created_at": {
3286
+ "name": "created_at",
3287
+ "type": "timestamp",
3288
+ "primaryKey": false,
3289
+ "notNull": true,
3290
+ "default": "now()"
3291
+ },
3292
+ "updated_at": {
3293
+ "name": "updated_at",
3294
+ "type": "timestamp",
3295
+ "primaryKey": false,
3296
+ "notNull": true,
3297
+ "default": "now()"
3298
+ }
3299
+ },
3300
+ "indexes": {
3301
+ "workflow_definition_tenant_idx": {
3302
+ "name": "workflow_definition_tenant_idx",
3303
+ "columns": [
3304
+ {
3305
+ "expression": "tenant_id",
3306
+ "isExpression": false,
3307
+ "asc": true,
3308
+ "nulls": "last"
3309
+ },
3310
+ {
3311
+ "expression": "created_at",
3312
+ "isExpression": false,
3313
+ "asc": true,
3314
+ "nulls": "last"
3315
+ }
3316
+ ],
3317
+ "isUnique": false,
3318
+ "concurrently": false,
3319
+ "method": "btree",
3320
+ "with": {}
3321
+ },
3322
+ "workflow_definition_asset_wire_hash_idx": {
3323
+ "name": "workflow_definition_asset_wire_hash_idx",
3324
+ "columns": [
3325
+ {
3326
+ "expression": "asset_id",
3327
+ "isExpression": false,
3328
+ "asc": true,
3329
+ "nulls": "last"
3330
+ },
3331
+ {
3332
+ "expression": "wire_hash",
3333
+ "isExpression": false,
3334
+ "asc": true,
3335
+ "nulls": "last"
3336
+ }
3337
+ ],
3338
+ "isUnique": true,
3339
+ "concurrently": false,
3340
+ "method": "btree",
3341
+ "with": {}
3342
+ }
3343
+ },
3344
+ "foreignKeys": {
3345
+ "workflow_definition_tenant_id_tenant_id_fk": {
3346
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3347
+ "tableFrom": "workflow_definition",
3348
+ "tableTo": "tenant",
3349
+ "columnsFrom": ["tenant_id"],
3350
+ "columnsTo": ["id"],
3351
+ "onDelete": "cascade",
3352
+ "onUpdate": "no action"
3353
+ },
3354
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3355
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3356
+ "tableFrom": "workflow_definition",
3357
+ "tableTo": "principal",
3358
+ "columnsFrom": ["creator_principal_id"],
3359
+ "columnsTo": ["id"],
3360
+ "onDelete": "no action",
3361
+ "onUpdate": "no action"
3362
+ },
3363
+ "workflow_definition_asset_id_asset_id_fk": {
3364
+ "name": "workflow_definition_asset_id_asset_id_fk",
3365
+ "tableFrom": "workflow_definition",
3366
+ "tableTo": "asset",
3367
+ "columnsFrom": ["asset_id"],
3368
+ "columnsTo": ["id"],
3369
+ "onDelete": "restrict",
3370
+ "onUpdate": "no action"
3371
+ }
3372
+ },
3373
+ "compositePrimaryKeys": {},
3374
+ "uniqueConstraints": {},
3375
+ "policies": {},
3376
+ "checkConstraints": {},
3377
+ "isRLSEnabled": false
3378
+ },
3379
+ "public.workflow_definition_version": {
3380
+ "name": "workflow_definition_version",
3381
+ "schema": "",
3382
+ "columns": {
3383
+ "id": {
3384
+ "name": "id",
3385
+ "type": "text",
3386
+ "primaryKey": true,
3387
+ "notNull": true
3388
+ },
3389
+ "definition_id": {
3390
+ "name": "definition_id",
3391
+ "type": "text",
3392
+ "primaryKey": false,
3393
+ "notNull": true
3394
+ },
3395
+ "version": {
3396
+ "name": "version",
3397
+ "type": "text",
3398
+ "primaryKey": false,
3399
+ "notNull": true
3400
+ },
3401
+ "status": {
3402
+ "name": "status",
3403
+ "type": "text",
3404
+ "primaryKey": false,
3405
+ "notNull": true,
3406
+ "default": "'active'"
3407
+ },
3408
+ "approved_wire_hash": {
3409
+ "name": "approved_wire_hash",
3410
+ "type": "text",
3411
+ "primaryKey": false,
3412
+ "notNull": false
3413
+ },
3414
+ "grant_snapshot": {
3415
+ "name": "grant_snapshot",
3416
+ "type": "jsonb",
3417
+ "primaryKey": false,
3418
+ "notNull": false
3419
+ },
3420
+ "created_at": {
3421
+ "name": "created_at",
3422
+ "type": "timestamp",
3423
+ "primaryKey": false,
3424
+ "notNull": true,
3425
+ "default": "now()"
3426
+ }
3427
+ },
3428
+ "indexes": {
3429
+ "workflow_definition_version_definition_idx": {
3430
+ "name": "workflow_definition_version_definition_idx",
3431
+ "columns": [
3432
+ {
3433
+ "expression": "definition_id",
3434
+ "isExpression": false,
3435
+ "asc": true,
3436
+ "nulls": "last"
3437
+ }
3438
+ ],
3439
+ "isUnique": false,
3440
+ "concurrently": false,
3441
+ "method": "btree",
3442
+ "with": {}
3443
+ }
3444
+ },
3445
+ "foreignKeys": {
3446
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3447
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3448
+ "tableFrom": "workflow_definition_version",
3449
+ "tableTo": "workflow_definition",
3450
+ "columnsFrom": ["definition_id"],
3451
+ "columnsTo": ["id"],
3452
+ "onDelete": "cascade",
3453
+ "onUpdate": "no action"
3454
+ }
3455
+ },
3456
+ "compositePrimaryKeys": {},
3457
+ "uniqueConstraints": {
3458
+ "workflow_definition_version_definition_version": {
3459
+ "name": "workflow_definition_version_definition_version",
3460
+ "nullsNotDistinct": false,
3461
+ "columns": ["definition_id", "version"]
3462
+ }
3463
+ },
3464
+ "policies": {},
3465
+ "checkConstraints": {},
3466
+ "isRLSEnabled": false
3467
+ },
3468
+ "public.workflow_run": {
3469
+ "name": "workflow_run",
3470
+ "schema": "",
3471
+ "columns": {
3472
+ "id": {
3473
+ "name": "id",
3474
+ "type": "text",
3475
+ "primaryKey": true,
3476
+ "notNull": true
3477
+ },
3478
+ "definition_id": {
3479
+ "name": "definition_id",
3480
+ "type": "text",
3481
+ "primaryKey": false,
3482
+ "notNull": true
3483
+ },
3484
+ "anchor_run_id": {
3485
+ "name": "anchor_run_id",
3486
+ "type": "text",
3487
+ "primaryKey": false,
3488
+ "notNull": false
3489
+ },
3490
+ "tenant_id": {
3491
+ "name": "tenant_id",
3492
+ "type": "text",
3493
+ "primaryKey": false,
3494
+ "notNull": true
3495
+ },
3496
+ "principal_id": {
3497
+ "name": "principal_id",
3498
+ "type": "text",
3499
+ "primaryKey": false,
3500
+ "notNull": false
3501
+ },
3502
+ "status": {
3503
+ "name": "status",
3504
+ "type": "text",
3505
+ "primaryKey": false,
3506
+ "notNull": true,
3507
+ "default": "'running'"
3508
+ },
3509
+ "address": {
3510
+ "name": "address",
3511
+ "type": "text",
3512
+ "primaryKey": false,
3513
+ "notNull": false
3514
+ },
3515
+ "public_key": {
3516
+ "name": "public_key",
3517
+ "type": "text",
3518
+ "primaryKey": false,
3519
+ "notNull": false
3520
+ },
3521
+ "sidecar_id": {
3522
+ "name": "sidecar_id",
3523
+ "type": "text",
3524
+ "primaryKey": false,
3525
+ "notNull": false
3526
+ },
3527
+ "kernel_id": {
3528
+ "name": "kernel_id",
3529
+ "type": "text",
3530
+ "primaryKey": false,
3531
+ "notNull": false
3532
+ },
3533
+ "model_preferences": {
3534
+ "name": "model_preferences",
3535
+ "type": "jsonb",
3536
+ "primaryKey": false,
3537
+ "notNull": false
3538
+ },
3539
+ "credential_refs": {
3540
+ "name": "credential_refs",
3541
+ "type": "jsonb",
3542
+ "primaryKey": false,
3543
+ "notNull": false
3544
+ },
3545
+ "created_at": {
3546
+ "name": "created_at",
3547
+ "type": "timestamp",
3548
+ "primaryKey": false,
3549
+ "notNull": true,
3550
+ "default": "now()"
3551
+ },
3552
+ "ended_at": {
3553
+ "name": "ended_at",
3554
+ "type": "timestamp",
3555
+ "primaryKey": false,
3556
+ "notNull": false
3557
+ }
3558
+ },
3559
+ "indexes": {
3560
+ "workflow_run_definition_idx": {
3561
+ "name": "workflow_run_definition_idx",
3562
+ "columns": [
3563
+ {
3564
+ "expression": "definition_id",
3565
+ "isExpression": false,
3566
+ "asc": true,
3567
+ "nulls": "last"
3568
+ }
3569
+ ],
3570
+ "isUnique": false,
3571
+ "concurrently": false,
3572
+ "method": "btree",
3573
+ "with": {}
3574
+ },
3575
+ "workflow_run_address_idx": {
3576
+ "name": "workflow_run_address_idx",
3577
+ "columns": [
3578
+ {
3579
+ "expression": "address",
3580
+ "isExpression": false,
3581
+ "asc": true,
3582
+ "nulls": "last"
3583
+ }
3584
+ ],
3585
+ "isUnique": true,
3586
+ "where": "\"workflow_run\".\"address\" is not null",
3587
+ "concurrently": false,
3588
+ "method": "btree",
3589
+ "with": {}
3590
+ }
3591
+ },
3592
+ "foreignKeys": {
3593
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3594
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3595
+ "tableFrom": "workflow_run",
3596
+ "tableTo": "workflow_definition",
3597
+ "columnsFrom": ["definition_id"],
3598
+ "columnsTo": ["id"],
3599
+ "onDelete": "cascade",
3600
+ "onUpdate": "no action"
3601
+ },
3602
+ "workflow_run_anchor_run_id_workflow_run_id_fk": {
3603
+ "name": "workflow_run_anchor_run_id_workflow_run_id_fk",
3604
+ "tableFrom": "workflow_run",
3605
+ "tableTo": "workflow_run",
3606
+ "columnsFrom": ["anchor_run_id"],
3607
+ "columnsTo": ["id"],
3608
+ "onDelete": "cascade",
3609
+ "onUpdate": "no action"
3610
+ },
3611
+ "workflow_run_tenant_id_tenant_id_fk": {
3612
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3613
+ "tableFrom": "workflow_run",
3614
+ "tableTo": "tenant",
3615
+ "columnsFrom": ["tenant_id"],
3616
+ "columnsTo": ["id"],
3617
+ "onDelete": "cascade",
3618
+ "onUpdate": "no action"
3619
+ },
3620
+ "workflow_run_principal_id_principal_id_fk": {
3621
+ "name": "workflow_run_principal_id_principal_id_fk",
3622
+ "tableFrom": "workflow_run",
3623
+ "tableTo": "principal",
3624
+ "columnsFrom": ["principal_id"],
3625
+ "columnsTo": ["id"],
3626
+ "onDelete": "set null",
3627
+ "onUpdate": "no action"
3628
+ },
3629
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3630
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3631
+ "tableFrom": "workflow_run",
3632
+ "tableTo": "sidecar",
3633
+ "columnsFrom": ["sidecar_id"],
3634
+ "columnsTo": ["id"],
3635
+ "onDelete": "set null",
3636
+ "onUpdate": "no action"
3637
+ }
3638
+ },
3639
+ "compositePrimaryKeys": {},
3640
+ "uniqueConstraints": {},
3641
+ "policies": {},
3642
+ "checkConstraints": {},
3643
+ "isRLSEnabled": false
3644
+ },
3645
+ "public.workflow_run_dispatch": {
3646
+ "name": "workflow_run_dispatch",
3647
+ "schema": "",
3648
+ "columns": {
3649
+ "id": {
3650
+ "name": "id",
3651
+ "type": "text",
3652
+ "primaryKey": true,
3653
+ "notNull": true
3654
+ },
3655
+ "anchor_run_id": {
3656
+ "name": "anchor_run_id",
3657
+ "type": "text",
3658
+ "primaryKey": false,
3659
+ "notNull": true
3660
+ },
3661
+ "message_id": {
3662
+ "name": "message_id",
3663
+ "type": "text",
3664
+ "primaryKey": false,
3665
+ "notNull": true
3666
+ },
3667
+ "kind": {
3668
+ "name": "kind",
3669
+ "type": "text",
3670
+ "primaryKey": false,
3671
+ "notNull": true,
3672
+ "default": "'mail'"
3673
+ },
3674
+ "raw_message": {
3675
+ "name": "raw_message",
3676
+ "type": "bytea",
3677
+ "primaryKey": false,
3678
+ "notNull": true
3679
+ },
3680
+ "step_grants": {
3681
+ "name": "step_grants",
3682
+ "type": "jsonb",
3683
+ "primaryKey": false,
3684
+ "notNull": true
3685
+ },
3686
+ "status": {
3687
+ "name": "status",
3688
+ "type": "text",
3689
+ "primaryKey": false,
3690
+ "notNull": true,
3691
+ "default": "'pending'"
3692
+ },
3693
+ "acknowledged_generation": {
3694
+ "name": "acknowledged_generation",
3695
+ "type": "integer",
3696
+ "primaryKey": false,
3697
+ "notNull": false
3698
+ },
3699
+ "attempt_count": {
3700
+ "name": "attempt_count",
3701
+ "type": "integer",
3702
+ "primaryKey": false,
3703
+ "notNull": true,
3704
+ "default": 0
3705
+ },
3706
+ "next_attempt_at": {
3707
+ "name": "next_attempt_at",
3708
+ "type": "timestamp",
3709
+ "primaryKey": false,
3710
+ "notNull": false,
3711
+ "default": "now()"
3712
+ },
3713
+ "delivery_lease_id": {
3714
+ "name": "delivery_lease_id",
3715
+ "type": "text",
3716
+ "primaryKey": false,
3717
+ "notNull": false
3718
+ },
3719
+ "delivery_lease_expires_at": {
3720
+ "name": "delivery_lease_expires_at",
3721
+ "type": "timestamp",
3722
+ "primaryKey": false,
3723
+ "notNull": false
3724
+ },
3725
+ "failure_code": {
3726
+ "name": "failure_code",
3727
+ "type": "text",
3728
+ "primaryKey": false,
3729
+ "notNull": false
3730
+ },
3731
+ "failure_message": {
3732
+ "name": "failure_message",
3733
+ "type": "text",
3734
+ "primaryKey": false,
3735
+ "notNull": false
3736
+ },
3737
+ "created_at": {
3738
+ "name": "created_at",
3739
+ "type": "timestamp",
3740
+ "primaryKey": false,
3741
+ "notNull": true,
3742
+ "default": "now()"
3743
+ },
3744
+ "updated_at": {
3745
+ "name": "updated_at",
3746
+ "type": "timestamp",
3747
+ "primaryKey": false,
3748
+ "notNull": true,
3749
+ "default": "now()"
3750
+ },
3751
+ "acknowledged_at": {
3752
+ "name": "acknowledged_at",
3753
+ "type": "timestamp",
3754
+ "primaryKey": false,
3755
+ "notNull": false
3756
+ },
3757
+ "settled_at": {
3758
+ "name": "settled_at",
3759
+ "type": "timestamp",
3760
+ "primaryKey": false,
3761
+ "notNull": false
3762
+ }
3763
+ },
3764
+ "indexes": {
3765
+ "workflow_run_dispatch_anchor_message_idx": {
3766
+ "name": "workflow_run_dispatch_anchor_message_idx",
3767
+ "columns": [
3768
+ {
3769
+ "expression": "anchor_run_id",
3770
+ "isExpression": false,
3771
+ "asc": true,
3772
+ "nulls": "last"
3773
+ },
3774
+ {
3775
+ "expression": "message_id",
3776
+ "isExpression": false,
3777
+ "asc": true,
3778
+ "nulls": "last"
3779
+ }
3780
+ ],
3781
+ "isUnique": true,
3782
+ "concurrently": false,
3783
+ "method": "btree",
3784
+ "with": {}
3785
+ },
3786
+ "workflow_run_dispatch_delivery_idx": {
3787
+ "name": "workflow_run_dispatch_delivery_idx",
3788
+ "columns": [
3789
+ {
3790
+ "expression": "next_attempt_at",
3791
+ "isExpression": false,
3792
+ "asc": true,
3793
+ "nulls": "last"
3794
+ },
3795
+ {
3796
+ "expression": "created_at",
3797
+ "isExpression": false,
3798
+ "asc": true,
3799
+ "nulls": "last"
3800
+ }
3801
+ ],
3802
+ "isUnique": false,
3803
+ "where": "\"workflow_run_dispatch\".\"status\" = 'pending'",
3804
+ "concurrently": false,
3805
+ "method": "btree",
3806
+ "with": {}
3807
+ },
3808
+ "workflow_run_dispatch_anchor_status_idx": {
3809
+ "name": "workflow_run_dispatch_anchor_status_idx",
3810
+ "columns": [
3811
+ {
3812
+ "expression": "anchor_run_id",
3813
+ "isExpression": false,
3814
+ "asc": true,
3815
+ "nulls": "last"
3816
+ },
3817
+ {
3818
+ "expression": "status",
3819
+ "isExpression": false,
3820
+ "asc": true,
3821
+ "nulls": "last"
3822
+ }
3823
+ ],
3824
+ "isUnique": false,
3825
+ "concurrently": false,
3826
+ "method": "btree",
3827
+ "with": {}
3828
+ }
3829
+ },
3830
+ "foreignKeys": {
3831
+ "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk": {
3832
+ "name": "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk",
3833
+ "tableFrom": "workflow_run_dispatch",
3834
+ "tableTo": "workflow_run",
3835
+ "columnsFrom": ["anchor_run_id"],
3836
+ "columnsTo": ["id"],
3837
+ "onDelete": "cascade",
3838
+ "onUpdate": "no action"
3839
+ }
3840
+ },
3841
+ "compositePrimaryKeys": {},
3842
+ "uniqueConstraints": {},
3843
+ "policies": {},
3844
+ "checkConstraints": {
3845
+ "workflow_run_dispatch_status_check": {
3846
+ "name": "workflow_run_dispatch_status_check",
3847
+ "value": "\"workflow_run_dispatch\".\"status\" in ('pending', 'acknowledged', 'settled', 'failed')"
3848
+ },
3849
+ "workflow_run_dispatch_kind_check": {
3850
+ "name": "workflow_run_dispatch_kind_check",
3851
+ "value": "\"workflow_run_dispatch\".\"kind\" in ('mail', 'signal')"
3852
+ },
3853
+ "workflow_run_dispatch_attempt_count_check": {
3854
+ "name": "workflow_run_dispatch_attempt_count_check",
3855
+ "value": "\"workflow_run_dispatch\".\"attempt_count\" >= 0"
3856
+ },
3857
+ "workflow_run_dispatch_acknowledged_generation_check": {
3858
+ "name": "workflow_run_dispatch_acknowledged_generation_check",
3859
+ "value": "\"workflow_run_dispatch\".\"acknowledged_generation\" is null or \"workflow_run_dispatch\".\"acknowledged_generation\" >= 0"
3860
+ },
3861
+ "workflow_run_dispatch_acknowledged_state_check": {
3862
+ "name": "workflow_run_dispatch_acknowledged_state_check",
3863
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'acknowledged' or \"workflow_run_dispatch\".\"acknowledged_generation\" is not null"
3864
+ },
3865
+ "workflow_run_dispatch_pending_schedule_check": {
3866
+ "name": "workflow_run_dispatch_pending_schedule_check",
3867
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'pending' or \"workflow_run_dispatch\".\"next_attempt_at\" is not null"
3868
+ }
3869
+ },
3870
+ "isRLSEnabled": false
3871
+ },
3872
+ "public.workflow_run_launch_spec": {
3873
+ "name": "workflow_run_launch_spec",
3874
+ "schema": "",
3875
+ "columns": {
3876
+ "anchor_run_id": {
3877
+ "name": "anchor_run_id",
3878
+ "type": "text",
3879
+ "primaryKey": true,
3880
+ "notNull": true
3881
+ },
3882
+ "schema_version": {
3883
+ "name": "schema_version",
3884
+ "type": "integer",
3885
+ "primaryKey": false,
3886
+ "notNull": true,
3887
+ "default": 1
3888
+ },
3889
+ "session_id": {
3890
+ "name": "session_id",
3891
+ "type": "text",
3892
+ "primaryKey": false,
3893
+ "notNull": true
3894
+ },
3895
+ "deployment_domain": {
3896
+ "name": "deployment_domain",
3897
+ "type": "text",
3898
+ "primaryKey": false,
3899
+ "notNull": true
3900
+ },
3901
+ "source_authority_principal_id": {
3902
+ "name": "source_authority_principal_id",
3903
+ "type": "text",
3904
+ "primaryKey": false,
3905
+ "notNull": true
3906
+ },
3907
+ "frozen_approval_bundle": {
3908
+ "name": "frozen_approval_bundle",
3909
+ "type": "jsonb",
3910
+ "primaryKey": false,
3911
+ "notNull": true
3912
+ },
3913
+ "source_offering_ids": {
3914
+ "name": "source_offering_ids",
3915
+ "type": "jsonb",
3916
+ "primaryKey": false,
3917
+ "notNull": true
3918
+ },
3919
+ "default_source_offering_id": {
3920
+ "name": "default_source_offering_id",
3921
+ "type": "text",
3922
+ "primaryKey": false,
3923
+ "notNull": true
3924
+ },
3925
+ "deploy_content": {
3926
+ "name": "deploy_content",
3927
+ "type": "jsonb",
3928
+ "primaryKey": false,
3929
+ "notNull": true
3930
+ },
3931
+ "tool_package_pins": {
3932
+ "name": "tool_package_pins",
3933
+ "type": "jsonb",
3934
+ "primaryKey": false,
3935
+ "notNull": false
3936
+ },
3937
+ "created_at": {
3938
+ "name": "created_at",
3939
+ "type": "timestamp",
3940
+ "primaryKey": false,
3941
+ "notNull": true,
3942
+ "default": "now()"
3943
+ }
3944
+ },
3945
+ "indexes": {},
3946
+ "foreignKeys": {
3947
+ "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk": {
3948
+ "name": "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk",
3949
+ "tableFrom": "workflow_run_launch_spec",
3950
+ "tableTo": "workflow_run",
3951
+ "columnsFrom": ["anchor_run_id"],
3952
+ "columnsTo": ["id"],
3953
+ "onDelete": "cascade",
3954
+ "onUpdate": "no action"
3955
+ },
3956
+ "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk": {
3957
+ "name": "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk",
3958
+ "tableFrom": "workflow_run_launch_spec",
3959
+ "tableTo": "principal",
3960
+ "columnsFrom": ["source_authority_principal_id"],
3961
+ "columnsTo": ["id"],
3962
+ "onDelete": "restrict",
3963
+ "onUpdate": "no action"
3964
+ }
3965
+ },
3966
+ "compositePrimaryKeys": {},
3967
+ "uniqueConstraints": {},
3968
+ "policies": {},
3969
+ "checkConstraints": {},
3970
+ "isRLSEnabled": false
3971
+ },
3972
+ "public.workflow_run_execution": {
3973
+ "name": "workflow_run_execution",
3974
+ "schema": "",
3975
+ "columns": {
3976
+ "id": {
3977
+ "name": "id",
3978
+ "type": "text",
3979
+ "primaryKey": true,
3980
+ "notNull": true
3981
+ },
3982
+ "run_id": {
3983
+ "name": "run_id",
3984
+ "type": "text",
3985
+ "primaryKey": false,
3986
+ "notNull": true
3987
+ },
3988
+ "message_id": {
3989
+ "name": "message_id",
3990
+ "type": "text",
3991
+ "primaryKey": false,
3992
+ "notNull": true
3993
+ },
3994
+ "status": {
3995
+ "name": "status",
3996
+ "type": "text",
3997
+ "primaryKey": false,
3998
+ "notNull": true,
3999
+ "default": "'running'"
4000
+ },
4001
+ "started_at": {
4002
+ "name": "started_at",
4003
+ "type": "timestamp",
4004
+ "primaryKey": false,
4005
+ "notNull": true,
4006
+ "default": "now()"
4007
+ },
4008
+ "ended_at": {
4009
+ "name": "ended_at",
4010
+ "type": "timestamp",
4011
+ "primaryKey": false,
4012
+ "notNull": false
4013
+ },
4014
+ "failure_reason": {
4015
+ "name": "failure_reason",
4016
+ "type": "text",
4017
+ "primaryKey": false,
4018
+ "notNull": false
4019
+ }
4020
+ },
4021
+ "indexes": {
4022
+ "workflow_run_execution_run_id_id_idx": {
4023
+ "name": "workflow_run_execution_run_id_id_idx",
4024
+ "columns": [
4025
+ {
4026
+ "expression": "run_id",
4027
+ "isExpression": false,
4028
+ "asc": true,
4029
+ "nulls": "last"
4030
+ },
4031
+ {
4032
+ "expression": "id",
4033
+ "isExpression": false,
4034
+ "asc": true,
4035
+ "nulls": "last"
4036
+ }
4037
+ ],
4038
+ "isUnique": true,
4039
+ "concurrently": false,
4040
+ "method": "btree",
4041
+ "with": {}
4042
+ },
4043
+ "workflow_run_execution_status_idx": {
4044
+ "name": "workflow_run_execution_status_idx",
4045
+ "columns": [
4046
+ {
4047
+ "expression": "status",
4048
+ "isExpression": false,
4049
+ "asc": true,
4050
+ "nulls": "last"
4051
+ }
4052
+ ],
4053
+ "isUnique": false,
4054
+ "concurrently": false,
4055
+ "method": "btree",
4056
+ "with": {}
4057
+ }
4058
+ },
4059
+ "foreignKeys": {
4060
+ "workflow_run_execution_run_id_workflow_run_id_fk": {
4061
+ "name": "workflow_run_execution_run_id_workflow_run_id_fk",
4062
+ "tableFrom": "workflow_run_execution",
4063
+ "tableTo": "workflow_run",
4064
+ "columnsFrom": ["run_id"],
4065
+ "columnsTo": ["id"],
4066
+ "onDelete": "cascade",
4067
+ "onUpdate": "no action"
4068
+ }
4069
+ },
4070
+ "compositePrimaryKeys": {},
4071
+ "uniqueConstraints": {},
4072
+ "policies": {},
4073
+ "checkConstraints": {},
4074
+ "isRLSEnabled": false
4075
+ },
4076
+ "public.workflow_probe": {
4077
+ "name": "workflow_probe",
4078
+ "schema": "",
4079
+ "columns": {
4080
+ "id": {
4081
+ "name": "id",
4082
+ "type": "text",
4083
+ "primaryKey": true,
4084
+ "notNull": true
4085
+ },
4086
+ "tenant_id": {
4087
+ "name": "tenant_id",
4088
+ "type": "text",
4089
+ "primaryKey": false,
4090
+ "notNull": true
4091
+ },
4092
+ "definition_asset_id": {
4093
+ "name": "definition_asset_id",
4094
+ "type": "text",
4095
+ "primaryKey": false,
4096
+ "notNull": true
4097
+ },
4098
+ "source": {
4099
+ "name": "source",
4100
+ "type": "jsonb",
4101
+ "primaryKey": false,
4102
+ "notNull": true
4103
+ },
4104
+ "entry": {
4105
+ "name": "entry",
4106
+ "type": "text",
4107
+ "primaryKey": false,
4108
+ "notNull": true
4109
+ },
4110
+ "pin": {
4111
+ "name": "pin",
4112
+ "type": "text",
4113
+ "primaryKey": false,
4114
+ "notNull": false
4115
+ },
4116
+ "status": {
4117
+ "name": "status",
4118
+ "type": "text",
4119
+ "primaryKey": false,
4120
+ "notNull": true,
4121
+ "default": "'pending'"
4122
+ },
4123
+ "provisioner_id": {
4124
+ "name": "provisioner_id",
4125
+ "type": "text",
4126
+ "primaryKey": false,
4127
+ "notNull": true
4128
+ },
4129
+ "provisioner_api_version": {
4130
+ "name": "provisioner_api_version",
4131
+ "type": "integer",
4132
+ "primaryKey": false,
4133
+ "notNull": true
4134
+ },
4135
+ "provisioner_binding_fingerprint": {
4136
+ "name": "provisioner_binding_fingerprint",
4137
+ "type": "text",
4138
+ "primaryKey": false,
4139
+ "notNull": true
4140
+ },
4141
+ "sidecar_id": {
4142
+ "name": "sidecar_id",
4143
+ "type": "text",
4144
+ "primaryKey": false,
4145
+ "notNull": false
4146
+ },
4147
+ "generation": {
4148
+ "name": "generation",
4149
+ "type": "integer",
4150
+ "primaryKey": false,
4151
+ "notNull": true,
4152
+ "default": 0
4153
+ },
4154
+ "external_ref": {
4155
+ "name": "external_ref",
4156
+ "type": "text",
4157
+ "primaryKey": false,
4158
+ "notNull": false
4159
+ },
4160
+ "result": {
4161
+ "name": "result",
4162
+ "type": "jsonb",
4163
+ "primaryKey": false,
4164
+ "notNull": false
4165
+ },
4166
+ "failure_code": {
4167
+ "name": "failure_code",
4168
+ "type": "text",
4169
+ "primaryKey": false,
4170
+ "notNull": false
4171
+ },
4172
+ "failure_message": {
4173
+ "name": "failure_message",
4174
+ "type": "text",
4175
+ "primaryKey": false,
4176
+ "notNull": false
4177
+ },
4178
+ "created_at": {
4179
+ "name": "created_at",
4180
+ "type": "timestamp",
4181
+ "primaryKey": false,
4182
+ "notNull": true,
4183
+ "default": "now()"
4184
+ },
4185
+ "updated_at": {
4186
+ "name": "updated_at",
4187
+ "type": "timestamp",
4188
+ "primaryKey": false,
4189
+ "notNull": true,
4190
+ "default": "now()"
4191
+ }
4192
+ },
4193
+ "indexes": {
4194
+ "workflow_probe_active_idx": {
4195
+ "name": "workflow_probe_active_idx",
4196
+ "columns": [
4197
+ {
4198
+ "expression": "created_at",
4199
+ "isExpression": false,
4200
+ "asc": true,
4201
+ "nulls": "last"
4202
+ }
4203
+ ],
4204
+ "isUnique": false,
4205
+ "where": "\"workflow_probe\".\"status\" in ('pending', 'provisioning', 'probing', 'releasing')",
4206
+ "concurrently": false,
4207
+ "method": "btree",
4208
+ "with": {}
4209
+ },
4210
+ "workflow_probe_sidecar_idx": {
4211
+ "name": "workflow_probe_sidecar_idx",
4212
+ "columns": [
4213
+ {
4214
+ "expression": "sidecar_id",
4215
+ "isExpression": false,
4216
+ "asc": true,
4217
+ "nulls": "last"
4218
+ }
4219
+ ],
4220
+ "isUnique": false,
4221
+ "concurrently": false,
4222
+ "method": "btree",
4223
+ "with": {}
4224
+ }
4225
+ },
4226
+ "foreignKeys": {
4227
+ "workflow_probe_tenant_id_tenant_id_fk": {
4228
+ "name": "workflow_probe_tenant_id_tenant_id_fk",
4229
+ "tableFrom": "workflow_probe",
4230
+ "tableTo": "tenant",
4231
+ "columnsFrom": ["tenant_id"],
4232
+ "columnsTo": ["id"],
4233
+ "onDelete": "restrict",
4234
+ "onUpdate": "no action"
4235
+ },
4236
+ "workflow_probe_definition_asset_id_asset_id_fk": {
4237
+ "name": "workflow_probe_definition_asset_id_asset_id_fk",
4238
+ "tableFrom": "workflow_probe",
4239
+ "tableTo": "asset",
4240
+ "columnsFrom": ["definition_asset_id"],
4241
+ "columnsTo": ["id"],
4242
+ "onDelete": "restrict",
4243
+ "onUpdate": "no action"
4244
+ },
4245
+ "workflow_probe_sidecar_id_sidecar_id_fk": {
4246
+ "name": "workflow_probe_sidecar_id_sidecar_id_fk",
4247
+ "tableFrom": "workflow_probe",
4248
+ "tableTo": "sidecar",
4249
+ "columnsFrom": ["sidecar_id"],
4250
+ "columnsTo": ["id"],
4251
+ "onDelete": "restrict",
4252
+ "onUpdate": "no action"
4253
+ }
4254
+ },
4255
+ "compositePrimaryKeys": {},
4256
+ "uniqueConstraints": {},
4257
+ "policies": {},
4258
+ "checkConstraints": {
4259
+ "workflow_probe_status_check": {
4260
+ "name": "workflow_probe_status_check",
4261
+ "value": "\"workflow_probe\".\"status\" in ('pending', 'provisioning', 'probing', 'releasing', 'succeeded', 'failed')"
4262
+ },
4263
+ "workflow_probe_succeeded_result_check": {
4264
+ "name": "workflow_probe_succeeded_result_check",
4265
+ "value": "\"workflow_probe\".\"status\" <> 'succeeded' or \"workflow_probe\".\"result\" is not null"
4266
+ },
4267
+ "workflow_probe_generation_check": {
4268
+ "name": "workflow_probe_generation_check",
4269
+ "value": "\"workflow_probe\".\"generation\" >= 0"
4270
+ }
4271
+ },
4272
+ "isRLSEnabled": false
4273
+ }
4274
+ },
4275
+ "enums": {},
4276
+ "schemas": {},
4277
+ "sequences": {},
4278
+ "roles": {},
4279
+ "policies": {},
4280
+ "views": {},
4281
+ "_meta": {
4282
+ "columns": {},
4283
+ "schemas": {},
4284
+ "tables": {}
4285
+ }
4286
+ }