@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,4376 @@
1
+ {
2
+ "id": "29cab816-ceea-4770-a010-9e3a1b28d2dc",
3
+ "prevId": "bdac2dcb-57fe-4ec7-a524-42a2bbe2bc0d",
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.principal_key": {
531
+ "name": "principal_key",
532
+ "schema": "",
533
+ "columns": {
534
+ "id": {
535
+ "name": "id",
536
+ "type": "text",
537
+ "primaryKey": true,
538
+ "notNull": true
539
+ },
540
+ "principal_id": {
541
+ "name": "principal_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "public_key": {
547
+ "name": "public_key",
548
+ "type": "text",
549
+ "primaryKey": false,
550
+ "notNull": true
551
+ },
552
+ "private_key": {
553
+ "name": "private_key",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true
557
+ },
558
+ "status": {
559
+ "name": "status",
560
+ "type": "text",
561
+ "primaryKey": false,
562
+ "notNull": true
563
+ },
564
+ "created_at": {
565
+ "name": "created_at",
566
+ "type": "timestamp",
567
+ "primaryKey": false,
568
+ "notNull": true,
569
+ "default": "now()"
570
+ },
571
+ "updated_at": {
572
+ "name": "updated_at",
573
+ "type": "timestamp",
574
+ "primaryKey": false,
575
+ "notNull": true,
576
+ "default": "now()"
577
+ }
578
+ },
579
+ "indexes": {
580
+ "principal_key_one_active": {
581
+ "name": "principal_key_one_active",
582
+ "columns": [
583
+ {
584
+ "expression": "principal_id",
585
+ "isExpression": false,
586
+ "asc": true,
587
+ "nulls": "last"
588
+ }
589
+ ],
590
+ "isUnique": true,
591
+ "where": "\"principal_key\".\"status\" = 'active'",
592
+ "concurrently": false,
593
+ "method": "btree",
594
+ "with": {}
595
+ }
596
+ },
597
+ "foreignKeys": {
598
+ "principal_key_principal_id_principal_id_fk": {
599
+ "name": "principal_key_principal_id_principal_id_fk",
600
+ "tableFrom": "principal_key",
601
+ "tableTo": "principal",
602
+ "columnsFrom": ["principal_id"],
603
+ "columnsTo": ["id"],
604
+ "onDelete": "cascade",
605
+ "onUpdate": "no action"
606
+ }
607
+ },
608
+ "compositePrimaryKeys": {},
609
+ "uniqueConstraints": {
610
+ "principal_key_public_key_unique": {
611
+ "name": "principal_key_public_key_unique",
612
+ "nullsNotDistinct": false,
613
+ "columns": ["public_key"]
614
+ }
615
+ },
616
+ "policies": {},
617
+ "checkConstraints": {},
618
+ "isRLSEnabled": false
619
+ },
620
+ "public.agent_role": {
621
+ "name": "agent_role",
622
+ "schema": "",
623
+ "columns": {
624
+ "agent_id": {
625
+ "name": "agent_id",
626
+ "type": "text",
627
+ "primaryKey": false,
628
+ "notNull": true
629
+ },
630
+ "role_id": {
631
+ "name": "role_id",
632
+ "type": "text",
633
+ "primaryKey": false,
634
+ "notNull": true
635
+ },
636
+ "created_at": {
637
+ "name": "created_at",
638
+ "type": "timestamp",
639
+ "primaryKey": false,
640
+ "notNull": true,
641
+ "default": "now()"
642
+ }
643
+ },
644
+ "indexes": {},
645
+ "foreignKeys": {
646
+ "agent_role_agent_id_workflow_definition_id_fk": {
647
+ "name": "agent_role_agent_id_workflow_definition_id_fk",
648
+ "tableFrom": "agent_role",
649
+ "tableTo": "workflow_definition",
650
+ "columnsFrom": ["agent_id"],
651
+ "columnsTo": ["id"],
652
+ "onDelete": "cascade",
653
+ "onUpdate": "no action"
654
+ },
655
+ "agent_role_role_id_role_id_fk": {
656
+ "name": "agent_role_role_id_role_id_fk",
657
+ "tableFrom": "agent_role",
658
+ "tableTo": "role",
659
+ "columnsFrom": ["role_id"],
660
+ "columnsTo": ["id"],
661
+ "onDelete": "cascade",
662
+ "onUpdate": "no action"
663
+ }
664
+ },
665
+ "compositePrimaryKeys": {
666
+ "agent_role_agent_id_role_id_pk": {
667
+ "name": "agent_role_agent_id_role_id_pk",
668
+ "columns": ["agent_id", "role_id"]
669
+ }
670
+ },
671
+ "uniqueConstraints": {},
672
+ "policies": {},
673
+ "checkConstraints": {},
674
+ "isRLSEnabled": false
675
+ },
676
+ "public.principal_role": {
677
+ "name": "principal_role",
678
+ "schema": "",
679
+ "columns": {
680
+ "principal_id": {
681
+ "name": "principal_id",
682
+ "type": "text",
683
+ "primaryKey": false,
684
+ "notNull": true
685
+ },
686
+ "role_id": {
687
+ "name": "role_id",
688
+ "type": "text",
689
+ "primaryKey": false,
690
+ "notNull": true
691
+ },
692
+ "created_at": {
693
+ "name": "created_at",
694
+ "type": "timestamp",
695
+ "primaryKey": false,
696
+ "notNull": true,
697
+ "default": "now()"
698
+ }
699
+ },
700
+ "indexes": {},
701
+ "foreignKeys": {
702
+ "principal_role_principal_id_principal_id_fk": {
703
+ "name": "principal_role_principal_id_principal_id_fk",
704
+ "tableFrom": "principal_role",
705
+ "tableTo": "principal",
706
+ "columnsFrom": ["principal_id"],
707
+ "columnsTo": ["id"],
708
+ "onDelete": "cascade",
709
+ "onUpdate": "no action"
710
+ },
711
+ "principal_role_role_id_role_id_fk": {
712
+ "name": "principal_role_role_id_role_id_fk",
713
+ "tableFrom": "principal_role",
714
+ "tableTo": "role",
715
+ "columnsFrom": ["role_id"],
716
+ "columnsTo": ["id"],
717
+ "onDelete": "cascade",
718
+ "onUpdate": "no action"
719
+ }
720
+ },
721
+ "compositePrimaryKeys": {
722
+ "principal_role_principal_id_role_id_pk": {
723
+ "name": "principal_role_principal_id_role_id_pk",
724
+ "columns": ["principal_id", "role_id"]
725
+ }
726
+ },
727
+ "uniqueConstraints": {},
728
+ "policies": {},
729
+ "checkConstraints": {},
730
+ "isRLSEnabled": false
731
+ },
732
+ "public.role": {
733
+ "name": "role",
734
+ "schema": "",
735
+ "columns": {
736
+ "id": {
737
+ "name": "id",
738
+ "type": "text",
739
+ "primaryKey": true,
740
+ "notNull": true
741
+ },
742
+ "tenant_id": {
743
+ "name": "tenant_id",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true
747
+ },
748
+ "name": {
749
+ "name": "name",
750
+ "type": "text",
751
+ "primaryKey": false,
752
+ "notNull": true
753
+ },
754
+ "description": {
755
+ "name": "description",
756
+ "type": "text",
757
+ "primaryKey": false,
758
+ "notNull": false
759
+ },
760
+ "is_system": {
761
+ "name": "is_system",
762
+ "type": "boolean",
763
+ "primaryKey": false,
764
+ "notNull": true,
765
+ "default": false
766
+ },
767
+ "created_at": {
768
+ "name": "created_at",
769
+ "type": "timestamp",
770
+ "primaryKey": false,
771
+ "notNull": true,
772
+ "default": "now()"
773
+ },
774
+ "updated_at": {
775
+ "name": "updated_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ }
781
+ },
782
+ "indexes": {},
783
+ "foreignKeys": {
784
+ "role_tenant_id_tenant_id_fk": {
785
+ "name": "role_tenant_id_tenant_id_fk",
786
+ "tableFrom": "role",
787
+ "tableTo": "tenant",
788
+ "columnsFrom": ["tenant_id"],
789
+ "columnsTo": ["id"],
790
+ "onDelete": "cascade",
791
+ "onUpdate": "no action"
792
+ }
793
+ },
794
+ "compositePrimaryKeys": {},
795
+ "uniqueConstraints": {},
796
+ "policies": {},
797
+ "checkConstraints": {},
798
+ "isRLSEnabled": false
799
+ },
800
+ "public.grant": {
801
+ "name": "grant",
802
+ "schema": "",
803
+ "columns": {
804
+ "id": {
805
+ "name": "id",
806
+ "type": "text",
807
+ "primaryKey": true,
808
+ "notNull": true
809
+ },
810
+ "tenant_id": {
811
+ "name": "tenant_id",
812
+ "type": "text",
813
+ "primaryKey": false,
814
+ "notNull": true
815
+ },
816
+ "role_id": {
817
+ "name": "role_id",
818
+ "type": "text",
819
+ "primaryKey": false,
820
+ "notNull": false
821
+ },
822
+ "principal_id": {
823
+ "name": "principal_id",
824
+ "type": "text",
825
+ "primaryKey": false,
826
+ "notNull": false
827
+ },
828
+ "resource": {
829
+ "name": "resource",
830
+ "type": "text",
831
+ "primaryKey": false,
832
+ "notNull": true
833
+ },
834
+ "action": {
835
+ "name": "action",
836
+ "type": "text",
837
+ "primaryKey": false,
838
+ "notNull": true
839
+ },
840
+ "effect": {
841
+ "name": "effect",
842
+ "type": "text",
843
+ "primaryKey": false,
844
+ "notNull": true
845
+ },
846
+ "conditions": {
847
+ "name": "conditions",
848
+ "type": "jsonb",
849
+ "primaryKey": false,
850
+ "notNull": false
851
+ },
852
+ "origin": {
853
+ "name": "origin",
854
+ "type": "text",
855
+ "primaryKey": false,
856
+ "notNull": true
857
+ },
858
+ "expires_at": {
859
+ "name": "expires_at",
860
+ "type": "timestamp",
861
+ "primaryKey": false,
862
+ "notNull": false
863
+ },
864
+ "created_at": {
865
+ "name": "created_at",
866
+ "type": "timestamp",
867
+ "primaryKey": false,
868
+ "notNull": true,
869
+ "default": "now()"
870
+ },
871
+ "updated_at": {
872
+ "name": "updated_at",
873
+ "type": "timestamp",
874
+ "primaryKey": false,
875
+ "notNull": true,
876
+ "default": "now()"
877
+ }
878
+ },
879
+ "indexes": {},
880
+ "foreignKeys": {
881
+ "grant_tenant_id_tenant_id_fk": {
882
+ "name": "grant_tenant_id_tenant_id_fk",
883
+ "tableFrom": "grant",
884
+ "tableTo": "tenant",
885
+ "columnsFrom": ["tenant_id"],
886
+ "columnsTo": ["id"],
887
+ "onDelete": "cascade",
888
+ "onUpdate": "no action"
889
+ },
890
+ "grant_role_id_role_id_fk": {
891
+ "name": "grant_role_id_role_id_fk",
892
+ "tableFrom": "grant",
893
+ "tableTo": "role",
894
+ "columnsFrom": ["role_id"],
895
+ "columnsTo": ["id"],
896
+ "onDelete": "cascade",
897
+ "onUpdate": "no action"
898
+ },
899
+ "grant_principal_id_principal_id_fk": {
900
+ "name": "grant_principal_id_principal_id_fk",
901
+ "tableFrom": "grant",
902
+ "tableTo": "principal",
903
+ "columnsFrom": ["principal_id"],
904
+ "columnsTo": ["id"],
905
+ "onDelete": "cascade",
906
+ "onUpdate": "no action"
907
+ }
908
+ },
909
+ "compositePrimaryKeys": {},
910
+ "uniqueConstraints": {},
911
+ "policies": {},
912
+ "checkConstraints": {
913
+ "grant_target_exactly_one": {
914
+ "name": "grant_target_exactly_one",
915
+ "value": "num_nonnulls(\"grant\".\"principal_id\", \"grant\".\"role_id\") = 1"
916
+ }
917
+ },
918
+ "isRLSEnabled": false
919
+ },
920
+ "public.approval": {
921
+ "name": "approval",
922
+ "schema": "",
923
+ "columns": {
924
+ "id": {
925
+ "name": "id",
926
+ "type": "text",
927
+ "primaryKey": true,
928
+ "notNull": true
929
+ },
930
+ "tenant_id": {
931
+ "name": "tenant_id",
932
+ "type": "text",
933
+ "primaryKey": false,
934
+ "notNull": true
935
+ },
936
+ "anchor_run_id": {
937
+ "name": "anchor_run_id",
938
+ "type": "text",
939
+ "primaryKey": false,
940
+ "notNull": true
941
+ },
942
+ "run_id": {
943
+ "name": "run_id",
944
+ "type": "text",
945
+ "primaryKey": false,
946
+ "notNull": true
947
+ },
948
+ "agent_address": {
949
+ "name": "agent_address",
950
+ "type": "text",
951
+ "primaryKey": false,
952
+ "notNull": true
953
+ },
954
+ "correlation_id": {
955
+ "name": "correlation_id",
956
+ "type": "text",
957
+ "primaryKey": false,
958
+ "notNull": true
959
+ },
960
+ "tool_definition": {
961
+ "name": "tool_definition",
962
+ "type": "jsonb",
963
+ "primaryKey": false,
964
+ "notNull": true
965
+ },
966
+ "tool_arguments": {
967
+ "name": "tool_arguments",
968
+ "type": "jsonb",
969
+ "primaryKey": false,
970
+ "notNull": true
971
+ },
972
+ "scope": {
973
+ "name": "scope",
974
+ "type": "text",
975
+ "primaryKey": false,
976
+ "notNull": false
977
+ },
978
+ "status": {
979
+ "name": "status",
980
+ "type": "text",
981
+ "primaryKey": false,
982
+ "notNull": true,
983
+ "default": "'pending'"
984
+ },
985
+ "timeout_at": {
986
+ "name": "timeout_at",
987
+ "type": "timestamp",
988
+ "primaryKey": false,
989
+ "notNull": false
990
+ },
991
+ "resolved_at": {
992
+ "name": "resolved_at",
993
+ "type": "timestamp",
994
+ "primaryKey": false,
995
+ "notNull": false
996
+ },
997
+ "created_at": {
998
+ "name": "created_at",
999
+ "type": "timestamp",
1000
+ "primaryKey": false,
1001
+ "notNull": true,
1002
+ "default": "now()"
1003
+ },
1004
+ "updated_at": {
1005
+ "name": "updated_at",
1006
+ "type": "timestamp",
1007
+ "primaryKey": false,
1008
+ "notNull": true,
1009
+ "default": "now()"
1010
+ }
1011
+ },
1012
+ "indexes": {
1013
+ "approval_tenant_status_idx": {
1014
+ "name": "approval_tenant_status_idx",
1015
+ "columns": [
1016
+ {
1017
+ "expression": "tenant_id",
1018
+ "isExpression": false,
1019
+ "asc": true,
1020
+ "nulls": "last"
1021
+ },
1022
+ {
1023
+ "expression": "status",
1024
+ "isExpression": false,
1025
+ "asc": true,
1026
+ "nulls": "last"
1027
+ },
1028
+ {
1029
+ "expression": "created_at",
1030
+ "isExpression": false,
1031
+ "asc": true,
1032
+ "nulls": "last"
1033
+ }
1034
+ ],
1035
+ "isUnique": false,
1036
+ "concurrently": false,
1037
+ "method": "btree",
1038
+ "with": {}
1039
+ },
1040
+ "approval_anchor_run_idx": {
1041
+ "name": "approval_anchor_run_idx",
1042
+ "columns": [
1043
+ {
1044
+ "expression": "anchor_run_id",
1045
+ "isExpression": false,
1046
+ "asc": true,
1047
+ "nulls": "last"
1048
+ }
1049
+ ],
1050
+ "isUnique": false,
1051
+ "concurrently": false,
1052
+ "method": "btree",
1053
+ "with": {}
1054
+ },
1055
+ "approval_run_idx": {
1056
+ "name": "approval_run_idx",
1057
+ "columns": [
1058
+ {
1059
+ "expression": "run_id",
1060
+ "isExpression": false,
1061
+ "asc": true,
1062
+ "nulls": "last"
1063
+ }
1064
+ ],
1065
+ "isUnique": false,
1066
+ "concurrently": false,
1067
+ "method": "btree",
1068
+ "with": {}
1069
+ }
1070
+ },
1071
+ "foreignKeys": {
1072
+ "approval_tenant_id_tenant_id_fk": {
1073
+ "name": "approval_tenant_id_tenant_id_fk",
1074
+ "tableFrom": "approval",
1075
+ "tableTo": "tenant",
1076
+ "columnsFrom": ["tenant_id"],
1077
+ "columnsTo": ["id"],
1078
+ "onDelete": "cascade",
1079
+ "onUpdate": "no action"
1080
+ },
1081
+ "approval_anchor_run_id_workflow_run_id_fk": {
1082
+ "name": "approval_anchor_run_id_workflow_run_id_fk",
1083
+ "tableFrom": "approval",
1084
+ "tableTo": "workflow_run",
1085
+ "columnsFrom": ["anchor_run_id"],
1086
+ "columnsTo": ["id"],
1087
+ "onDelete": "cascade",
1088
+ "onUpdate": "no action"
1089
+ },
1090
+ "approval_run_id_workflow_run_id_fk": {
1091
+ "name": "approval_run_id_workflow_run_id_fk",
1092
+ "tableFrom": "approval",
1093
+ "tableTo": "workflow_run",
1094
+ "columnsFrom": ["run_id"],
1095
+ "columnsTo": ["id"],
1096
+ "onDelete": "cascade",
1097
+ "onUpdate": "no action"
1098
+ }
1099
+ },
1100
+ "compositePrimaryKeys": {},
1101
+ "uniqueConstraints": {
1102
+ "approval_correlation_id_unique": {
1103
+ "name": "approval_correlation_id_unique",
1104
+ "nullsNotDistinct": false,
1105
+ "columns": ["correlation_id"]
1106
+ }
1107
+ },
1108
+ "policies": {},
1109
+ "checkConstraints": {},
1110
+ "isRLSEnabled": false
1111
+ },
1112
+ "public.signal_correlation": {
1113
+ "name": "signal_correlation",
1114
+ "schema": "",
1115
+ "columns": {
1116
+ "correlation_id": {
1117
+ "name": "correlation_id",
1118
+ "type": "text",
1119
+ "primaryKey": true,
1120
+ "notNull": true
1121
+ },
1122
+ "tenant_id": {
1123
+ "name": "tenant_id",
1124
+ "type": "text",
1125
+ "primaryKey": false,
1126
+ "notNull": true
1127
+ },
1128
+ "anchor_run_id": {
1129
+ "name": "anchor_run_id",
1130
+ "type": "text",
1131
+ "primaryKey": false,
1132
+ "notNull": true
1133
+ },
1134
+ "agent_address": {
1135
+ "name": "agent_address",
1136
+ "type": "text",
1137
+ "primaryKey": false,
1138
+ "notNull": true
1139
+ },
1140
+ "run_id": {
1141
+ "name": "run_id",
1142
+ "type": "text",
1143
+ "primaryKey": false,
1144
+ "notNull": true
1145
+ },
1146
+ "signal_name": {
1147
+ "name": "signal_name",
1148
+ "type": "text",
1149
+ "primaryKey": false,
1150
+ "notNull": true
1151
+ },
1152
+ "kind": {
1153
+ "name": "kind",
1154
+ "type": "text",
1155
+ "primaryKey": false,
1156
+ "notNull": true
1157
+ },
1158
+ "signal_id": {
1159
+ "name": "signal_id",
1160
+ "type": "text",
1161
+ "primaryKey": false,
1162
+ "notNull": false
1163
+ },
1164
+ "resolved_at": {
1165
+ "name": "resolved_at",
1166
+ "type": "timestamp",
1167
+ "primaryKey": false,
1168
+ "notNull": false
1169
+ },
1170
+ "created_at": {
1171
+ "name": "created_at",
1172
+ "type": "timestamp",
1173
+ "primaryKey": false,
1174
+ "notNull": true,
1175
+ "default": "now()"
1176
+ }
1177
+ },
1178
+ "indexes": {},
1179
+ "foreignKeys": {
1180
+ "signal_correlation_tenant_id_tenant_id_fk": {
1181
+ "name": "signal_correlation_tenant_id_tenant_id_fk",
1182
+ "tableFrom": "signal_correlation",
1183
+ "tableTo": "tenant",
1184
+ "columnsFrom": ["tenant_id"],
1185
+ "columnsTo": ["id"],
1186
+ "onDelete": "cascade",
1187
+ "onUpdate": "no action"
1188
+ },
1189
+ "signal_correlation_anchor_run_id_workflow_run_id_fk": {
1190
+ "name": "signal_correlation_anchor_run_id_workflow_run_id_fk",
1191
+ "tableFrom": "signal_correlation",
1192
+ "tableTo": "workflow_run",
1193
+ "columnsFrom": ["anchor_run_id"],
1194
+ "columnsTo": ["id"],
1195
+ "onDelete": "cascade",
1196
+ "onUpdate": "no action"
1197
+ },
1198
+ "signal_correlation_run_id_workflow_run_id_fk": {
1199
+ "name": "signal_correlation_run_id_workflow_run_id_fk",
1200
+ "tableFrom": "signal_correlation",
1201
+ "tableTo": "workflow_run",
1202
+ "columnsFrom": ["run_id"],
1203
+ "columnsTo": ["id"],
1204
+ "onDelete": "cascade",
1205
+ "onUpdate": "no action"
1206
+ }
1207
+ },
1208
+ "compositePrimaryKeys": {},
1209
+ "uniqueConstraints": {},
1210
+ "policies": {},
1211
+ "checkConstraints": {},
1212
+ "isRLSEnabled": false
1213
+ },
1214
+ "public.provider": {
1215
+ "name": "provider",
1216
+ "schema": "",
1217
+ "columns": {
1218
+ "id": {
1219
+ "name": "id",
1220
+ "type": "text",
1221
+ "primaryKey": true,
1222
+ "notNull": true
1223
+ },
1224
+ "tenant_id": {
1225
+ "name": "tenant_id",
1226
+ "type": "text",
1227
+ "primaryKey": false,
1228
+ "notNull": true
1229
+ },
1230
+ "name": {
1231
+ "name": "name",
1232
+ "type": "text",
1233
+ "primaryKey": false,
1234
+ "notNull": true
1235
+ },
1236
+ "plugin": {
1237
+ "name": "plugin",
1238
+ "type": "text",
1239
+ "primaryKey": false,
1240
+ "notNull": true
1241
+ },
1242
+ "api_base_url": {
1243
+ "name": "api_base_url",
1244
+ "type": "text",
1245
+ "primaryKey": false,
1246
+ "notNull": false
1247
+ },
1248
+ "authorization_url": {
1249
+ "name": "authorization_url",
1250
+ "type": "text",
1251
+ "primaryKey": false,
1252
+ "notNull": false
1253
+ },
1254
+ "token_url": {
1255
+ "name": "token_url",
1256
+ "type": "text",
1257
+ "primaryKey": false,
1258
+ "notNull": false
1259
+ },
1260
+ "user_info_url": {
1261
+ "name": "user_info_url",
1262
+ "type": "text",
1263
+ "primaryKey": false,
1264
+ "notNull": false
1265
+ },
1266
+ "scopes": {
1267
+ "name": "scopes",
1268
+ "type": "text[]",
1269
+ "primaryKey": false,
1270
+ "notNull": false
1271
+ },
1272
+ "metadata": {
1273
+ "name": "metadata",
1274
+ "type": "jsonb",
1275
+ "primaryKey": false,
1276
+ "notNull": false
1277
+ },
1278
+ "created_at": {
1279
+ "name": "created_at",
1280
+ "type": "timestamp",
1281
+ "primaryKey": false,
1282
+ "notNull": true,
1283
+ "default": "now()"
1284
+ },
1285
+ "updated_at": {
1286
+ "name": "updated_at",
1287
+ "type": "timestamp",
1288
+ "primaryKey": false,
1289
+ "notNull": true,
1290
+ "default": "now()"
1291
+ }
1292
+ },
1293
+ "indexes": {},
1294
+ "foreignKeys": {
1295
+ "provider_tenant_id_tenant_id_fk": {
1296
+ "name": "provider_tenant_id_tenant_id_fk",
1297
+ "tableFrom": "provider",
1298
+ "tableTo": "tenant",
1299
+ "columnsFrom": ["tenant_id"],
1300
+ "columnsTo": ["id"],
1301
+ "onDelete": "cascade",
1302
+ "onUpdate": "no action"
1303
+ }
1304
+ },
1305
+ "compositePrimaryKeys": {},
1306
+ "uniqueConstraints": {
1307
+ "provider_tenant_name": {
1308
+ "name": "provider_tenant_name",
1309
+ "nullsNotDistinct": false,
1310
+ "columns": ["tenant_id", "name"]
1311
+ }
1312
+ },
1313
+ "policies": {},
1314
+ "checkConstraints": {},
1315
+ "isRLSEnabled": false
1316
+ },
1317
+ "public.oauth_client": {
1318
+ "name": "oauth_client",
1319
+ "schema": "",
1320
+ "columns": {
1321
+ "id": {
1322
+ "name": "id",
1323
+ "type": "text",
1324
+ "primaryKey": true,
1325
+ "notNull": true
1326
+ },
1327
+ "tenant_id": {
1328
+ "name": "tenant_id",
1329
+ "type": "text",
1330
+ "primaryKey": false,
1331
+ "notNull": true
1332
+ },
1333
+ "provider_id": {
1334
+ "name": "provider_id",
1335
+ "type": "text",
1336
+ "primaryKey": false,
1337
+ "notNull": true
1338
+ },
1339
+ "name": {
1340
+ "name": "name",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": true
1344
+ },
1345
+ "client_id": {
1346
+ "name": "client_id",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "client_secret": {
1352
+ "name": "client_secret",
1353
+ "type": "text",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "redirect_uris": {
1358
+ "name": "redirect_uris",
1359
+ "type": "text[]",
1360
+ "primaryKey": false,
1361
+ "notNull": false
1362
+ },
1363
+ "default_scopes": {
1364
+ "name": "default_scopes",
1365
+ "type": "text[]",
1366
+ "primaryKey": false,
1367
+ "notNull": false
1368
+ },
1369
+ "metadata": {
1370
+ "name": "metadata",
1371
+ "type": "jsonb",
1372
+ "primaryKey": false,
1373
+ "notNull": false
1374
+ },
1375
+ "created_at": {
1376
+ "name": "created_at",
1377
+ "type": "timestamp",
1378
+ "primaryKey": false,
1379
+ "notNull": true,
1380
+ "default": "now()"
1381
+ },
1382
+ "updated_at": {
1383
+ "name": "updated_at",
1384
+ "type": "timestamp",
1385
+ "primaryKey": false,
1386
+ "notNull": true,
1387
+ "default": "now()"
1388
+ }
1389
+ },
1390
+ "indexes": {},
1391
+ "foreignKeys": {
1392
+ "oauth_client_tenant_id_tenant_id_fk": {
1393
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1394
+ "tableFrom": "oauth_client",
1395
+ "tableTo": "tenant",
1396
+ "columnsFrom": ["tenant_id"],
1397
+ "columnsTo": ["id"],
1398
+ "onDelete": "cascade",
1399
+ "onUpdate": "no action"
1400
+ },
1401
+ "oauth_client_provider_id_provider_id_fk": {
1402
+ "name": "oauth_client_provider_id_provider_id_fk",
1403
+ "tableFrom": "oauth_client",
1404
+ "tableTo": "provider",
1405
+ "columnsFrom": ["provider_id"],
1406
+ "columnsTo": ["id"],
1407
+ "onDelete": "cascade",
1408
+ "onUpdate": "no action"
1409
+ }
1410
+ },
1411
+ "compositePrimaryKeys": {},
1412
+ "uniqueConstraints": {
1413
+ "oauth_client_tenant_provider": {
1414
+ "name": "oauth_client_tenant_provider",
1415
+ "nullsNotDistinct": false,
1416
+ "columns": ["tenant_id", "provider_id"]
1417
+ }
1418
+ },
1419
+ "policies": {},
1420
+ "checkConstraints": {},
1421
+ "isRLSEnabled": false
1422
+ },
1423
+ "public.credential": {
1424
+ "name": "credential",
1425
+ "schema": "",
1426
+ "columns": {
1427
+ "id": {
1428
+ "name": "id",
1429
+ "type": "text",
1430
+ "primaryKey": true,
1431
+ "notNull": true
1432
+ },
1433
+ "tenant_id": {
1434
+ "name": "tenant_id",
1435
+ "type": "text",
1436
+ "primaryKey": false,
1437
+ "notNull": true
1438
+ },
1439
+ "principal_id": {
1440
+ "name": "principal_id",
1441
+ "type": "text",
1442
+ "primaryKey": false,
1443
+ "notNull": false
1444
+ },
1445
+ "provider_id": {
1446
+ "name": "provider_id",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true
1450
+ },
1451
+ "oauth_client_id": {
1452
+ "name": "oauth_client_id",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": false
1456
+ },
1457
+ "name": {
1458
+ "name": "name",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "type": {
1464
+ "name": "type",
1465
+ "type": "text",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "description": {
1470
+ "name": "description",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": false
1474
+ },
1475
+ "secret": {
1476
+ "name": "secret",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": true
1480
+ },
1481
+ "refresh_secret": {
1482
+ "name": "refresh_secret",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": false
1486
+ },
1487
+ "scopes": {
1488
+ "name": "scopes",
1489
+ "type": "text[]",
1490
+ "primaryKey": false,
1491
+ "notNull": false
1492
+ },
1493
+ "expires_at": {
1494
+ "name": "expires_at",
1495
+ "type": "timestamp",
1496
+ "primaryKey": false,
1497
+ "notNull": false
1498
+ },
1499
+ "status": {
1500
+ "name": "status",
1501
+ "type": "text",
1502
+ "primaryKey": false,
1503
+ "notNull": true,
1504
+ "default": "'active'"
1505
+ },
1506
+ "metadata": {
1507
+ "name": "metadata",
1508
+ "type": "jsonb",
1509
+ "primaryKey": false,
1510
+ "notNull": false
1511
+ },
1512
+ "created_at": {
1513
+ "name": "created_at",
1514
+ "type": "timestamp",
1515
+ "primaryKey": false,
1516
+ "notNull": true,
1517
+ "default": "now()"
1518
+ },
1519
+ "updated_at": {
1520
+ "name": "updated_at",
1521
+ "type": "timestamp",
1522
+ "primaryKey": false,
1523
+ "notNull": true,
1524
+ "default": "now()"
1525
+ }
1526
+ },
1527
+ "indexes": {},
1528
+ "foreignKeys": {
1529
+ "credential_tenant_id_tenant_id_fk": {
1530
+ "name": "credential_tenant_id_tenant_id_fk",
1531
+ "tableFrom": "credential",
1532
+ "tableTo": "tenant",
1533
+ "columnsFrom": ["tenant_id"],
1534
+ "columnsTo": ["id"],
1535
+ "onDelete": "cascade",
1536
+ "onUpdate": "no action"
1537
+ },
1538
+ "credential_principal_id_principal_id_fk": {
1539
+ "name": "credential_principal_id_principal_id_fk",
1540
+ "tableFrom": "credential",
1541
+ "tableTo": "principal",
1542
+ "columnsFrom": ["principal_id"],
1543
+ "columnsTo": ["id"],
1544
+ "onDelete": "set null",
1545
+ "onUpdate": "no action"
1546
+ },
1547
+ "credential_provider_id_provider_id_fk": {
1548
+ "name": "credential_provider_id_provider_id_fk",
1549
+ "tableFrom": "credential",
1550
+ "tableTo": "provider",
1551
+ "columnsFrom": ["provider_id"],
1552
+ "columnsTo": ["id"],
1553
+ "onDelete": "cascade",
1554
+ "onUpdate": "no action"
1555
+ },
1556
+ "credential_oauth_client_id_oauth_client_id_fk": {
1557
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1558
+ "tableFrom": "credential",
1559
+ "tableTo": "oauth_client",
1560
+ "columnsFrom": ["oauth_client_id"],
1561
+ "columnsTo": ["id"],
1562
+ "onDelete": "set null",
1563
+ "onUpdate": "no action"
1564
+ }
1565
+ },
1566
+ "compositePrimaryKeys": {},
1567
+ "uniqueConstraints": {
1568
+ "credential_tenant_name": {
1569
+ "name": "credential_tenant_name",
1570
+ "nullsNotDistinct": false,
1571
+ "columns": ["tenant_id", "name"]
1572
+ }
1573
+ },
1574
+ "policies": {},
1575
+ "checkConstraints": {},
1576
+ "isRLSEnabled": false
1577
+ },
1578
+ "public.asset": {
1579
+ "name": "asset",
1580
+ "schema": "",
1581
+ "columns": {
1582
+ "id": {
1583
+ "name": "id",
1584
+ "type": "text",
1585
+ "primaryKey": true,
1586
+ "notNull": true
1587
+ },
1588
+ "tenant_id": {
1589
+ "name": "tenant_id",
1590
+ "type": "text",
1591
+ "primaryKey": false,
1592
+ "notNull": true
1593
+ },
1594
+ "kind": {
1595
+ "name": "kind",
1596
+ "type": "text",
1597
+ "primaryKey": false,
1598
+ "notNull": true
1599
+ },
1600
+ "name": {
1601
+ "name": "name",
1602
+ "type": "text",
1603
+ "primaryKey": false,
1604
+ "notNull": true
1605
+ },
1606
+ "display_name": {
1607
+ "name": "display_name",
1608
+ "type": "text",
1609
+ "primaryKey": false,
1610
+ "notNull": false
1611
+ },
1612
+ "creator_principal_id": {
1613
+ "name": "creator_principal_id",
1614
+ "type": "text",
1615
+ "primaryKey": false,
1616
+ "notNull": false
1617
+ },
1618
+ "created_at": {
1619
+ "name": "created_at",
1620
+ "type": "timestamp",
1621
+ "primaryKey": false,
1622
+ "notNull": true,
1623
+ "default": "now()"
1624
+ },
1625
+ "updated_at": {
1626
+ "name": "updated_at",
1627
+ "type": "timestamp",
1628
+ "primaryKey": false,
1629
+ "notNull": true,
1630
+ "default": "now()"
1631
+ }
1632
+ },
1633
+ "indexes": {},
1634
+ "foreignKeys": {
1635
+ "asset_tenant_id_tenant_id_fk": {
1636
+ "name": "asset_tenant_id_tenant_id_fk",
1637
+ "tableFrom": "asset",
1638
+ "tableTo": "tenant",
1639
+ "columnsFrom": ["tenant_id"],
1640
+ "columnsTo": ["id"],
1641
+ "onDelete": "cascade",
1642
+ "onUpdate": "no action"
1643
+ },
1644
+ "asset_creator_principal_id_principal_id_fk": {
1645
+ "name": "asset_creator_principal_id_principal_id_fk",
1646
+ "tableFrom": "asset",
1647
+ "tableTo": "principal",
1648
+ "columnsFrom": ["creator_principal_id"],
1649
+ "columnsTo": ["id"],
1650
+ "onDelete": "set null",
1651
+ "onUpdate": "no action"
1652
+ }
1653
+ },
1654
+ "compositePrimaryKeys": {},
1655
+ "uniqueConstraints": {
1656
+ "asset_tenant_kind_name": {
1657
+ "name": "asset_tenant_kind_name",
1658
+ "nullsNotDistinct": false,
1659
+ "columns": ["tenant_id", "kind", "name"]
1660
+ }
1661
+ },
1662
+ "policies": {},
1663
+ "checkConstraints": {},
1664
+ "isRLSEnabled": false
1665
+ },
1666
+ "public.transaction": {
1667
+ "name": "transaction",
1668
+ "schema": "",
1669
+ "columns": {
1670
+ "id": {
1671
+ "name": "id",
1672
+ "type": "text",
1673
+ "primaryKey": true,
1674
+ "notNull": true
1675
+ },
1676
+ "wallet_id": {
1677
+ "name": "wallet_id",
1678
+ "type": "text",
1679
+ "primaryKey": false,
1680
+ "notNull": true
1681
+ },
1682
+ "run_id": {
1683
+ "name": "run_id",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": false
1687
+ },
1688
+ "direction": {
1689
+ "name": "direction",
1690
+ "type": "text",
1691
+ "primaryKey": false,
1692
+ "notNull": true
1693
+ },
1694
+ "amount": {
1695
+ "name": "amount",
1696
+ "type": "text",
1697
+ "primaryKey": false,
1698
+ "notNull": true
1699
+ },
1700
+ "currency": {
1701
+ "name": "currency",
1702
+ "type": "text",
1703
+ "primaryKey": false,
1704
+ "notNull": true
1705
+ },
1706
+ "recipient_id": {
1707
+ "name": "recipient_id",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": false
1711
+ },
1712
+ "sender_id": {
1713
+ "name": "sender_id",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": false
1717
+ },
1718
+ "request_id": {
1719
+ "name": "request_id",
1720
+ "type": "text",
1721
+ "primaryKey": false,
1722
+ "notNull": false
1723
+ },
1724
+ "status": {
1725
+ "name": "status",
1726
+ "type": "text",
1727
+ "primaryKey": false,
1728
+ "notNull": true,
1729
+ "default": "'pending'"
1730
+ },
1731
+ "created_at": {
1732
+ "name": "created_at",
1733
+ "type": "timestamp",
1734
+ "primaryKey": false,
1735
+ "notNull": true,
1736
+ "default": "now()"
1737
+ }
1738
+ },
1739
+ "indexes": {},
1740
+ "foreignKeys": {
1741
+ "transaction_wallet_id_wallet_id_fk": {
1742
+ "name": "transaction_wallet_id_wallet_id_fk",
1743
+ "tableFrom": "transaction",
1744
+ "tableTo": "wallet",
1745
+ "columnsFrom": ["wallet_id"],
1746
+ "columnsTo": ["id"],
1747
+ "onDelete": "cascade",
1748
+ "onUpdate": "no action"
1749
+ },
1750
+ "transaction_run_id_workflow_run_id_fk": {
1751
+ "name": "transaction_run_id_workflow_run_id_fk",
1752
+ "tableFrom": "transaction",
1753
+ "tableTo": "workflow_run",
1754
+ "columnsFrom": ["run_id"],
1755
+ "columnsTo": ["id"],
1756
+ "onDelete": "set null",
1757
+ "onUpdate": "no action"
1758
+ }
1759
+ },
1760
+ "compositePrimaryKeys": {},
1761
+ "uniqueConstraints": {},
1762
+ "policies": {},
1763
+ "checkConstraints": {},
1764
+ "isRLSEnabled": false
1765
+ },
1766
+ "public.wallet": {
1767
+ "name": "wallet",
1768
+ "schema": "",
1769
+ "columns": {
1770
+ "id": {
1771
+ "name": "id",
1772
+ "type": "text",
1773
+ "primaryKey": true,
1774
+ "notNull": true
1775
+ },
1776
+ "tenant_id": {
1777
+ "name": "tenant_id",
1778
+ "type": "text",
1779
+ "primaryKey": false,
1780
+ "notNull": true
1781
+ },
1782
+ "name": {
1783
+ "name": "name",
1784
+ "type": "text",
1785
+ "primaryKey": false,
1786
+ "notNull": true
1787
+ },
1788
+ "backend_type": {
1789
+ "name": "backend_type",
1790
+ "type": "text",
1791
+ "primaryKey": false,
1792
+ "notNull": true
1793
+ },
1794
+ "currency": {
1795
+ "name": "currency",
1796
+ "type": "text",
1797
+ "primaryKey": false,
1798
+ "notNull": true
1799
+ },
1800
+ "balance": {
1801
+ "name": "balance",
1802
+ "type": "text",
1803
+ "primaryKey": false,
1804
+ "notNull": true,
1805
+ "default": "'0'"
1806
+ },
1807
+ "config": {
1808
+ "name": "config",
1809
+ "type": "jsonb",
1810
+ "primaryKey": false,
1811
+ "notNull": false
1812
+ },
1813
+ "created_at": {
1814
+ "name": "created_at",
1815
+ "type": "timestamp",
1816
+ "primaryKey": false,
1817
+ "notNull": true,
1818
+ "default": "now()"
1819
+ },
1820
+ "updated_at": {
1821
+ "name": "updated_at",
1822
+ "type": "timestamp",
1823
+ "primaryKey": false,
1824
+ "notNull": true,
1825
+ "default": "now()"
1826
+ }
1827
+ },
1828
+ "indexes": {},
1829
+ "foreignKeys": {
1830
+ "wallet_tenant_id_tenant_id_fk": {
1831
+ "name": "wallet_tenant_id_tenant_id_fk",
1832
+ "tableFrom": "wallet",
1833
+ "tableTo": "tenant",
1834
+ "columnsFrom": ["tenant_id"],
1835
+ "columnsTo": ["id"],
1836
+ "onDelete": "cascade",
1837
+ "onUpdate": "no action"
1838
+ }
1839
+ },
1840
+ "compositePrimaryKeys": {},
1841
+ "uniqueConstraints": {},
1842
+ "policies": {},
1843
+ "checkConstraints": {},
1844
+ "isRLSEnabled": false
1845
+ },
1846
+ "public.offering": {
1847
+ "name": "offering",
1848
+ "schema": "",
1849
+ "columns": {
1850
+ "id": {
1851
+ "name": "id",
1852
+ "type": "text",
1853
+ "primaryKey": true,
1854
+ "notNull": true
1855
+ },
1856
+ "agent_id": {
1857
+ "name": "agent_id",
1858
+ "type": "text",
1859
+ "primaryKey": false,
1860
+ "notNull": true
1861
+ },
1862
+ "tenant_id": {
1863
+ "name": "tenant_id",
1864
+ "type": "text",
1865
+ "primaryKey": false,
1866
+ "notNull": true
1867
+ },
1868
+ "name": {
1869
+ "name": "name",
1870
+ "type": "text",
1871
+ "primaryKey": false,
1872
+ "notNull": true
1873
+ },
1874
+ "description": {
1875
+ "name": "description",
1876
+ "type": "text",
1877
+ "primaryKey": false,
1878
+ "notNull": false
1879
+ },
1880
+ "pricing": {
1881
+ "name": "pricing",
1882
+ "type": "jsonb",
1883
+ "primaryKey": false,
1884
+ "notNull": false
1885
+ },
1886
+ "schema": {
1887
+ "name": "schema",
1888
+ "type": "jsonb",
1889
+ "primaryKey": false,
1890
+ "notNull": false
1891
+ },
1892
+ "created_at": {
1893
+ "name": "created_at",
1894
+ "type": "timestamp",
1895
+ "primaryKey": false,
1896
+ "notNull": true,
1897
+ "default": "now()"
1898
+ },
1899
+ "updated_at": {
1900
+ "name": "updated_at",
1901
+ "type": "timestamp",
1902
+ "primaryKey": false,
1903
+ "notNull": true,
1904
+ "default": "now()"
1905
+ }
1906
+ },
1907
+ "indexes": {},
1908
+ "foreignKeys": {
1909
+ "offering_agent_id_workflow_definition_id_fk": {
1910
+ "name": "offering_agent_id_workflow_definition_id_fk",
1911
+ "tableFrom": "offering",
1912
+ "tableTo": "workflow_definition",
1913
+ "columnsFrom": ["agent_id"],
1914
+ "columnsTo": ["id"],
1915
+ "onDelete": "restrict",
1916
+ "onUpdate": "no action"
1917
+ },
1918
+ "offering_tenant_id_tenant_id_fk": {
1919
+ "name": "offering_tenant_id_tenant_id_fk",
1920
+ "tableFrom": "offering",
1921
+ "tableTo": "tenant",
1922
+ "columnsFrom": ["tenant_id"],
1923
+ "columnsTo": ["id"],
1924
+ "onDelete": "cascade",
1925
+ "onUpdate": "no action"
1926
+ }
1927
+ },
1928
+ "compositePrimaryKeys": {},
1929
+ "uniqueConstraints": {},
1930
+ "policies": {},
1931
+ "checkConstraints": {},
1932
+ "isRLSEnabled": false
1933
+ },
1934
+ "public.model": {
1935
+ "name": "model",
1936
+ "schema": "",
1937
+ "columns": {
1938
+ "id": {
1939
+ "name": "id",
1940
+ "type": "text",
1941
+ "primaryKey": true,
1942
+ "notNull": true
1943
+ },
1944
+ "tenant_id": {
1945
+ "name": "tenant_id",
1946
+ "type": "text",
1947
+ "primaryKey": false,
1948
+ "notNull": true
1949
+ },
1950
+ "canonical_name": {
1951
+ "name": "canonical_name",
1952
+ "type": "text",
1953
+ "primaryKey": false,
1954
+ "notNull": true
1955
+ },
1956
+ "display_name": {
1957
+ "name": "display_name",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": false
1961
+ },
1962
+ "description": {
1963
+ "name": "description",
1964
+ "type": "text",
1965
+ "primaryKey": false,
1966
+ "notNull": false
1967
+ },
1968
+ "disabled": {
1969
+ "name": "disabled",
1970
+ "type": "boolean",
1971
+ "primaryKey": false,
1972
+ "notNull": true,
1973
+ "default": false
1974
+ },
1975
+ "created_at": {
1976
+ "name": "created_at",
1977
+ "type": "timestamp",
1978
+ "primaryKey": false,
1979
+ "notNull": true,
1980
+ "default": "now()"
1981
+ },
1982
+ "updated_at": {
1983
+ "name": "updated_at",
1984
+ "type": "timestamp",
1985
+ "primaryKey": false,
1986
+ "notNull": true,
1987
+ "default": "now()"
1988
+ }
1989
+ },
1990
+ "indexes": {},
1991
+ "foreignKeys": {
1992
+ "model_tenant_id_tenant_id_fk": {
1993
+ "name": "model_tenant_id_tenant_id_fk",
1994
+ "tableFrom": "model",
1995
+ "tableTo": "tenant",
1996
+ "columnsFrom": ["tenant_id"],
1997
+ "columnsTo": ["id"],
1998
+ "onDelete": "cascade",
1999
+ "onUpdate": "no action"
2000
+ }
2001
+ },
2002
+ "compositePrimaryKeys": {},
2003
+ "uniqueConstraints": {
2004
+ "model_tenant_canonical_name": {
2005
+ "name": "model_tenant_canonical_name",
2006
+ "nullsNotDistinct": false,
2007
+ "columns": ["tenant_id", "canonical_name"]
2008
+ }
2009
+ },
2010
+ "policies": {},
2011
+ "checkConstraints": {},
2012
+ "isRLSEnabled": false
2013
+ },
2014
+ "public.model_offering": {
2015
+ "name": "model_offering",
2016
+ "schema": "",
2017
+ "columns": {
2018
+ "id": {
2019
+ "name": "id",
2020
+ "type": "text",
2021
+ "primaryKey": true,
2022
+ "notNull": true
2023
+ },
2024
+ "tenant_id": {
2025
+ "name": "tenant_id",
2026
+ "type": "text",
2027
+ "primaryKey": false,
2028
+ "notNull": true
2029
+ },
2030
+ "model_id": {
2031
+ "name": "model_id",
2032
+ "type": "text",
2033
+ "primaryKey": false,
2034
+ "notNull": true
2035
+ },
2036
+ "provider_id": {
2037
+ "name": "provider_id",
2038
+ "type": "text",
2039
+ "primaryKey": false,
2040
+ "notNull": true
2041
+ },
2042
+ "priority": {
2043
+ "name": "priority",
2044
+ "type": "integer",
2045
+ "primaryKey": false,
2046
+ "notNull": true
2047
+ },
2048
+ "deployment_tags": {
2049
+ "name": "deployment_tags",
2050
+ "type": "text[]",
2051
+ "primaryKey": false,
2052
+ "notNull": true,
2053
+ "default": "'{}'"
2054
+ },
2055
+ "capabilities": {
2056
+ "name": "capabilities",
2057
+ "type": "text[]",
2058
+ "primaryKey": false,
2059
+ "notNull": true,
2060
+ "default": "'{}'"
2061
+ },
2062
+ "quirks": {
2063
+ "name": "quirks",
2064
+ "type": "jsonb",
2065
+ "primaryKey": false,
2066
+ "notNull": false
2067
+ },
2068
+ "disabled": {
2069
+ "name": "disabled",
2070
+ "type": "boolean",
2071
+ "primaryKey": false,
2072
+ "notNull": true,
2073
+ "default": false
2074
+ },
2075
+ "created_at": {
2076
+ "name": "created_at",
2077
+ "type": "timestamp",
2078
+ "primaryKey": false,
2079
+ "notNull": true,
2080
+ "default": "now()"
2081
+ },
2082
+ "updated_at": {
2083
+ "name": "updated_at",
2084
+ "type": "timestamp",
2085
+ "primaryKey": false,
2086
+ "notNull": true,
2087
+ "default": "now()"
2088
+ }
2089
+ },
2090
+ "indexes": {},
2091
+ "foreignKeys": {
2092
+ "model_offering_tenant_id_tenant_id_fk": {
2093
+ "name": "model_offering_tenant_id_tenant_id_fk",
2094
+ "tableFrom": "model_offering",
2095
+ "tableTo": "tenant",
2096
+ "columnsFrom": ["tenant_id"],
2097
+ "columnsTo": ["id"],
2098
+ "onDelete": "cascade",
2099
+ "onUpdate": "no action"
2100
+ },
2101
+ "model_offering_model_id_model_id_fk": {
2102
+ "name": "model_offering_model_id_model_id_fk",
2103
+ "tableFrom": "model_offering",
2104
+ "tableTo": "model",
2105
+ "columnsFrom": ["model_id"],
2106
+ "columnsTo": ["id"],
2107
+ "onDelete": "cascade",
2108
+ "onUpdate": "no action"
2109
+ },
2110
+ "model_offering_provider_id_model_provider_id_fk": {
2111
+ "name": "model_offering_provider_id_model_provider_id_fk",
2112
+ "tableFrom": "model_offering",
2113
+ "tableTo": "model_provider",
2114
+ "columnsFrom": ["provider_id"],
2115
+ "columnsTo": ["id"],
2116
+ "onDelete": "cascade",
2117
+ "onUpdate": "no action"
2118
+ }
2119
+ },
2120
+ "compositePrimaryKeys": {},
2121
+ "uniqueConstraints": {
2122
+ "model_offering_tenant_model_provider": {
2123
+ "name": "model_offering_tenant_model_provider",
2124
+ "nullsNotDistinct": false,
2125
+ "columns": ["tenant_id", "model_id", "provider_id"]
2126
+ }
2127
+ },
2128
+ "policies": {},
2129
+ "checkConstraints": {},
2130
+ "isRLSEnabled": false
2131
+ },
2132
+ "public.model_pricing": {
2133
+ "name": "model_pricing",
2134
+ "schema": "",
2135
+ "columns": {
2136
+ "id": {
2137
+ "name": "id",
2138
+ "type": "text",
2139
+ "primaryKey": true,
2140
+ "notNull": true
2141
+ },
2142
+ "tenant_id": {
2143
+ "name": "tenant_id",
2144
+ "type": "text",
2145
+ "primaryKey": false,
2146
+ "notNull": true
2147
+ },
2148
+ "offering_id": {
2149
+ "name": "offering_id",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": true
2153
+ },
2154
+ "currency": {
2155
+ "name": "currency",
2156
+ "type": "text",
2157
+ "primaryKey": false,
2158
+ "notNull": true
2159
+ },
2160
+ "input_token_price": {
2161
+ "name": "input_token_price",
2162
+ "type": "text",
2163
+ "primaryKey": false,
2164
+ "notNull": false
2165
+ },
2166
+ "output_token_price": {
2167
+ "name": "output_token_price",
2168
+ "type": "text",
2169
+ "primaryKey": false,
2170
+ "notNull": false
2171
+ },
2172
+ "cache_read_token_price": {
2173
+ "name": "cache_read_token_price",
2174
+ "type": "text",
2175
+ "primaryKey": false,
2176
+ "notNull": false
2177
+ },
2178
+ "cache_write_token_price": {
2179
+ "name": "cache_write_token_price",
2180
+ "type": "text",
2181
+ "primaryKey": false,
2182
+ "notNull": false
2183
+ },
2184
+ "thinking_token_price": {
2185
+ "name": "thinking_token_price",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": false
2189
+ },
2190
+ "per_request_fee": {
2191
+ "name": "per_request_fee",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": false
2195
+ },
2196
+ "per_image_fee": {
2197
+ "name": "per_image_fee",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": false
2201
+ },
2202
+ "per_audio_fee": {
2203
+ "name": "per_audio_fee",
2204
+ "type": "text",
2205
+ "primaryKey": false,
2206
+ "notNull": false
2207
+ },
2208
+ "effective_from": {
2209
+ "name": "effective_from",
2210
+ "type": "timestamp with time zone",
2211
+ "primaryKey": false,
2212
+ "notNull": true
2213
+ },
2214
+ "created_at": {
2215
+ "name": "created_at",
2216
+ "type": "timestamp with time zone",
2217
+ "primaryKey": false,
2218
+ "notNull": true,
2219
+ "default": "now()"
2220
+ }
2221
+ },
2222
+ "indexes": {},
2223
+ "foreignKeys": {
2224
+ "model_pricing_tenant_id_tenant_id_fk": {
2225
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2226
+ "tableFrom": "model_pricing",
2227
+ "tableTo": "tenant",
2228
+ "columnsFrom": ["tenant_id"],
2229
+ "columnsTo": ["id"],
2230
+ "onDelete": "cascade",
2231
+ "onUpdate": "no action"
2232
+ },
2233
+ "model_pricing_offering_id_model_offering_id_fk": {
2234
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2235
+ "tableFrom": "model_pricing",
2236
+ "tableTo": "model_offering",
2237
+ "columnsFrom": ["offering_id"],
2238
+ "columnsTo": ["id"],
2239
+ "onDelete": "cascade",
2240
+ "onUpdate": "no action"
2241
+ }
2242
+ },
2243
+ "compositePrimaryKeys": {},
2244
+ "uniqueConstraints": {
2245
+ "model_pricing_offering_currency_effective_from": {
2246
+ "name": "model_pricing_offering_currency_effective_from",
2247
+ "nullsNotDistinct": false,
2248
+ "columns": ["offering_id", "currency", "effective_from"]
2249
+ }
2250
+ },
2251
+ "policies": {},
2252
+ "checkConstraints": {},
2253
+ "isRLSEnabled": false
2254
+ },
2255
+ "public.model_provider": {
2256
+ "name": "model_provider",
2257
+ "schema": "",
2258
+ "columns": {
2259
+ "id": {
2260
+ "name": "id",
2261
+ "type": "text",
2262
+ "primaryKey": true,
2263
+ "notNull": true
2264
+ },
2265
+ "tenant_id": {
2266
+ "name": "tenant_id",
2267
+ "type": "text",
2268
+ "primaryKey": false,
2269
+ "notNull": true
2270
+ },
2271
+ "name": {
2272
+ "name": "name",
2273
+ "type": "text",
2274
+ "primaryKey": false,
2275
+ "notNull": true
2276
+ },
2277
+ "plugin": {
2278
+ "name": "plugin",
2279
+ "type": "text",
2280
+ "primaryKey": false,
2281
+ "notNull": true
2282
+ },
2283
+ "base_url": {
2284
+ "name": "base_url",
2285
+ "type": "text",
2286
+ "primaryKey": false,
2287
+ "notNull": true
2288
+ },
2289
+ "credential_id": {
2290
+ "name": "credential_id",
2291
+ "type": "text",
2292
+ "primaryKey": false,
2293
+ "notNull": false
2294
+ },
2295
+ "wallet_id": {
2296
+ "name": "wallet_id",
2297
+ "type": "text",
2298
+ "primaryKey": false,
2299
+ "notNull": false
2300
+ },
2301
+ "disabled": {
2302
+ "name": "disabled",
2303
+ "type": "boolean",
2304
+ "primaryKey": false,
2305
+ "notNull": true,
2306
+ "default": false
2307
+ },
2308
+ "created_at": {
2309
+ "name": "created_at",
2310
+ "type": "timestamp",
2311
+ "primaryKey": false,
2312
+ "notNull": true,
2313
+ "default": "now()"
2314
+ },
2315
+ "updated_at": {
2316
+ "name": "updated_at",
2317
+ "type": "timestamp",
2318
+ "primaryKey": false,
2319
+ "notNull": true,
2320
+ "default": "now()"
2321
+ }
2322
+ },
2323
+ "indexes": {},
2324
+ "foreignKeys": {
2325
+ "model_provider_tenant_id_tenant_id_fk": {
2326
+ "name": "model_provider_tenant_id_tenant_id_fk",
2327
+ "tableFrom": "model_provider",
2328
+ "tableTo": "tenant",
2329
+ "columnsFrom": ["tenant_id"],
2330
+ "columnsTo": ["id"],
2331
+ "onDelete": "cascade",
2332
+ "onUpdate": "no action"
2333
+ },
2334
+ "model_provider_credential_id_credential_id_fk": {
2335
+ "name": "model_provider_credential_id_credential_id_fk",
2336
+ "tableFrom": "model_provider",
2337
+ "tableTo": "credential",
2338
+ "columnsFrom": ["credential_id"],
2339
+ "columnsTo": ["id"],
2340
+ "onDelete": "restrict",
2341
+ "onUpdate": "no action"
2342
+ },
2343
+ "model_provider_wallet_id_wallet_id_fk": {
2344
+ "name": "model_provider_wallet_id_wallet_id_fk",
2345
+ "tableFrom": "model_provider",
2346
+ "tableTo": "wallet",
2347
+ "columnsFrom": ["wallet_id"],
2348
+ "columnsTo": ["id"],
2349
+ "onDelete": "restrict",
2350
+ "onUpdate": "no action"
2351
+ }
2352
+ },
2353
+ "compositePrimaryKeys": {},
2354
+ "uniqueConstraints": {
2355
+ "model_provider_tenant_name": {
2356
+ "name": "model_provider_tenant_name",
2357
+ "nullsNotDistinct": false,
2358
+ "columns": ["tenant_id", "name"]
2359
+ }
2360
+ },
2361
+ "policies": {},
2362
+ "checkConstraints": {
2363
+ "model_provider_auth_xor": {
2364
+ "name": "model_provider_auth_xor",
2365
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2366
+ }
2367
+ },
2368
+ "isRLSEnabled": false
2369
+ },
2370
+ "public.sidecar": {
2371
+ "name": "sidecar",
2372
+ "schema": "",
2373
+ "columns": {
2374
+ "id": {
2375
+ "name": "id",
2376
+ "type": "text",
2377
+ "primaryKey": true,
2378
+ "notNull": true
2379
+ },
2380
+ "url": {
2381
+ "name": "url",
2382
+ "type": "text",
2383
+ "primaryKey": false,
2384
+ "notNull": false
2385
+ },
2386
+ "token_hash_sha256": {
2387
+ "name": "token_hash_sha256",
2388
+ "type": "bytea",
2389
+ "primaryKey": false,
2390
+ "notNull": true
2391
+ },
2392
+ "status": {
2393
+ "name": "status",
2394
+ "type": "text",
2395
+ "primaryKey": false,
2396
+ "notNull": true,
2397
+ "default": "'online'"
2398
+ },
2399
+ "last_heartbeat": {
2400
+ "name": "last_heartbeat",
2401
+ "type": "timestamp",
2402
+ "primaryKey": false,
2403
+ "notNull": false
2404
+ },
2405
+ "created_at": {
2406
+ "name": "created_at",
2407
+ "type": "timestamp",
2408
+ "primaryKey": false,
2409
+ "notNull": true,
2410
+ "default": "now()"
2411
+ },
2412
+ "updated_at": {
2413
+ "name": "updated_at",
2414
+ "type": "timestamp",
2415
+ "primaryKey": false,
2416
+ "notNull": true,
2417
+ "default": "now()"
2418
+ }
2419
+ },
2420
+ "indexes": {},
2421
+ "foreignKeys": {},
2422
+ "compositePrimaryKeys": {},
2423
+ "uniqueConstraints": {
2424
+ "sidecar_token_hash_sha256_unique": {
2425
+ "name": "sidecar_token_hash_sha256_unique",
2426
+ "nullsNotDistinct": false,
2427
+ "columns": ["token_hash_sha256"]
2428
+ }
2429
+ },
2430
+ "policies": {},
2431
+ "checkConstraints": {},
2432
+ "isRLSEnabled": false
2433
+ },
2434
+ "public.sidecar_allocation": {
2435
+ "name": "sidecar_allocation",
2436
+ "schema": "",
2437
+ "columns": {
2438
+ "id": {
2439
+ "name": "id",
2440
+ "type": "text",
2441
+ "primaryKey": true,
2442
+ "notNull": true
2443
+ },
2444
+ "anchor_run_id": {
2445
+ "name": "anchor_run_id",
2446
+ "type": "text",
2447
+ "primaryKey": false,
2448
+ "notNull": true
2449
+ },
2450
+ "tenant_id": {
2451
+ "name": "tenant_id",
2452
+ "type": "text",
2453
+ "primaryKey": false,
2454
+ "notNull": true
2455
+ },
2456
+ "provisioner_id": {
2457
+ "name": "provisioner_id",
2458
+ "type": "text",
2459
+ "primaryKey": false,
2460
+ "notNull": true
2461
+ },
2462
+ "provisioner_api_version": {
2463
+ "name": "provisioner_api_version",
2464
+ "type": "integer",
2465
+ "primaryKey": false,
2466
+ "notNull": true
2467
+ },
2468
+ "provisioner_binding_fingerprint": {
2469
+ "name": "provisioner_binding_fingerprint",
2470
+ "type": "text",
2471
+ "primaryKey": false,
2472
+ "notNull": true
2473
+ },
2474
+ "sidecar_id": {
2475
+ "name": "sidecar_id",
2476
+ "type": "text",
2477
+ "primaryKey": false,
2478
+ "notNull": false
2479
+ },
2480
+ "status": {
2481
+ "name": "status",
2482
+ "type": "text",
2483
+ "primaryKey": false,
2484
+ "notNull": true,
2485
+ "default": "'pending'"
2486
+ },
2487
+ "generation": {
2488
+ "name": "generation",
2489
+ "type": "integer",
2490
+ "primaryKey": false,
2491
+ "notNull": true,
2492
+ "default": 0
2493
+ },
2494
+ "ensure_accepted_generation": {
2495
+ "name": "ensure_accepted_generation",
2496
+ "type": "integer",
2497
+ "primaryKey": false,
2498
+ "notNull": false
2499
+ },
2500
+ "external_ref": {
2501
+ "name": "external_ref",
2502
+ "type": "text",
2503
+ "primaryKey": false,
2504
+ "notNull": false
2505
+ },
2506
+ "next_attempt_at": {
2507
+ "name": "next_attempt_at",
2508
+ "type": "timestamp",
2509
+ "primaryKey": false,
2510
+ "notNull": false
2511
+ },
2512
+ "reconciliation_lease_id": {
2513
+ "name": "reconciliation_lease_id",
2514
+ "type": "text",
2515
+ "primaryKey": false,
2516
+ "notNull": false
2517
+ },
2518
+ "reconciliation_lease_expires_at": {
2519
+ "name": "reconciliation_lease_expires_at",
2520
+ "type": "timestamp",
2521
+ "primaryKey": false,
2522
+ "notNull": false
2523
+ },
2524
+ "ensure_attempts": {
2525
+ "name": "ensure_attempts",
2526
+ "type": "integer",
2527
+ "primaryKey": false,
2528
+ "notNull": true,
2529
+ "default": 0
2530
+ },
2531
+ "destroy_attempts": {
2532
+ "name": "destroy_attempts",
2533
+ "type": "integer",
2534
+ "primaryKey": false,
2535
+ "notNull": true,
2536
+ "default": 0
2537
+ },
2538
+ "connect_deadline": {
2539
+ "name": "connect_deadline",
2540
+ "type": "timestamp",
2541
+ "primaryKey": false,
2542
+ "notNull": false
2543
+ },
2544
+ "failure_code": {
2545
+ "name": "failure_code",
2546
+ "type": "text",
2547
+ "primaryKey": false,
2548
+ "notNull": false
2549
+ },
2550
+ "failure_message": {
2551
+ "name": "failure_message",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": false
2555
+ },
2556
+ "created_at": {
2557
+ "name": "created_at",
2558
+ "type": "timestamp",
2559
+ "primaryKey": false,
2560
+ "notNull": true,
2561
+ "default": "now()"
2562
+ },
2563
+ "updated_at": {
2564
+ "name": "updated_at",
2565
+ "type": "timestamp",
2566
+ "primaryKey": false,
2567
+ "notNull": true,
2568
+ "default": "now()"
2569
+ }
2570
+ },
2571
+ "indexes": {
2572
+ "sidecar_allocation_anchor_run_idx": {
2573
+ "name": "sidecar_allocation_anchor_run_idx",
2574
+ "columns": [
2575
+ {
2576
+ "expression": "anchor_run_id",
2577
+ "isExpression": false,
2578
+ "asc": true,
2579
+ "nulls": "last"
2580
+ }
2581
+ ],
2582
+ "isUnique": true,
2583
+ "concurrently": false,
2584
+ "method": "btree",
2585
+ "with": {}
2586
+ },
2587
+ "sidecar_allocation_active_sidecar_idx": {
2588
+ "name": "sidecar_allocation_active_sidecar_idx",
2589
+ "columns": [
2590
+ {
2591
+ "expression": "sidecar_id",
2592
+ "isExpression": false,
2593
+ "asc": true,
2594
+ "nulls": "last"
2595
+ }
2596
+ ],
2597
+ "isUnique": true,
2598
+ "where": "\"sidecar_allocation\".\"status\" in ('provisioning', 'allocated', 'replacing', 'releasing')",
2599
+ "concurrently": false,
2600
+ "method": "btree",
2601
+ "with": {}
2602
+ },
2603
+ "sidecar_allocation_sidecar_idx": {
2604
+ "name": "sidecar_allocation_sidecar_idx",
2605
+ "columns": [
2606
+ {
2607
+ "expression": "sidecar_id",
2608
+ "isExpression": false,
2609
+ "asc": true,
2610
+ "nulls": "last"
2611
+ }
2612
+ ],
2613
+ "isUnique": false,
2614
+ "concurrently": false,
2615
+ "method": "btree",
2616
+ "with": {}
2617
+ },
2618
+ "sidecar_allocation_reconciliation_idx": {
2619
+ "name": "sidecar_allocation_reconciliation_idx",
2620
+ "columns": [
2621
+ {
2622
+ "expression": "next_attempt_at",
2623
+ "isExpression": false,
2624
+ "asc": true,
2625
+ "nulls": "last"
2626
+ },
2627
+ {
2628
+ "expression": "created_at",
2629
+ "isExpression": false,
2630
+ "asc": true,
2631
+ "nulls": "last"
2632
+ }
2633
+ ],
2634
+ "isUnique": false,
2635
+ "where": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing') and \"sidecar_allocation\".\"next_attempt_at\" is not null",
2636
+ "concurrently": false,
2637
+ "method": "btree",
2638
+ "with": {}
2639
+ }
2640
+ },
2641
+ "foreignKeys": {
2642
+ "sidecar_allocation_anchor_run_id_workflow_run_id_fk": {
2643
+ "name": "sidecar_allocation_anchor_run_id_workflow_run_id_fk",
2644
+ "tableFrom": "sidecar_allocation",
2645
+ "tableTo": "workflow_run",
2646
+ "columnsFrom": ["anchor_run_id"],
2647
+ "columnsTo": ["id"],
2648
+ "onDelete": "cascade",
2649
+ "onUpdate": "no action"
2650
+ },
2651
+ "sidecar_allocation_tenant_id_tenant_id_fk": {
2652
+ "name": "sidecar_allocation_tenant_id_tenant_id_fk",
2653
+ "tableFrom": "sidecar_allocation",
2654
+ "tableTo": "tenant",
2655
+ "columnsFrom": ["tenant_id"],
2656
+ "columnsTo": ["id"],
2657
+ "onDelete": "restrict",
2658
+ "onUpdate": "no action"
2659
+ },
2660
+ "sidecar_allocation_sidecar_id_sidecar_id_fk": {
2661
+ "name": "sidecar_allocation_sidecar_id_sidecar_id_fk",
2662
+ "tableFrom": "sidecar_allocation",
2663
+ "tableTo": "sidecar",
2664
+ "columnsFrom": ["sidecar_id"],
2665
+ "columnsTo": ["id"],
2666
+ "onDelete": "restrict",
2667
+ "onUpdate": "no action"
2668
+ }
2669
+ },
2670
+ "compositePrimaryKeys": {},
2671
+ "uniqueConstraints": {},
2672
+ "policies": {},
2673
+ "checkConstraints": {
2674
+ "sidecar_allocation_status_check": {
2675
+ "name": "sidecar_allocation_status_check",
2676
+ "value": "\"sidecar_allocation\".\"status\" in ('pending', 'provisioning', 'allocated', 'replacing', 'releasing', 'released', 'failed')"
2677
+ },
2678
+ "sidecar_allocation_generation_check": {
2679
+ "name": "sidecar_allocation_generation_check",
2680
+ "value": "\"sidecar_allocation\".\"generation\" >= 0"
2681
+ },
2682
+ "sidecar_allocation_accepted_generation_check": {
2683
+ "name": "sidecar_allocation_accepted_generation_check",
2684
+ "value": "\"sidecar_allocation\".\"ensure_accepted_generation\" is null or \"sidecar_allocation\".\"ensure_accepted_generation\" <= \"sidecar_allocation\".\"generation\""
2685
+ }
2686
+ },
2687
+ "isRLSEnabled": false
2688
+ },
2689
+ "public.agent_session": {
2690
+ "name": "agent_session",
2691
+ "schema": "",
2692
+ "columns": {
2693
+ "id": {
2694
+ "name": "id",
2695
+ "type": "text",
2696
+ "primaryKey": true,
2697
+ "notNull": true
2698
+ },
2699
+ "tenant_id": {
2700
+ "name": "tenant_id",
2701
+ "type": "text",
2702
+ "primaryKey": false,
2703
+ "notNull": true
2704
+ },
2705
+ "agent_id": {
2706
+ "name": "agent_id",
2707
+ "type": "text",
2708
+ "primaryKey": false,
2709
+ "notNull": true
2710
+ },
2711
+ "principal_id": {
2712
+ "name": "principal_id",
2713
+ "type": "text",
2714
+ "primaryKey": false,
2715
+ "notNull": true
2716
+ },
2717
+ "status": {
2718
+ "name": "status",
2719
+ "type": "text",
2720
+ "primaryKey": false,
2721
+ "notNull": true,
2722
+ "default": "'active'"
2723
+ },
2724
+ "created_at": {
2725
+ "name": "created_at",
2726
+ "type": "timestamp",
2727
+ "primaryKey": false,
2728
+ "notNull": true,
2729
+ "default": "now()"
2730
+ },
2731
+ "updated_at": {
2732
+ "name": "updated_at",
2733
+ "type": "timestamp",
2734
+ "primaryKey": false,
2735
+ "notNull": true,
2736
+ "default": "now()"
2737
+ },
2738
+ "ended_at": {
2739
+ "name": "ended_at",
2740
+ "type": "timestamp",
2741
+ "primaryKey": false,
2742
+ "notNull": false
2743
+ }
2744
+ },
2745
+ "indexes": {},
2746
+ "foreignKeys": {
2747
+ "agent_session_tenant_id_tenant_id_fk": {
2748
+ "name": "agent_session_tenant_id_tenant_id_fk",
2749
+ "tableFrom": "agent_session",
2750
+ "tableTo": "tenant",
2751
+ "columnsFrom": ["tenant_id"],
2752
+ "columnsTo": ["id"],
2753
+ "onDelete": "cascade",
2754
+ "onUpdate": "no action"
2755
+ },
2756
+ "agent_session_agent_id_workflow_definition_id_fk": {
2757
+ "name": "agent_session_agent_id_workflow_definition_id_fk",
2758
+ "tableFrom": "agent_session",
2759
+ "tableTo": "workflow_definition",
2760
+ "columnsFrom": ["agent_id"],
2761
+ "columnsTo": ["id"],
2762
+ "onDelete": "restrict",
2763
+ "onUpdate": "no action"
2764
+ },
2765
+ "agent_session_principal_id_principal_id_fk": {
2766
+ "name": "agent_session_principal_id_principal_id_fk",
2767
+ "tableFrom": "agent_session",
2768
+ "tableTo": "principal",
2769
+ "columnsFrom": ["principal_id"],
2770
+ "columnsTo": ["id"],
2771
+ "onDelete": "no action",
2772
+ "onUpdate": "no action"
2773
+ }
2774
+ },
2775
+ "compositePrimaryKeys": {},
2776
+ "uniqueConstraints": {},
2777
+ "policies": {},
2778
+ "checkConstraints": {},
2779
+ "isRLSEnabled": false
2780
+ },
2781
+ "public.session_asset": {
2782
+ "name": "session_asset",
2783
+ "schema": "",
2784
+ "columns": {
2785
+ "instance_id": {
2786
+ "name": "instance_id",
2787
+ "type": "text",
2788
+ "primaryKey": false,
2789
+ "notNull": true
2790
+ },
2791
+ "mount_path": {
2792
+ "name": "mount_path",
2793
+ "type": "text",
2794
+ "primaryKey": false,
2795
+ "notNull": true
2796
+ },
2797
+ "asset_pack_sha": {
2798
+ "name": "asset_pack_sha",
2799
+ "type": "text",
2800
+ "primaryKey": false,
2801
+ "notNull": true
2802
+ },
2803
+ "source_commit_sha": {
2804
+ "name": "source_commit_sha",
2805
+ "type": "text",
2806
+ "primaryKey": false,
2807
+ "notNull": true
2808
+ },
2809
+ "materialized_at": {
2810
+ "name": "materialized_at",
2811
+ "type": "timestamp",
2812
+ "primaryKey": false,
2813
+ "notNull": true,
2814
+ "default": "now()"
2815
+ }
2816
+ },
2817
+ "indexes": {
2818
+ "session_asset_pack_sha_idx": {
2819
+ "name": "session_asset_pack_sha_idx",
2820
+ "columns": [
2821
+ {
2822
+ "expression": "asset_pack_sha",
2823
+ "isExpression": false,
2824
+ "asc": true,
2825
+ "nulls": "last"
2826
+ }
2827
+ ],
2828
+ "isUnique": false,
2829
+ "concurrently": false,
2830
+ "method": "btree",
2831
+ "with": {}
2832
+ }
2833
+ },
2834
+ "foreignKeys": {},
2835
+ "compositePrimaryKeys": {
2836
+ "session_asset_instance_id_mount_path_pk": {
2837
+ "name": "session_asset_instance_id_mount_path_pk",
2838
+ "columns": ["instance_id", "mount_path"]
2839
+ }
2840
+ },
2841
+ "uniqueConstraints": {},
2842
+ "policies": {},
2843
+ "checkConstraints": {},
2844
+ "isRLSEnabled": false
2845
+ },
2846
+ "public.inference_turn": {
2847
+ "name": "inference_turn",
2848
+ "schema": "",
2849
+ "columns": {
2850
+ "id": {
2851
+ "name": "id",
2852
+ "type": "text",
2853
+ "primaryKey": true,
2854
+ "notNull": true
2855
+ },
2856
+ "session_id": {
2857
+ "name": "session_id",
2858
+ "type": "text",
2859
+ "primaryKey": false,
2860
+ "notNull": true
2861
+ },
2862
+ "instance_id": {
2863
+ "name": "instance_id",
2864
+ "type": "text",
2865
+ "primaryKey": false,
2866
+ "notNull": true
2867
+ },
2868
+ "tenant_id": {
2869
+ "name": "tenant_id",
2870
+ "type": "text",
2871
+ "primaryKey": false,
2872
+ "notNull": true
2873
+ },
2874
+ "model": {
2875
+ "name": "model",
2876
+ "type": "text",
2877
+ "primaryKey": false,
2878
+ "notNull": true
2879
+ },
2880
+ "status": {
2881
+ "name": "status",
2882
+ "type": "text",
2883
+ "primaryKey": false,
2884
+ "notNull": true,
2885
+ "default": "'running'"
2886
+ },
2887
+ "started_at": {
2888
+ "name": "started_at",
2889
+ "type": "timestamp",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "ended_at": {
2894
+ "name": "ended_at",
2895
+ "type": "timestamp",
2896
+ "primaryKey": false,
2897
+ "notNull": false
2898
+ }
2899
+ },
2900
+ "indexes": {
2901
+ "inference_turn_instance_id_started_at_idx": {
2902
+ "name": "inference_turn_instance_id_started_at_idx",
2903
+ "columns": [
2904
+ {
2905
+ "expression": "instance_id",
2906
+ "isExpression": false,
2907
+ "asc": true,
2908
+ "nulls": "last"
2909
+ },
2910
+ {
2911
+ "expression": "started_at",
2912
+ "isExpression": false,
2913
+ "asc": true,
2914
+ "nulls": "last"
2915
+ }
2916
+ ],
2917
+ "isUnique": false,
2918
+ "concurrently": false,
2919
+ "method": "btree",
2920
+ "with": {}
2921
+ }
2922
+ },
2923
+ "foreignKeys": {
2924
+ "inference_turn_session_id_agent_session_id_fk": {
2925
+ "name": "inference_turn_session_id_agent_session_id_fk",
2926
+ "tableFrom": "inference_turn",
2927
+ "tableTo": "agent_session",
2928
+ "columnsFrom": ["session_id"],
2929
+ "columnsTo": ["id"],
2930
+ "onDelete": "cascade",
2931
+ "onUpdate": "no action"
2932
+ },
2933
+ "inference_turn_tenant_id_tenant_id_fk": {
2934
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2935
+ "tableFrom": "inference_turn",
2936
+ "tableTo": "tenant",
2937
+ "columnsFrom": ["tenant_id"],
2938
+ "columnsTo": ["id"],
2939
+ "onDelete": "cascade",
2940
+ "onUpdate": "no action"
2941
+ }
2942
+ },
2943
+ "compositePrimaryKeys": {},
2944
+ "uniqueConstraints": {},
2945
+ "policies": {},
2946
+ "checkConstraints": {},
2947
+ "isRLSEnabled": false
2948
+ },
2949
+ "public.session_mail": {
2950
+ "name": "session_mail",
2951
+ "schema": "",
2952
+ "columns": {
2953
+ "id": {
2954
+ "name": "id",
2955
+ "type": "text",
2956
+ "primaryKey": true,
2957
+ "notNull": true
2958
+ },
2959
+ "session_id": {
2960
+ "name": "session_id",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "instance_id": {
2966
+ "name": "instance_id",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": false
2970
+ },
2971
+ "tenant_id": {
2972
+ "name": "tenant_id",
2973
+ "type": "text",
2974
+ "primaryKey": false,
2975
+ "notNull": true
2976
+ },
2977
+ "direction": {
2978
+ "name": "direction",
2979
+ "type": "text",
2980
+ "primaryKey": false,
2981
+ "notNull": true
2982
+ },
2983
+ "status": {
2984
+ "name": "status",
2985
+ "type": "text",
2986
+ "primaryKey": false,
2987
+ "notNull": true,
2988
+ "default": "'pending'"
2989
+ },
2990
+ "raw": {
2991
+ "name": "raw",
2992
+ "type": "bytea",
2993
+ "primaryKey": false,
2994
+ "notNull": true
2995
+ },
2996
+ "created_at": {
2997
+ "name": "created_at",
2998
+ "type": "timestamp",
2999
+ "primaryKey": false,
3000
+ "notNull": true,
3001
+ "default": "now()"
3002
+ }
3003
+ },
3004
+ "indexes": {
3005
+ "session_mail_instance_id_created_at_idx": {
3006
+ "name": "session_mail_instance_id_created_at_idx",
3007
+ "columns": [
3008
+ {
3009
+ "expression": "instance_id",
3010
+ "isExpression": false,
3011
+ "asc": true,
3012
+ "nulls": "last"
3013
+ },
3014
+ {
3015
+ "expression": "created_at",
3016
+ "isExpression": false,
3017
+ "asc": true,
3018
+ "nulls": "last"
3019
+ }
3020
+ ],
3021
+ "isUnique": false,
3022
+ "concurrently": false,
3023
+ "method": "btree",
3024
+ "with": {}
3025
+ },
3026
+ "session_mail_session_id_created_at_idx": {
3027
+ "name": "session_mail_session_id_created_at_idx",
3028
+ "columns": [
3029
+ {
3030
+ "expression": "session_id",
3031
+ "isExpression": false,
3032
+ "asc": true,
3033
+ "nulls": "last"
3034
+ },
3035
+ {
3036
+ "expression": "created_at",
3037
+ "isExpression": false,
3038
+ "asc": true,
3039
+ "nulls": "last"
3040
+ }
3041
+ ],
3042
+ "isUnique": false,
3043
+ "concurrently": false,
3044
+ "method": "btree",
3045
+ "with": {}
3046
+ }
3047
+ },
3048
+ "foreignKeys": {
3049
+ "session_mail_session_id_agent_session_id_fk": {
3050
+ "name": "session_mail_session_id_agent_session_id_fk",
3051
+ "tableFrom": "session_mail",
3052
+ "tableTo": "agent_session",
3053
+ "columnsFrom": ["session_id"],
3054
+ "columnsTo": ["id"],
3055
+ "onDelete": "cascade",
3056
+ "onUpdate": "no action"
3057
+ },
3058
+ "session_mail_tenant_id_tenant_id_fk": {
3059
+ "name": "session_mail_tenant_id_tenant_id_fk",
3060
+ "tableFrom": "session_mail",
3061
+ "tableTo": "tenant",
3062
+ "columnsFrom": ["tenant_id"],
3063
+ "columnsTo": ["id"],
3064
+ "onDelete": "cascade",
3065
+ "onUpdate": "no action"
3066
+ }
3067
+ },
3068
+ "compositePrimaryKeys": {},
3069
+ "uniqueConstraints": {},
3070
+ "policies": {},
3071
+ "checkConstraints": {},
3072
+ "isRLSEnabled": false
3073
+ },
3074
+ "public.turn_part": {
3075
+ "name": "turn_part",
3076
+ "schema": "",
3077
+ "columns": {
3078
+ "id": {
3079
+ "name": "id",
3080
+ "type": "text",
3081
+ "primaryKey": true,
3082
+ "notNull": true
3083
+ },
3084
+ "turn_id": {
3085
+ "name": "turn_id",
3086
+ "type": "text",
3087
+ "primaryKey": false,
3088
+ "notNull": true
3089
+ },
3090
+ "session_id": {
3091
+ "name": "session_id",
3092
+ "type": "text",
3093
+ "primaryKey": false,
3094
+ "notNull": true
3095
+ },
3096
+ "type": {
3097
+ "name": "type",
3098
+ "type": "text",
3099
+ "primaryKey": false,
3100
+ "notNull": true
3101
+ },
3102
+ "content": {
3103
+ "name": "content",
3104
+ "type": "text",
3105
+ "primaryKey": false,
3106
+ "notNull": false
3107
+ },
3108
+ "metadata": {
3109
+ "name": "metadata",
3110
+ "type": "jsonb",
3111
+ "primaryKey": false,
3112
+ "notNull": false
3113
+ },
3114
+ "ordinal": {
3115
+ "name": "ordinal",
3116
+ "type": "integer",
3117
+ "primaryKey": false,
3118
+ "notNull": true
3119
+ }
3120
+ },
3121
+ "indexes": {},
3122
+ "foreignKeys": {
3123
+ "turn_part_turn_id_inference_turn_id_fk": {
3124
+ "name": "turn_part_turn_id_inference_turn_id_fk",
3125
+ "tableFrom": "turn_part",
3126
+ "tableTo": "inference_turn",
3127
+ "columnsFrom": ["turn_id"],
3128
+ "columnsTo": ["id"],
3129
+ "onDelete": "cascade",
3130
+ "onUpdate": "no action"
3131
+ },
3132
+ "turn_part_session_id_agent_session_id_fk": {
3133
+ "name": "turn_part_session_id_agent_session_id_fk",
3134
+ "tableFrom": "turn_part",
3135
+ "tableTo": "agent_session",
3136
+ "columnsFrom": ["session_id"],
3137
+ "columnsTo": ["id"],
3138
+ "onDelete": "cascade",
3139
+ "onUpdate": "no action"
3140
+ }
3141
+ },
3142
+ "compositePrimaryKeys": {},
3143
+ "uniqueConstraints": {},
3144
+ "policies": {},
3145
+ "checkConstraints": {},
3146
+ "isRLSEnabled": false
3147
+ },
3148
+ "public.git_token": {
3149
+ "name": "git_token",
3150
+ "schema": "",
3151
+ "columns": {
3152
+ "id": {
3153
+ "name": "id",
3154
+ "type": "text",
3155
+ "primaryKey": true,
3156
+ "notNull": true
3157
+ },
3158
+ "tenant_id": {
3159
+ "name": "tenant_id",
3160
+ "type": "text",
3161
+ "primaryKey": false,
3162
+ "notNull": false
3163
+ },
3164
+ "user_id": {
3165
+ "name": "user_id",
3166
+ "type": "text",
3167
+ "primaryKey": false,
3168
+ "notNull": true
3169
+ },
3170
+ "principal_id": {
3171
+ "name": "principal_id",
3172
+ "type": "text",
3173
+ "primaryKey": false,
3174
+ "notNull": false
3175
+ },
3176
+ "name": {
3177
+ "name": "name",
3178
+ "type": "text",
3179
+ "primaryKey": false,
3180
+ "notNull": true
3181
+ },
3182
+ "kind": {
3183
+ "name": "kind",
3184
+ "type": "text",
3185
+ "primaryKey": false,
3186
+ "notNull": true
3187
+ },
3188
+ "token_hash_sha256": {
3189
+ "name": "token_hash_sha256",
3190
+ "type": "bytea",
3191
+ "primaryKey": false,
3192
+ "notNull": true
3193
+ },
3194
+ "resource": {
3195
+ "name": "resource",
3196
+ "type": "text",
3197
+ "primaryKey": false,
3198
+ "notNull": true
3199
+ },
3200
+ "ref_pattern": {
3201
+ "name": "ref_pattern",
3202
+ "type": "text",
3203
+ "primaryKey": false,
3204
+ "notNull": true
3205
+ },
3206
+ "actions": {
3207
+ "name": "actions",
3208
+ "type": "text[]",
3209
+ "primaryKey": false,
3210
+ "notNull": true
3211
+ },
3212
+ "expires_at": {
3213
+ "name": "expires_at",
3214
+ "type": "timestamp with time zone",
3215
+ "primaryKey": false,
3216
+ "notNull": true
3217
+ },
3218
+ "revoked_at": {
3219
+ "name": "revoked_at",
3220
+ "type": "timestamp with time zone",
3221
+ "primaryKey": false,
3222
+ "notNull": false
3223
+ },
3224
+ "created_at": {
3225
+ "name": "created_at",
3226
+ "type": "timestamp with time zone",
3227
+ "primaryKey": false,
3228
+ "notNull": true,
3229
+ "default": "now()"
3230
+ }
3231
+ },
3232
+ "indexes": {
3233
+ "git_token_user_id_name_active_idx": {
3234
+ "name": "git_token_user_id_name_active_idx",
3235
+ "columns": [
3236
+ {
3237
+ "expression": "user_id",
3238
+ "isExpression": false,
3239
+ "asc": true,
3240
+ "nulls": "last"
3241
+ },
3242
+ {
3243
+ "expression": "name",
3244
+ "isExpression": false,
3245
+ "asc": true,
3246
+ "nulls": "last"
3247
+ }
3248
+ ],
3249
+ "isUnique": true,
3250
+ "where": "\"git_token\".\"revoked_at\" is null",
3251
+ "concurrently": false,
3252
+ "method": "btree",
3253
+ "with": {}
3254
+ }
3255
+ },
3256
+ "foreignKeys": {
3257
+ "git_token_tenant_id_tenant_id_fk": {
3258
+ "name": "git_token_tenant_id_tenant_id_fk",
3259
+ "tableFrom": "git_token",
3260
+ "tableTo": "tenant",
3261
+ "columnsFrom": ["tenant_id"],
3262
+ "columnsTo": ["id"],
3263
+ "onDelete": "no action",
3264
+ "onUpdate": "no action"
3265
+ },
3266
+ "git_token_user_id_user_id_fk": {
3267
+ "name": "git_token_user_id_user_id_fk",
3268
+ "tableFrom": "git_token",
3269
+ "tableTo": "user",
3270
+ "columnsFrom": ["user_id"],
3271
+ "columnsTo": ["id"],
3272
+ "onDelete": "cascade",
3273
+ "onUpdate": "no action"
3274
+ },
3275
+ "git_token_principal_id_principal_id_fk": {
3276
+ "name": "git_token_principal_id_principal_id_fk",
3277
+ "tableFrom": "git_token",
3278
+ "tableTo": "principal",
3279
+ "columnsFrom": ["principal_id"],
3280
+ "columnsTo": ["id"],
3281
+ "onDelete": "cascade",
3282
+ "onUpdate": "no action"
3283
+ }
3284
+ },
3285
+ "compositePrimaryKeys": {},
3286
+ "uniqueConstraints": {
3287
+ "git_token_token_hash_sha256_unique": {
3288
+ "name": "git_token_token_hash_sha256_unique",
3289
+ "nullsNotDistinct": false,
3290
+ "columns": ["token_hash_sha256"]
3291
+ }
3292
+ },
3293
+ "policies": {},
3294
+ "checkConstraints": {},
3295
+ "isRLSEnabled": false
3296
+ },
3297
+ "public.workflow_definition": {
3298
+ "name": "workflow_definition",
3299
+ "schema": "",
3300
+ "columns": {
3301
+ "id": {
3302
+ "name": "id",
3303
+ "type": "text",
3304
+ "primaryKey": true,
3305
+ "notNull": true
3306
+ },
3307
+ "tenant_id": {
3308
+ "name": "tenant_id",
3309
+ "type": "text",
3310
+ "primaryKey": false,
3311
+ "notNull": true
3312
+ },
3313
+ "creator_principal_id": {
3314
+ "name": "creator_principal_id",
3315
+ "type": "text",
3316
+ "primaryKey": false,
3317
+ "notNull": false
3318
+ },
3319
+ "asset_id": {
3320
+ "name": "asset_id",
3321
+ "type": "text",
3322
+ "primaryKey": false,
3323
+ "notNull": false
3324
+ },
3325
+ "wire_hash": {
3326
+ "name": "wire_hash",
3327
+ "type": "text",
3328
+ "primaryKey": false,
3329
+ "notNull": false
3330
+ },
3331
+ "name": {
3332
+ "name": "name",
3333
+ "type": "text",
3334
+ "primaryKey": false,
3335
+ "notNull": true
3336
+ },
3337
+ "description": {
3338
+ "name": "description",
3339
+ "type": "text",
3340
+ "primaryKey": false,
3341
+ "notNull": false
3342
+ },
3343
+ "grant_requirements": {
3344
+ "name": "grant_requirements",
3345
+ "type": "jsonb",
3346
+ "primaryKey": false,
3347
+ "notNull": false
3348
+ },
3349
+ "model_requirements": {
3350
+ "name": "model_requirements",
3351
+ "type": "jsonb",
3352
+ "primaryKey": false,
3353
+ "notNull": false
3354
+ },
3355
+ "credential_bindings": {
3356
+ "name": "credential_bindings",
3357
+ "type": "jsonb",
3358
+ "primaryKey": false,
3359
+ "notNull": false
3360
+ },
3361
+ "current_version": {
3362
+ "name": "current_version",
3363
+ "type": "text",
3364
+ "primaryKey": false,
3365
+ "notNull": true,
3366
+ "default": "'1'"
3367
+ },
3368
+ "status": {
3369
+ "name": "status",
3370
+ "type": "text",
3371
+ "primaryKey": false,
3372
+ "notNull": true,
3373
+ "default": "'deployed'"
3374
+ },
3375
+ "created_at": {
3376
+ "name": "created_at",
3377
+ "type": "timestamp",
3378
+ "primaryKey": false,
3379
+ "notNull": true,
3380
+ "default": "now()"
3381
+ },
3382
+ "updated_at": {
3383
+ "name": "updated_at",
3384
+ "type": "timestamp",
3385
+ "primaryKey": false,
3386
+ "notNull": true,
3387
+ "default": "now()"
3388
+ }
3389
+ },
3390
+ "indexes": {
3391
+ "workflow_definition_tenant_idx": {
3392
+ "name": "workflow_definition_tenant_idx",
3393
+ "columns": [
3394
+ {
3395
+ "expression": "tenant_id",
3396
+ "isExpression": false,
3397
+ "asc": true,
3398
+ "nulls": "last"
3399
+ },
3400
+ {
3401
+ "expression": "created_at",
3402
+ "isExpression": false,
3403
+ "asc": true,
3404
+ "nulls": "last"
3405
+ }
3406
+ ],
3407
+ "isUnique": false,
3408
+ "concurrently": false,
3409
+ "method": "btree",
3410
+ "with": {}
3411
+ },
3412
+ "workflow_definition_asset_wire_hash_idx": {
3413
+ "name": "workflow_definition_asset_wire_hash_idx",
3414
+ "columns": [
3415
+ {
3416
+ "expression": "asset_id",
3417
+ "isExpression": false,
3418
+ "asc": true,
3419
+ "nulls": "last"
3420
+ },
3421
+ {
3422
+ "expression": "wire_hash",
3423
+ "isExpression": false,
3424
+ "asc": true,
3425
+ "nulls": "last"
3426
+ }
3427
+ ],
3428
+ "isUnique": true,
3429
+ "concurrently": false,
3430
+ "method": "btree",
3431
+ "with": {}
3432
+ }
3433
+ },
3434
+ "foreignKeys": {
3435
+ "workflow_definition_tenant_id_tenant_id_fk": {
3436
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3437
+ "tableFrom": "workflow_definition",
3438
+ "tableTo": "tenant",
3439
+ "columnsFrom": ["tenant_id"],
3440
+ "columnsTo": ["id"],
3441
+ "onDelete": "cascade",
3442
+ "onUpdate": "no action"
3443
+ },
3444
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3445
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3446
+ "tableFrom": "workflow_definition",
3447
+ "tableTo": "principal",
3448
+ "columnsFrom": ["creator_principal_id"],
3449
+ "columnsTo": ["id"],
3450
+ "onDelete": "no action",
3451
+ "onUpdate": "no action"
3452
+ },
3453
+ "workflow_definition_asset_id_asset_id_fk": {
3454
+ "name": "workflow_definition_asset_id_asset_id_fk",
3455
+ "tableFrom": "workflow_definition",
3456
+ "tableTo": "asset",
3457
+ "columnsFrom": ["asset_id"],
3458
+ "columnsTo": ["id"],
3459
+ "onDelete": "restrict",
3460
+ "onUpdate": "no action"
3461
+ }
3462
+ },
3463
+ "compositePrimaryKeys": {},
3464
+ "uniqueConstraints": {},
3465
+ "policies": {},
3466
+ "checkConstraints": {},
3467
+ "isRLSEnabled": false
3468
+ },
3469
+ "public.workflow_definition_version": {
3470
+ "name": "workflow_definition_version",
3471
+ "schema": "",
3472
+ "columns": {
3473
+ "id": {
3474
+ "name": "id",
3475
+ "type": "text",
3476
+ "primaryKey": true,
3477
+ "notNull": true
3478
+ },
3479
+ "definition_id": {
3480
+ "name": "definition_id",
3481
+ "type": "text",
3482
+ "primaryKey": false,
3483
+ "notNull": true
3484
+ },
3485
+ "version": {
3486
+ "name": "version",
3487
+ "type": "text",
3488
+ "primaryKey": false,
3489
+ "notNull": true
3490
+ },
3491
+ "status": {
3492
+ "name": "status",
3493
+ "type": "text",
3494
+ "primaryKey": false,
3495
+ "notNull": true,
3496
+ "default": "'active'"
3497
+ },
3498
+ "approved_wire_hash": {
3499
+ "name": "approved_wire_hash",
3500
+ "type": "text",
3501
+ "primaryKey": false,
3502
+ "notNull": false
3503
+ },
3504
+ "grant_snapshot": {
3505
+ "name": "grant_snapshot",
3506
+ "type": "jsonb",
3507
+ "primaryKey": false,
3508
+ "notNull": false
3509
+ },
3510
+ "created_at": {
3511
+ "name": "created_at",
3512
+ "type": "timestamp",
3513
+ "primaryKey": false,
3514
+ "notNull": true,
3515
+ "default": "now()"
3516
+ }
3517
+ },
3518
+ "indexes": {
3519
+ "workflow_definition_version_definition_idx": {
3520
+ "name": "workflow_definition_version_definition_idx",
3521
+ "columns": [
3522
+ {
3523
+ "expression": "definition_id",
3524
+ "isExpression": false,
3525
+ "asc": true,
3526
+ "nulls": "last"
3527
+ }
3528
+ ],
3529
+ "isUnique": false,
3530
+ "concurrently": false,
3531
+ "method": "btree",
3532
+ "with": {}
3533
+ }
3534
+ },
3535
+ "foreignKeys": {
3536
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3537
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3538
+ "tableFrom": "workflow_definition_version",
3539
+ "tableTo": "workflow_definition",
3540
+ "columnsFrom": ["definition_id"],
3541
+ "columnsTo": ["id"],
3542
+ "onDelete": "cascade",
3543
+ "onUpdate": "no action"
3544
+ }
3545
+ },
3546
+ "compositePrimaryKeys": {},
3547
+ "uniqueConstraints": {
3548
+ "workflow_definition_version_definition_version": {
3549
+ "name": "workflow_definition_version_definition_version",
3550
+ "nullsNotDistinct": false,
3551
+ "columns": ["definition_id", "version"]
3552
+ }
3553
+ },
3554
+ "policies": {},
3555
+ "checkConstraints": {},
3556
+ "isRLSEnabled": false
3557
+ },
3558
+ "public.workflow_run": {
3559
+ "name": "workflow_run",
3560
+ "schema": "",
3561
+ "columns": {
3562
+ "id": {
3563
+ "name": "id",
3564
+ "type": "text",
3565
+ "primaryKey": true,
3566
+ "notNull": true
3567
+ },
3568
+ "definition_id": {
3569
+ "name": "definition_id",
3570
+ "type": "text",
3571
+ "primaryKey": false,
3572
+ "notNull": true
3573
+ },
3574
+ "anchor_run_id": {
3575
+ "name": "anchor_run_id",
3576
+ "type": "text",
3577
+ "primaryKey": false,
3578
+ "notNull": false
3579
+ },
3580
+ "tenant_id": {
3581
+ "name": "tenant_id",
3582
+ "type": "text",
3583
+ "primaryKey": false,
3584
+ "notNull": true
3585
+ },
3586
+ "principal_id": {
3587
+ "name": "principal_id",
3588
+ "type": "text",
3589
+ "primaryKey": false,
3590
+ "notNull": false
3591
+ },
3592
+ "status": {
3593
+ "name": "status",
3594
+ "type": "text",
3595
+ "primaryKey": false,
3596
+ "notNull": true,
3597
+ "default": "'running'"
3598
+ },
3599
+ "address": {
3600
+ "name": "address",
3601
+ "type": "text",
3602
+ "primaryKey": false,
3603
+ "notNull": false
3604
+ },
3605
+ "public_key": {
3606
+ "name": "public_key",
3607
+ "type": "text",
3608
+ "primaryKey": false,
3609
+ "notNull": false
3610
+ },
3611
+ "sidecar_id": {
3612
+ "name": "sidecar_id",
3613
+ "type": "text",
3614
+ "primaryKey": false,
3615
+ "notNull": false
3616
+ },
3617
+ "kernel_id": {
3618
+ "name": "kernel_id",
3619
+ "type": "text",
3620
+ "primaryKey": false,
3621
+ "notNull": false
3622
+ },
3623
+ "model_preferences": {
3624
+ "name": "model_preferences",
3625
+ "type": "jsonb",
3626
+ "primaryKey": false,
3627
+ "notNull": false
3628
+ },
3629
+ "credential_refs": {
3630
+ "name": "credential_refs",
3631
+ "type": "jsonb",
3632
+ "primaryKey": false,
3633
+ "notNull": false
3634
+ },
3635
+ "created_at": {
3636
+ "name": "created_at",
3637
+ "type": "timestamp",
3638
+ "primaryKey": false,
3639
+ "notNull": true,
3640
+ "default": "now()"
3641
+ },
3642
+ "ended_at": {
3643
+ "name": "ended_at",
3644
+ "type": "timestamp",
3645
+ "primaryKey": false,
3646
+ "notNull": false
3647
+ }
3648
+ },
3649
+ "indexes": {
3650
+ "workflow_run_definition_idx": {
3651
+ "name": "workflow_run_definition_idx",
3652
+ "columns": [
3653
+ {
3654
+ "expression": "definition_id",
3655
+ "isExpression": false,
3656
+ "asc": true,
3657
+ "nulls": "last"
3658
+ }
3659
+ ],
3660
+ "isUnique": false,
3661
+ "concurrently": false,
3662
+ "method": "btree",
3663
+ "with": {}
3664
+ },
3665
+ "workflow_run_address_idx": {
3666
+ "name": "workflow_run_address_idx",
3667
+ "columns": [
3668
+ {
3669
+ "expression": "address",
3670
+ "isExpression": false,
3671
+ "asc": true,
3672
+ "nulls": "last"
3673
+ }
3674
+ ],
3675
+ "isUnique": true,
3676
+ "where": "\"workflow_run\".\"address\" is not null",
3677
+ "concurrently": false,
3678
+ "method": "btree",
3679
+ "with": {}
3680
+ }
3681
+ },
3682
+ "foreignKeys": {
3683
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3684
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3685
+ "tableFrom": "workflow_run",
3686
+ "tableTo": "workflow_definition",
3687
+ "columnsFrom": ["definition_id"],
3688
+ "columnsTo": ["id"],
3689
+ "onDelete": "cascade",
3690
+ "onUpdate": "no action"
3691
+ },
3692
+ "workflow_run_anchor_run_id_workflow_run_id_fk": {
3693
+ "name": "workflow_run_anchor_run_id_workflow_run_id_fk",
3694
+ "tableFrom": "workflow_run",
3695
+ "tableTo": "workflow_run",
3696
+ "columnsFrom": ["anchor_run_id"],
3697
+ "columnsTo": ["id"],
3698
+ "onDelete": "cascade",
3699
+ "onUpdate": "no action"
3700
+ },
3701
+ "workflow_run_tenant_id_tenant_id_fk": {
3702
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3703
+ "tableFrom": "workflow_run",
3704
+ "tableTo": "tenant",
3705
+ "columnsFrom": ["tenant_id"],
3706
+ "columnsTo": ["id"],
3707
+ "onDelete": "cascade",
3708
+ "onUpdate": "no action"
3709
+ },
3710
+ "workflow_run_principal_id_principal_id_fk": {
3711
+ "name": "workflow_run_principal_id_principal_id_fk",
3712
+ "tableFrom": "workflow_run",
3713
+ "tableTo": "principal",
3714
+ "columnsFrom": ["principal_id"],
3715
+ "columnsTo": ["id"],
3716
+ "onDelete": "set null",
3717
+ "onUpdate": "no action"
3718
+ },
3719
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3720
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3721
+ "tableFrom": "workflow_run",
3722
+ "tableTo": "sidecar",
3723
+ "columnsFrom": ["sidecar_id"],
3724
+ "columnsTo": ["id"],
3725
+ "onDelete": "set null",
3726
+ "onUpdate": "no action"
3727
+ }
3728
+ },
3729
+ "compositePrimaryKeys": {},
3730
+ "uniqueConstraints": {},
3731
+ "policies": {},
3732
+ "checkConstraints": {},
3733
+ "isRLSEnabled": false
3734
+ },
3735
+ "public.workflow_run_dispatch": {
3736
+ "name": "workflow_run_dispatch",
3737
+ "schema": "",
3738
+ "columns": {
3739
+ "id": {
3740
+ "name": "id",
3741
+ "type": "text",
3742
+ "primaryKey": true,
3743
+ "notNull": true
3744
+ },
3745
+ "anchor_run_id": {
3746
+ "name": "anchor_run_id",
3747
+ "type": "text",
3748
+ "primaryKey": false,
3749
+ "notNull": true
3750
+ },
3751
+ "message_id": {
3752
+ "name": "message_id",
3753
+ "type": "text",
3754
+ "primaryKey": false,
3755
+ "notNull": true
3756
+ },
3757
+ "kind": {
3758
+ "name": "kind",
3759
+ "type": "text",
3760
+ "primaryKey": false,
3761
+ "notNull": true,
3762
+ "default": "'mail'"
3763
+ },
3764
+ "raw_message": {
3765
+ "name": "raw_message",
3766
+ "type": "bytea",
3767
+ "primaryKey": false,
3768
+ "notNull": true
3769
+ },
3770
+ "step_grants": {
3771
+ "name": "step_grants",
3772
+ "type": "jsonb",
3773
+ "primaryKey": false,
3774
+ "notNull": true
3775
+ },
3776
+ "status": {
3777
+ "name": "status",
3778
+ "type": "text",
3779
+ "primaryKey": false,
3780
+ "notNull": true,
3781
+ "default": "'pending'"
3782
+ },
3783
+ "acknowledged_generation": {
3784
+ "name": "acknowledged_generation",
3785
+ "type": "integer",
3786
+ "primaryKey": false,
3787
+ "notNull": false
3788
+ },
3789
+ "attempt_count": {
3790
+ "name": "attempt_count",
3791
+ "type": "integer",
3792
+ "primaryKey": false,
3793
+ "notNull": true,
3794
+ "default": 0
3795
+ },
3796
+ "next_attempt_at": {
3797
+ "name": "next_attempt_at",
3798
+ "type": "timestamp",
3799
+ "primaryKey": false,
3800
+ "notNull": false,
3801
+ "default": "now()"
3802
+ },
3803
+ "delivery_lease_id": {
3804
+ "name": "delivery_lease_id",
3805
+ "type": "text",
3806
+ "primaryKey": false,
3807
+ "notNull": false
3808
+ },
3809
+ "delivery_lease_expires_at": {
3810
+ "name": "delivery_lease_expires_at",
3811
+ "type": "timestamp",
3812
+ "primaryKey": false,
3813
+ "notNull": false
3814
+ },
3815
+ "failure_code": {
3816
+ "name": "failure_code",
3817
+ "type": "text",
3818
+ "primaryKey": false,
3819
+ "notNull": false
3820
+ },
3821
+ "failure_message": {
3822
+ "name": "failure_message",
3823
+ "type": "text",
3824
+ "primaryKey": false,
3825
+ "notNull": false
3826
+ },
3827
+ "created_at": {
3828
+ "name": "created_at",
3829
+ "type": "timestamp",
3830
+ "primaryKey": false,
3831
+ "notNull": true,
3832
+ "default": "now()"
3833
+ },
3834
+ "updated_at": {
3835
+ "name": "updated_at",
3836
+ "type": "timestamp",
3837
+ "primaryKey": false,
3838
+ "notNull": true,
3839
+ "default": "now()"
3840
+ },
3841
+ "acknowledged_at": {
3842
+ "name": "acknowledged_at",
3843
+ "type": "timestamp",
3844
+ "primaryKey": false,
3845
+ "notNull": false
3846
+ },
3847
+ "settled_at": {
3848
+ "name": "settled_at",
3849
+ "type": "timestamp",
3850
+ "primaryKey": false,
3851
+ "notNull": false
3852
+ }
3853
+ },
3854
+ "indexes": {
3855
+ "workflow_run_dispatch_anchor_message_idx": {
3856
+ "name": "workflow_run_dispatch_anchor_message_idx",
3857
+ "columns": [
3858
+ {
3859
+ "expression": "anchor_run_id",
3860
+ "isExpression": false,
3861
+ "asc": true,
3862
+ "nulls": "last"
3863
+ },
3864
+ {
3865
+ "expression": "message_id",
3866
+ "isExpression": false,
3867
+ "asc": true,
3868
+ "nulls": "last"
3869
+ }
3870
+ ],
3871
+ "isUnique": true,
3872
+ "concurrently": false,
3873
+ "method": "btree",
3874
+ "with": {}
3875
+ },
3876
+ "workflow_run_dispatch_delivery_idx": {
3877
+ "name": "workflow_run_dispatch_delivery_idx",
3878
+ "columns": [
3879
+ {
3880
+ "expression": "next_attempt_at",
3881
+ "isExpression": false,
3882
+ "asc": true,
3883
+ "nulls": "last"
3884
+ },
3885
+ {
3886
+ "expression": "created_at",
3887
+ "isExpression": false,
3888
+ "asc": true,
3889
+ "nulls": "last"
3890
+ }
3891
+ ],
3892
+ "isUnique": false,
3893
+ "where": "\"workflow_run_dispatch\".\"status\" = 'pending'",
3894
+ "concurrently": false,
3895
+ "method": "btree",
3896
+ "with": {}
3897
+ },
3898
+ "workflow_run_dispatch_anchor_status_idx": {
3899
+ "name": "workflow_run_dispatch_anchor_status_idx",
3900
+ "columns": [
3901
+ {
3902
+ "expression": "anchor_run_id",
3903
+ "isExpression": false,
3904
+ "asc": true,
3905
+ "nulls": "last"
3906
+ },
3907
+ {
3908
+ "expression": "status",
3909
+ "isExpression": false,
3910
+ "asc": true,
3911
+ "nulls": "last"
3912
+ }
3913
+ ],
3914
+ "isUnique": false,
3915
+ "concurrently": false,
3916
+ "method": "btree",
3917
+ "with": {}
3918
+ }
3919
+ },
3920
+ "foreignKeys": {
3921
+ "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk": {
3922
+ "name": "workflow_run_dispatch_anchor_run_id_workflow_run_id_fk",
3923
+ "tableFrom": "workflow_run_dispatch",
3924
+ "tableTo": "workflow_run",
3925
+ "columnsFrom": ["anchor_run_id"],
3926
+ "columnsTo": ["id"],
3927
+ "onDelete": "cascade",
3928
+ "onUpdate": "no action"
3929
+ }
3930
+ },
3931
+ "compositePrimaryKeys": {},
3932
+ "uniqueConstraints": {},
3933
+ "policies": {},
3934
+ "checkConstraints": {
3935
+ "workflow_run_dispatch_status_check": {
3936
+ "name": "workflow_run_dispatch_status_check",
3937
+ "value": "\"workflow_run_dispatch\".\"status\" in ('pending', 'acknowledged', 'settled', 'failed')"
3938
+ },
3939
+ "workflow_run_dispatch_kind_check": {
3940
+ "name": "workflow_run_dispatch_kind_check",
3941
+ "value": "\"workflow_run_dispatch\".\"kind\" in ('mail', 'signal')"
3942
+ },
3943
+ "workflow_run_dispatch_attempt_count_check": {
3944
+ "name": "workflow_run_dispatch_attempt_count_check",
3945
+ "value": "\"workflow_run_dispatch\".\"attempt_count\" >= 0"
3946
+ },
3947
+ "workflow_run_dispatch_acknowledged_generation_check": {
3948
+ "name": "workflow_run_dispatch_acknowledged_generation_check",
3949
+ "value": "\"workflow_run_dispatch\".\"acknowledged_generation\" is null or \"workflow_run_dispatch\".\"acknowledged_generation\" >= 0"
3950
+ },
3951
+ "workflow_run_dispatch_acknowledged_state_check": {
3952
+ "name": "workflow_run_dispatch_acknowledged_state_check",
3953
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'acknowledged' or \"workflow_run_dispatch\".\"acknowledged_generation\" is not null"
3954
+ },
3955
+ "workflow_run_dispatch_pending_schedule_check": {
3956
+ "name": "workflow_run_dispatch_pending_schedule_check",
3957
+ "value": "\"workflow_run_dispatch\".\"status\" <> 'pending' or \"workflow_run_dispatch\".\"next_attempt_at\" is not null"
3958
+ }
3959
+ },
3960
+ "isRLSEnabled": false
3961
+ },
3962
+ "public.workflow_run_launch_spec": {
3963
+ "name": "workflow_run_launch_spec",
3964
+ "schema": "",
3965
+ "columns": {
3966
+ "anchor_run_id": {
3967
+ "name": "anchor_run_id",
3968
+ "type": "text",
3969
+ "primaryKey": true,
3970
+ "notNull": true
3971
+ },
3972
+ "schema_version": {
3973
+ "name": "schema_version",
3974
+ "type": "integer",
3975
+ "primaryKey": false,
3976
+ "notNull": true,
3977
+ "default": 1
3978
+ },
3979
+ "session_id": {
3980
+ "name": "session_id",
3981
+ "type": "text",
3982
+ "primaryKey": false,
3983
+ "notNull": true
3984
+ },
3985
+ "deployment_domain": {
3986
+ "name": "deployment_domain",
3987
+ "type": "text",
3988
+ "primaryKey": false,
3989
+ "notNull": true
3990
+ },
3991
+ "source_authority_principal_id": {
3992
+ "name": "source_authority_principal_id",
3993
+ "type": "text",
3994
+ "primaryKey": false,
3995
+ "notNull": true
3996
+ },
3997
+ "frozen_approval_bundle": {
3998
+ "name": "frozen_approval_bundle",
3999
+ "type": "jsonb",
4000
+ "primaryKey": false,
4001
+ "notNull": true
4002
+ },
4003
+ "source_offering_ids": {
4004
+ "name": "source_offering_ids",
4005
+ "type": "jsonb",
4006
+ "primaryKey": false,
4007
+ "notNull": true
4008
+ },
4009
+ "default_source_offering_id": {
4010
+ "name": "default_source_offering_id",
4011
+ "type": "text",
4012
+ "primaryKey": false,
4013
+ "notNull": true
4014
+ },
4015
+ "deploy_content": {
4016
+ "name": "deploy_content",
4017
+ "type": "jsonb",
4018
+ "primaryKey": false,
4019
+ "notNull": true
4020
+ },
4021
+ "tool_package_pins": {
4022
+ "name": "tool_package_pins",
4023
+ "type": "jsonb",
4024
+ "primaryKey": false,
4025
+ "notNull": false
4026
+ },
4027
+ "created_at": {
4028
+ "name": "created_at",
4029
+ "type": "timestamp",
4030
+ "primaryKey": false,
4031
+ "notNull": true,
4032
+ "default": "now()"
4033
+ }
4034
+ },
4035
+ "indexes": {},
4036
+ "foreignKeys": {
4037
+ "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk": {
4038
+ "name": "workflow_run_launch_spec_anchor_run_id_workflow_run_id_fk",
4039
+ "tableFrom": "workflow_run_launch_spec",
4040
+ "tableTo": "workflow_run",
4041
+ "columnsFrom": ["anchor_run_id"],
4042
+ "columnsTo": ["id"],
4043
+ "onDelete": "cascade",
4044
+ "onUpdate": "no action"
4045
+ },
4046
+ "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk": {
4047
+ "name": "workflow_run_launch_spec_source_authority_principal_id_principal_id_fk",
4048
+ "tableFrom": "workflow_run_launch_spec",
4049
+ "tableTo": "principal",
4050
+ "columnsFrom": ["source_authority_principal_id"],
4051
+ "columnsTo": ["id"],
4052
+ "onDelete": "restrict",
4053
+ "onUpdate": "no action"
4054
+ }
4055
+ },
4056
+ "compositePrimaryKeys": {},
4057
+ "uniqueConstraints": {},
4058
+ "policies": {},
4059
+ "checkConstraints": {},
4060
+ "isRLSEnabled": false
4061
+ },
4062
+ "public.workflow_run_execution": {
4063
+ "name": "workflow_run_execution",
4064
+ "schema": "",
4065
+ "columns": {
4066
+ "id": {
4067
+ "name": "id",
4068
+ "type": "text",
4069
+ "primaryKey": true,
4070
+ "notNull": true
4071
+ },
4072
+ "run_id": {
4073
+ "name": "run_id",
4074
+ "type": "text",
4075
+ "primaryKey": false,
4076
+ "notNull": true
4077
+ },
4078
+ "message_id": {
4079
+ "name": "message_id",
4080
+ "type": "text",
4081
+ "primaryKey": false,
4082
+ "notNull": true
4083
+ },
4084
+ "status": {
4085
+ "name": "status",
4086
+ "type": "text",
4087
+ "primaryKey": false,
4088
+ "notNull": true,
4089
+ "default": "'running'"
4090
+ },
4091
+ "started_at": {
4092
+ "name": "started_at",
4093
+ "type": "timestamp",
4094
+ "primaryKey": false,
4095
+ "notNull": true,
4096
+ "default": "now()"
4097
+ },
4098
+ "ended_at": {
4099
+ "name": "ended_at",
4100
+ "type": "timestamp",
4101
+ "primaryKey": false,
4102
+ "notNull": false
4103
+ },
4104
+ "failure_reason": {
4105
+ "name": "failure_reason",
4106
+ "type": "text",
4107
+ "primaryKey": false,
4108
+ "notNull": false
4109
+ }
4110
+ },
4111
+ "indexes": {
4112
+ "workflow_run_execution_run_id_id_idx": {
4113
+ "name": "workflow_run_execution_run_id_id_idx",
4114
+ "columns": [
4115
+ {
4116
+ "expression": "run_id",
4117
+ "isExpression": false,
4118
+ "asc": true,
4119
+ "nulls": "last"
4120
+ },
4121
+ {
4122
+ "expression": "id",
4123
+ "isExpression": false,
4124
+ "asc": true,
4125
+ "nulls": "last"
4126
+ }
4127
+ ],
4128
+ "isUnique": true,
4129
+ "concurrently": false,
4130
+ "method": "btree",
4131
+ "with": {}
4132
+ },
4133
+ "workflow_run_execution_status_idx": {
4134
+ "name": "workflow_run_execution_status_idx",
4135
+ "columns": [
4136
+ {
4137
+ "expression": "status",
4138
+ "isExpression": false,
4139
+ "asc": true,
4140
+ "nulls": "last"
4141
+ }
4142
+ ],
4143
+ "isUnique": false,
4144
+ "concurrently": false,
4145
+ "method": "btree",
4146
+ "with": {}
4147
+ }
4148
+ },
4149
+ "foreignKeys": {
4150
+ "workflow_run_execution_run_id_workflow_run_id_fk": {
4151
+ "name": "workflow_run_execution_run_id_workflow_run_id_fk",
4152
+ "tableFrom": "workflow_run_execution",
4153
+ "tableTo": "workflow_run",
4154
+ "columnsFrom": ["run_id"],
4155
+ "columnsTo": ["id"],
4156
+ "onDelete": "cascade",
4157
+ "onUpdate": "no action"
4158
+ }
4159
+ },
4160
+ "compositePrimaryKeys": {},
4161
+ "uniqueConstraints": {},
4162
+ "policies": {},
4163
+ "checkConstraints": {},
4164
+ "isRLSEnabled": false
4165
+ },
4166
+ "public.workflow_probe": {
4167
+ "name": "workflow_probe",
4168
+ "schema": "",
4169
+ "columns": {
4170
+ "id": {
4171
+ "name": "id",
4172
+ "type": "text",
4173
+ "primaryKey": true,
4174
+ "notNull": true
4175
+ },
4176
+ "tenant_id": {
4177
+ "name": "tenant_id",
4178
+ "type": "text",
4179
+ "primaryKey": false,
4180
+ "notNull": true
4181
+ },
4182
+ "definition_asset_id": {
4183
+ "name": "definition_asset_id",
4184
+ "type": "text",
4185
+ "primaryKey": false,
4186
+ "notNull": true
4187
+ },
4188
+ "source": {
4189
+ "name": "source",
4190
+ "type": "jsonb",
4191
+ "primaryKey": false,
4192
+ "notNull": true
4193
+ },
4194
+ "entry": {
4195
+ "name": "entry",
4196
+ "type": "text",
4197
+ "primaryKey": false,
4198
+ "notNull": true
4199
+ },
4200
+ "pin": {
4201
+ "name": "pin",
4202
+ "type": "text",
4203
+ "primaryKey": false,
4204
+ "notNull": false
4205
+ },
4206
+ "status": {
4207
+ "name": "status",
4208
+ "type": "text",
4209
+ "primaryKey": false,
4210
+ "notNull": true,
4211
+ "default": "'pending'"
4212
+ },
4213
+ "provisioner_id": {
4214
+ "name": "provisioner_id",
4215
+ "type": "text",
4216
+ "primaryKey": false,
4217
+ "notNull": true
4218
+ },
4219
+ "provisioner_api_version": {
4220
+ "name": "provisioner_api_version",
4221
+ "type": "integer",
4222
+ "primaryKey": false,
4223
+ "notNull": true
4224
+ },
4225
+ "provisioner_binding_fingerprint": {
4226
+ "name": "provisioner_binding_fingerprint",
4227
+ "type": "text",
4228
+ "primaryKey": false,
4229
+ "notNull": true
4230
+ },
4231
+ "sidecar_id": {
4232
+ "name": "sidecar_id",
4233
+ "type": "text",
4234
+ "primaryKey": false,
4235
+ "notNull": false
4236
+ },
4237
+ "generation": {
4238
+ "name": "generation",
4239
+ "type": "integer",
4240
+ "primaryKey": false,
4241
+ "notNull": true,
4242
+ "default": 0
4243
+ },
4244
+ "external_ref": {
4245
+ "name": "external_ref",
4246
+ "type": "text",
4247
+ "primaryKey": false,
4248
+ "notNull": false
4249
+ },
4250
+ "result": {
4251
+ "name": "result",
4252
+ "type": "jsonb",
4253
+ "primaryKey": false,
4254
+ "notNull": false
4255
+ },
4256
+ "failure_code": {
4257
+ "name": "failure_code",
4258
+ "type": "text",
4259
+ "primaryKey": false,
4260
+ "notNull": false
4261
+ },
4262
+ "failure_message": {
4263
+ "name": "failure_message",
4264
+ "type": "text",
4265
+ "primaryKey": false,
4266
+ "notNull": false
4267
+ },
4268
+ "created_at": {
4269
+ "name": "created_at",
4270
+ "type": "timestamp",
4271
+ "primaryKey": false,
4272
+ "notNull": true,
4273
+ "default": "now()"
4274
+ },
4275
+ "updated_at": {
4276
+ "name": "updated_at",
4277
+ "type": "timestamp",
4278
+ "primaryKey": false,
4279
+ "notNull": true,
4280
+ "default": "now()"
4281
+ }
4282
+ },
4283
+ "indexes": {
4284
+ "workflow_probe_active_idx": {
4285
+ "name": "workflow_probe_active_idx",
4286
+ "columns": [
4287
+ {
4288
+ "expression": "created_at",
4289
+ "isExpression": false,
4290
+ "asc": true,
4291
+ "nulls": "last"
4292
+ }
4293
+ ],
4294
+ "isUnique": false,
4295
+ "where": "\"workflow_probe\".\"status\" in ('pending', 'provisioning', 'probing', 'releasing')",
4296
+ "concurrently": false,
4297
+ "method": "btree",
4298
+ "with": {}
4299
+ },
4300
+ "workflow_probe_sidecar_idx": {
4301
+ "name": "workflow_probe_sidecar_idx",
4302
+ "columns": [
4303
+ {
4304
+ "expression": "sidecar_id",
4305
+ "isExpression": false,
4306
+ "asc": true,
4307
+ "nulls": "last"
4308
+ }
4309
+ ],
4310
+ "isUnique": false,
4311
+ "concurrently": false,
4312
+ "method": "btree",
4313
+ "with": {}
4314
+ }
4315
+ },
4316
+ "foreignKeys": {
4317
+ "workflow_probe_tenant_id_tenant_id_fk": {
4318
+ "name": "workflow_probe_tenant_id_tenant_id_fk",
4319
+ "tableFrom": "workflow_probe",
4320
+ "tableTo": "tenant",
4321
+ "columnsFrom": ["tenant_id"],
4322
+ "columnsTo": ["id"],
4323
+ "onDelete": "restrict",
4324
+ "onUpdate": "no action"
4325
+ },
4326
+ "workflow_probe_definition_asset_id_asset_id_fk": {
4327
+ "name": "workflow_probe_definition_asset_id_asset_id_fk",
4328
+ "tableFrom": "workflow_probe",
4329
+ "tableTo": "asset",
4330
+ "columnsFrom": ["definition_asset_id"],
4331
+ "columnsTo": ["id"],
4332
+ "onDelete": "restrict",
4333
+ "onUpdate": "no action"
4334
+ },
4335
+ "workflow_probe_sidecar_id_sidecar_id_fk": {
4336
+ "name": "workflow_probe_sidecar_id_sidecar_id_fk",
4337
+ "tableFrom": "workflow_probe",
4338
+ "tableTo": "sidecar",
4339
+ "columnsFrom": ["sidecar_id"],
4340
+ "columnsTo": ["id"],
4341
+ "onDelete": "restrict",
4342
+ "onUpdate": "no action"
4343
+ }
4344
+ },
4345
+ "compositePrimaryKeys": {},
4346
+ "uniqueConstraints": {},
4347
+ "policies": {},
4348
+ "checkConstraints": {
4349
+ "workflow_probe_status_check": {
4350
+ "name": "workflow_probe_status_check",
4351
+ "value": "\"workflow_probe\".\"status\" in ('pending', 'provisioning', 'probing', 'releasing', 'succeeded', 'failed')"
4352
+ },
4353
+ "workflow_probe_succeeded_result_check": {
4354
+ "name": "workflow_probe_succeeded_result_check",
4355
+ "value": "\"workflow_probe\".\"status\" <> 'succeeded' or \"workflow_probe\".\"result\" is not null"
4356
+ },
4357
+ "workflow_probe_generation_check": {
4358
+ "name": "workflow_probe_generation_check",
4359
+ "value": "\"workflow_probe\".\"generation\" >= 0"
4360
+ }
4361
+ },
4362
+ "isRLSEnabled": false
4363
+ }
4364
+ },
4365
+ "enums": {},
4366
+ "schemas": {},
4367
+ "sequences": {},
4368
+ "roles": {},
4369
+ "policies": {},
4370
+ "views": {},
4371
+ "_meta": {
4372
+ "columns": {},
4373
+ "schemas": {},
4374
+ "tables": {}
4375
+ }
4376
+ }