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