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