@intx/db 0.1.2 → 0.3.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 (241) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +23 -4
  3. package/dist/approval-store.d.ts +52 -0
  4. package/dist/approval-store.js +79 -0
  5. package/dist/asset-resolution.d.ts +52 -0
  6. package/dist/asset-resolution.js +66 -0
  7. package/dist/catalog-resolution.d.ts +76 -0
  8. package/dist/catalog-resolution.js +151 -0
  9. package/dist/client.d.ts +19 -0
  10. package/dist/client.js +18 -0
  11. package/dist/config.d.ts +11 -0
  12. package/dist/config.js +16 -0
  13. package/dist/connection.d.ts +3 -0
  14. package/dist/connection.js +26 -0
  15. package/dist/credential-resolution.d.ts +222 -0
  16. package/dist/credential-resolution.js +255 -0
  17. package/dist/grant-store.d.ts +3 -0
  18. package/dist/grant-store.js +59 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.js +20 -0
  21. package/dist/migrate.d.ts +36 -0
  22. package/dist/migrate.js +135 -0
  23. package/dist/model-source-resolution.d.ts +115 -0
  24. package/dist/model-source-resolution.js +291 -0
  25. package/dist/parse-row.d.ts +373 -0
  26. package/dist/parse-row.js +232 -0
  27. package/dist/pg-error.d.ts +3 -0
  28. package/dist/pg-error.js +19 -0
  29. package/dist/pricing.d.ts +15 -0
  30. package/dist/pricing.js +24 -0
  31. package/dist/rekey-credential-secrets.d.ts +13 -0
  32. package/dist/rekey-credential-secrets.js +61 -0
  33. package/dist/schema/approvals.d.ts +245 -0
  34. package/dist/schema/approvals.js +52 -0
  35. package/dist/schema/assets.d.ts +143 -0
  36. package/{src/schema/assets.ts → dist/schema/assets.js} +7 -16
  37. package/dist/schema/auth.d.ts +606 -0
  38. package/dist/schema/auth.js +47 -0
  39. package/dist/schema/catalog.d.ts +811 -0
  40. package/dist/schema/catalog.js +108 -0
  41. package/dist/schema/column-types.d.ts +26 -0
  42. package/dist/schema/column-types.js +15 -0
  43. package/dist/schema/credentials.d.ts +305 -0
  44. package/{src/schema/credentials.ts → dist/schema/credentials.js} +16 -22
  45. package/dist/schema/git-tokens.d.ts +256 -0
  46. package/{src/schema/git-tokens.ts → dist/schema/git-tokens.js} +16 -39
  47. package/dist/schema/grants.d.ts +211 -0
  48. package/dist/schema/grants.js +30 -0
  49. package/dist/schema/index.d.ts +25 -0
  50. package/dist/schema/index.js +25 -0
  51. package/dist/schema/messages.d.ts +414 -0
  52. package/dist/schema/messages.js +82 -0
  53. package/dist/schema/oauth-clients.d.ts +246 -0
  54. package/{src/schema/oauth-clients.ts → dist/schema/oauth-clients.js} +8 -14
  55. package/dist/schema/offerings.d.ts +160 -0
  56. package/dist/schema/offerings.js +24 -0
  57. package/dist/schema/principals.d.ts +128 -0
  58. package/dist/schema/principals.js +23 -0
  59. package/dist/schema/providers.d.ts +237 -0
  60. package/dist/schema/providers.js +22 -0
  61. package/dist/schema/roles.d.ts +242 -0
  62. package/dist/schema/roles.js +37 -0
  63. package/dist/schema/session-assets.d.ts +92 -0
  64. package/dist/schema/session-assets.js +45 -0
  65. package/dist/schema/sessions.d.ts +143 -0
  66. package/dist/schema/sessions.js +29 -0
  67. package/dist/schema/sidecar-allocation.d.ts +406 -0
  68. package/dist/schema/sidecar-allocation.js +57 -0
  69. package/dist/schema/sidecar.d.ts +145 -0
  70. package/dist/schema/sidecar.js +28 -0
  71. package/dist/schema/signal-correlations.d.ts +177 -0
  72. package/dist/schema/signal-correlations.js +31 -0
  73. package/dist/schema/tenants.d.ts +235 -0
  74. package/{src/schema/tenants.ts → dist/schema/tenants.js} +10 -27
  75. package/dist/schema/wallets.d.ts +354 -0
  76. package/dist/schema/wallets.js +43 -0
  77. package/dist/schema/workflow-definitions.d.ts +371 -0
  78. package/dist/schema/workflow-definitions.js +97 -0
  79. package/dist/schema/workflow-run-dispatch.d.ts +328 -0
  80. package/dist/schema/workflow-run-dispatch.js +56 -0
  81. package/dist/schema/workflow-run-execution.d.ts +126 -0
  82. package/dist/schema/workflow-run-execution.js +48 -0
  83. package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
  84. package/dist/schema/workflow-run-launch-spec.js +26 -0
  85. package/dist/schema/workflow-run.d.ts +230 -0
  86. package/dist/schema/workflow-run.js +102 -0
  87. package/dist/sidecar-allocation-store.d.ts +171 -0
  88. package/dist/sidecar-allocation-store.js +512 -0
  89. package/dist/signal-correlation-store.d.ts +36 -0
  90. package/dist/signal-correlation-store.js +63 -0
  91. package/dist/tenant-hierarchy.d.ts +23 -0
  92. package/dist/tenant-hierarchy.js +60 -0
  93. package/dist/workflow-definition-store.d.ts +55 -0
  94. package/dist/workflow-definition-store.js +93 -0
  95. package/dist/workflow-run-dispatch-store.d.ts +80 -0
  96. package/dist/workflow-run-dispatch-store.js +298 -0
  97. package/dist/workflow-run-launch-spec-store.d.ts +13 -0
  98. package/dist/workflow-run-launch-spec-store.js +30 -0
  99. package/dist/workflow-run-store.d.ts +54 -0
  100. package/dist/workflow-run-store.js +85 -0
  101. package/migrations/0029_loose_warlock.sql +1 -0
  102. package/migrations/0030_session_asset_audit_split.sql +5 -0
  103. package/migrations/0031_gigantic_nicolaos.sql +68 -0
  104. package/migrations/0032_lethal_misty_knight.sql +1 -0
  105. package/migrations/0033_old_payback.sql +1 -0
  106. package/migrations/0034_sleepy_songbird.sql +11 -0
  107. package/migrations/0035_violet_giant_man.sql +3 -0
  108. package/migrations/0036_sharp_the_executioner.sql +2 -0
  109. package/migrations/0037_credential_use_backfill.sql +39 -0
  110. package/migrations/0038_chilly_blacklash.sql +37 -0
  111. package/migrations/0039_quick_carnage.sql +2 -0
  112. package/migrations/0040_reshape_approval_origin.sql +24 -0
  113. package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
  114. package/migrations/0042_youthful_mantis.sql +2 -0
  115. package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
  116. package/migrations/0044_model_offering_quirks.sql +1 -0
  117. package/migrations/0045_create_workflow_run.sql +13 -0
  118. package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
  119. package/migrations/0047_create_workflow_definition.sql +30 -0
  120. package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
  121. package/migrations/0049_curly_omega_flight.sql +2 -0
  122. package/migrations/0050_late_crystal.sql +10 -0
  123. package/migrations/0051_funny_madelyne_pryor.sql +1 -0
  124. package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
  125. package/migrations/0053_session_mail_session_id_index.sql +1 -0
  126. package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
  127. package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
  128. package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
  129. package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
  130. package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
  131. package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
  132. package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
  133. package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
  134. package/migrations/0062_drop_agent_asset_table.sql +11 -0
  135. package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
  136. package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
  137. package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
  138. package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
  139. package/migrations/0067_add_workflow_definition_kind.sql +10 -0
  140. package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
  141. package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
  142. package/migrations/0070_flashy_proteus.sql +13 -0
  143. package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
  144. package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
  145. package/migrations/0074_add_provider_api_base_url.sql +1 -0
  146. package/migrations/0075_workflow_run_launch_spec.sql +17 -0
  147. package/migrations/0076_sidecar_allocation.sql +40 -0
  148. package/migrations/0077_workflow_run_dispatch.sql +29 -0
  149. package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
  150. package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
  151. package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
  152. package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
  153. package/migrations/0082_blue_black_queen.sql +1 -0
  154. package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
  155. package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
  156. package/migrations/meta/0029_snapshot.json +2664 -0
  157. package/migrations/meta/0030_snapshot.json +2670 -0
  158. package/migrations/meta/0031_snapshot.json +3100 -0
  159. package/migrations/meta/0032_snapshot.json +3106 -0
  160. package/migrations/meta/0033_snapshot.json +3112 -0
  161. package/migrations/meta/0034_snapshot.json +3198 -0
  162. package/migrations/meta/0035_snapshot.json +3225 -0
  163. package/migrations/meta/0036_snapshot.json +3237 -0
  164. package/migrations/meta/0037_snapshot.json +3237 -0
  165. package/migrations/meta/0038_snapshot.json +3470 -0
  166. package/migrations/meta/0039_snapshot.json +3470 -0
  167. package/migrations/meta/0040_snapshot.json +3489 -0
  168. package/migrations/meta/0041_snapshot.json +3489 -0
  169. package/migrations/meta/0042_snapshot.json +3489 -0
  170. package/migrations/meta/0043_snapshot.json +3498 -0
  171. package/migrations/meta/0044_snapshot.json +3504 -0
  172. package/migrations/meta/0045_snapshot.json +3589 -0
  173. package/migrations/meta/0046_snapshot.json +3607 -0
  174. package/migrations/meta/0047_snapshot.json +3832 -0
  175. package/migrations/meta/0048_snapshot.json +3853 -0
  176. package/migrations/meta/0049_snapshot.json +3854 -0
  177. package/migrations/meta/0050_snapshot.json +3924 -0
  178. package/migrations/meta/0051_snapshot.json +3940 -0
  179. package/migrations/meta/0052_snapshot.json +3931 -0
  180. package/migrations/meta/0053_snapshot.json +3952 -0
  181. package/migrations/meta/0054_snapshot.json +3952 -0
  182. package/migrations/meta/0055_snapshot.json +3952 -0
  183. package/migrations/meta/0056_snapshot.json +3952 -0
  184. package/migrations/meta/0057_snapshot.json +3839 -0
  185. package/migrations/meta/0058_snapshot.json +3839 -0
  186. package/migrations/meta/0059_snapshot.json +3839 -0
  187. package/migrations/meta/0060_snapshot.json +3830 -0
  188. package/migrations/meta/0061_snapshot.json +3821 -0
  189. package/migrations/meta/0062_snapshot.json +3723 -0
  190. package/migrations/meta/0063_snapshot.json +3723 -0
  191. package/migrations/meta/0064_snapshot.json +3723 -0
  192. package/migrations/meta/0065_snapshot.json +3729 -0
  193. package/migrations/meta/0066_snapshot.json +3729 -0
  194. package/migrations/meta/0067_snapshot.json +3736 -0
  195. package/migrations/meta/0068_snapshot.json +3347 -0
  196. package/migrations/meta/0069_snapshot.json +3340 -0
  197. package/migrations/meta/0070_snapshot.json +3444 -0
  198. package/migrations/meta/0072_snapshot.json +3450 -0
  199. package/migrations/meta/0073_snapshot.json +3455 -0
  200. package/migrations/meta/0074_snapshot.json +3461 -0
  201. package/migrations/meta/0075_snapshot.json +3567 -0
  202. package/migrations/meta/0076_snapshot.json +3851 -0
  203. package/migrations/meta/0077_snapshot.json +4067 -0
  204. package/migrations/meta/0078_snapshot.json +4078 -0
  205. package/migrations/meta/0079_snapshot.json +4078 -0
  206. package/migrations/meta/0080_snapshot.json +4078 -0
  207. package/migrations/meta/0081_snapshot.json +4096 -0
  208. package/migrations/meta/0082_snapshot.json +4102 -0
  209. package/migrations/meta/0083_snapshot.json +4096 -0
  210. package/migrations/meta/0084_snapshot.json +4096 -0
  211. package/migrations/meta/_journal.json +385 -0
  212. package/package.json +25 -11
  213. package/drizzle.config.ts +0 -23
  214. package/src/client.ts +0 -24
  215. package/src/config.ts +0 -19
  216. package/src/connection.ts +0 -27
  217. package/src/credential-resolution.ts +0 -378
  218. package/src/grant-store.ts +0 -51
  219. package/src/index.ts +0 -32
  220. package/src/migrate.test.ts +0 -35
  221. package/src/migrate.ts +0 -168
  222. package/src/parse-row.test.ts +0 -113
  223. package/src/parse-row.ts +0 -185
  224. package/src/schema/agent-assets.ts +0 -21
  225. package/src/schema/agents.ts +0 -49
  226. package/src/schema/auth.ts +0 -51
  227. package/src/schema/grants.ts +0 -26
  228. package/src/schema/index.ts +0 -19
  229. package/src/schema/instances.ts +0 -36
  230. package/src/schema/messages.ts +0 -108
  231. package/src/schema/offerings.ts +0 -20
  232. package/src/schema/principals.ts +0 -28
  233. package/src/schema/providers.ts +0 -23
  234. package/src/schema/roles.ts +0 -51
  235. package/src/schema/session-assets.ts +0 -49
  236. package/src/schema/sessions.ts +0 -26
  237. package/src/schema/sidecar.ts +0 -14
  238. package/src/schema/wallets.ts +0 -44
  239. package/src/tenant-hierarchy.ts +0 -34
  240. package/tsconfig.json +0 -4
  241. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,3444 @@
1
+ {
2
+ "id": "570a2dd4-c131-4b41-8d99-872451640682",
3
+ "prevId": "9a881cd0-1493-44db-bec3-ffa62fa67348",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_workflow_definition_id_fk": {
557
+ "name": "agent_role_agent_id_workflow_definition_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "tableTo": "workflow_definition",
560
+ "columnsFrom": ["agent_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "agent_role_agent_id_role_id_pk": {
577
+ "name": "agent_role_agent_id_role_id_pk",
578
+ "columns": ["agent_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.principal_role": {
587
+ "name": "principal_role",
588
+ "schema": "",
589
+ "columns": {
590
+ "principal_id": {
591
+ "name": "principal_id",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "role_id": {
597
+ "name": "role_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "principal_role_principal_id_principal_id_fk": {
613
+ "name": "principal_role_principal_id_principal_id_fk",
614
+ "tableFrom": "principal_role",
615
+ "tableTo": "principal",
616
+ "columnsFrom": ["principal_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "tableTo": "role",
625
+ "columnsFrom": ["role_id"],
626
+ "columnsTo": ["id"],
627
+ "onDelete": "cascade",
628
+ "onUpdate": "no action"
629
+ }
630
+ },
631
+ "compositePrimaryKeys": {
632
+ "principal_role_principal_id_role_id_pk": {
633
+ "name": "principal_role_principal_id_role_id_pk",
634
+ "columns": ["principal_id", "role_id"]
635
+ }
636
+ },
637
+ "uniqueConstraints": {},
638
+ "policies": {},
639
+ "checkConstraints": {},
640
+ "isRLSEnabled": false
641
+ },
642
+ "public.role": {
643
+ "name": "role",
644
+ "schema": "",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "name": {
659
+ "name": "name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "is_system": {
671
+ "name": "is_system",
672
+ "type": "boolean",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": false
676
+ },
677
+ "created_at": {
678
+ "name": "created_at",
679
+ "type": "timestamp",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "default": "now()"
683
+ },
684
+ "updated_at": {
685
+ "name": "updated_at",
686
+ "type": "timestamp",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "default": "now()"
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {
694
+ "role_tenant_id_tenant_id_fk": {
695
+ "name": "role_tenant_id_tenant_id_fk",
696
+ "tableFrom": "role",
697
+ "tableTo": "tenant",
698
+ "columnsFrom": ["tenant_id"],
699
+ "columnsTo": ["id"],
700
+ "onDelete": "cascade",
701
+ "onUpdate": "no action"
702
+ }
703
+ },
704
+ "compositePrimaryKeys": {},
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.grant": {
711
+ "name": "grant",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true
719
+ },
720
+ "tenant_id": {
721
+ "name": "tenant_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "role_id": {
727
+ "name": "role_id",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "principal_id": {
733
+ "name": "principal_id",
734
+ "type": "text",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "resource": {
739
+ "name": "resource",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "action": {
745
+ "name": "action",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "effect": {
751
+ "name": "effect",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "conditions": {
757
+ "name": "conditions",
758
+ "type": "jsonb",
759
+ "primaryKey": false,
760
+ "notNull": false
761
+ },
762
+ "origin": {
763
+ "name": "origin",
764
+ "type": "text",
765
+ "primaryKey": false,
766
+ "notNull": true
767
+ },
768
+ "expires_at": {
769
+ "name": "expires_at",
770
+ "type": "timestamp",
771
+ "primaryKey": false,
772
+ "notNull": false
773
+ },
774
+ "created_at": {
775
+ "name": "created_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ },
781
+ "updated_at": {
782
+ "name": "updated_at",
783
+ "type": "timestamp",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "now()"
787
+ }
788
+ },
789
+ "indexes": {},
790
+ "foreignKeys": {
791
+ "grant_tenant_id_tenant_id_fk": {
792
+ "name": "grant_tenant_id_tenant_id_fk",
793
+ "tableFrom": "grant",
794
+ "tableTo": "tenant",
795
+ "columnsFrom": ["tenant_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "tableTo": "role",
804
+ "columnsFrom": ["role_id"],
805
+ "columnsTo": ["id"],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "tableTo": "principal",
813
+ "columnsFrom": ["principal_id"],
814
+ "columnsTo": ["id"],
815
+ "onDelete": "cascade",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {},
823
+ "isRLSEnabled": false
824
+ },
825
+ "public.approval": {
826
+ "name": "approval",
827
+ "schema": "",
828
+ "columns": {
829
+ "id": {
830
+ "name": "id",
831
+ "type": "text",
832
+ "primaryKey": true,
833
+ "notNull": true
834
+ },
835
+ "tenant_id": {
836
+ "name": "tenant_id",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "deployment_id": {
842
+ "name": "deployment_id",
843
+ "type": "text",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "run_id": {
848
+ "name": "run_id",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "agent_address": {
854
+ "name": "agent_address",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ },
859
+ "correlation_id": {
860
+ "name": "correlation_id",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": true
864
+ },
865
+ "tool_definition": {
866
+ "name": "tool_definition",
867
+ "type": "jsonb",
868
+ "primaryKey": false,
869
+ "notNull": true
870
+ },
871
+ "tool_arguments": {
872
+ "name": "tool_arguments",
873
+ "type": "jsonb",
874
+ "primaryKey": false,
875
+ "notNull": true
876
+ },
877
+ "scope": {
878
+ "name": "scope",
879
+ "type": "text",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "status": {
884
+ "name": "status",
885
+ "type": "text",
886
+ "primaryKey": false,
887
+ "notNull": true,
888
+ "default": "'pending'"
889
+ },
890
+ "timeout_at": {
891
+ "name": "timeout_at",
892
+ "type": "timestamp",
893
+ "primaryKey": false,
894
+ "notNull": false
895
+ },
896
+ "resolved_at": {
897
+ "name": "resolved_at",
898
+ "type": "timestamp",
899
+ "primaryKey": false,
900
+ "notNull": false
901
+ },
902
+ "created_at": {
903
+ "name": "created_at",
904
+ "type": "timestamp",
905
+ "primaryKey": false,
906
+ "notNull": true,
907
+ "default": "now()"
908
+ },
909
+ "updated_at": {
910
+ "name": "updated_at",
911
+ "type": "timestamp",
912
+ "primaryKey": false,
913
+ "notNull": true,
914
+ "default": "now()"
915
+ }
916
+ },
917
+ "indexes": {
918
+ "approval_tenant_status_idx": {
919
+ "name": "approval_tenant_status_idx",
920
+ "columns": [
921
+ {
922
+ "expression": "tenant_id",
923
+ "isExpression": false,
924
+ "asc": true,
925
+ "nulls": "last"
926
+ },
927
+ {
928
+ "expression": "status",
929
+ "isExpression": false,
930
+ "asc": true,
931
+ "nulls": "last"
932
+ },
933
+ {
934
+ "expression": "created_at",
935
+ "isExpression": false,
936
+ "asc": true,
937
+ "nulls": "last"
938
+ }
939
+ ],
940
+ "isUnique": false,
941
+ "concurrently": false,
942
+ "method": "btree",
943
+ "with": {}
944
+ },
945
+ "approval_deployment_idx": {
946
+ "name": "approval_deployment_idx",
947
+ "columns": [
948
+ {
949
+ "expression": "deployment_id",
950
+ "isExpression": false,
951
+ "asc": true,
952
+ "nulls": "last"
953
+ }
954
+ ],
955
+ "isUnique": false,
956
+ "concurrently": false,
957
+ "method": "btree",
958
+ "with": {}
959
+ }
960
+ },
961
+ "foreignKeys": {
962
+ "approval_tenant_id_tenant_id_fk": {
963
+ "name": "approval_tenant_id_tenant_id_fk",
964
+ "tableFrom": "approval",
965
+ "tableTo": "tenant",
966
+ "columnsFrom": ["tenant_id"],
967
+ "columnsTo": ["id"],
968
+ "onDelete": "cascade",
969
+ "onUpdate": "no action"
970
+ },
971
+ "approval_deployment_id_workflow_run_id_fk": {
972
+ "name": "approval_deployment_id_workflow_run_id_fk",
973
+ "tableFrom": "approval",
974
+ "tableTo": "workflow_run",
975
+ "columnsFrom": ["deployment_id"],
976
+ "columnsTo": ["id"],
977
+ "onDelete": "cascade",
978
+ "onUpdate": "no action"
979
+ },
980
+ "approval_run_id_workflow_run_id_fk": {
981
+ "name": "approval_run_id_workflow_run_id_fk",
982
+ "tableFrom": "approval",
983
+ "tableTo": "workflow_run",
984
+ "columnsFrom": ["run_id"],
985
+ "columnsTo": ["id"],
986
+ "onDelete": "cascade",
987
+ "onUpdate": "no action"
988
+ }
989
+ },
990
+ "compositePrimaryKeys": {},
991
+ "uniqueConstraints": {
992
+ "approval_correlation_id_unique": {
993
+ "name": "approval_correlation_id_unique",
994
+ "nullsNotDistinct": false,
995
+ "columns": ["correlation_id"]
996
+ }
997
+ },
998
+ "policies": {},
999
+ "checkConstraints": {},
1000
+ "isRLSEnabled": false
1001
+ },
1002
+ "public.signal_correlation": {
1003
+ "name": "signal_correlation",
1004
+ "schema": "",
1005
+ "columns": {
1006
+ "correlation_id": {
1007
+ "name": "correlation_id",
1008
+ "type": "text",
1009
+ "primaryKey": true,
1010
+ "notNull": true
1011
+ },
1012
+ "tenant_id": {
1013
+ "name": "tenant_id",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "deployment_id": {
1019
+ "name": "deployment_id",
1020
+ "type": "text",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ },
1024
+ "agent_address": {
1025
+ "name": "agent_address",
1026
+ "type": "text",
1027
+ "primaryKey": false,
1028
+ "notNull": true
1029
+ },
1030
+ "run_id": {
1031
+ "name": "run_id",
1032
+ "type": "text",
1033
+ "primaryKey": false,
1034
+ "notNull": true
1035
+ },
1036
+ "signal_name": {
1037
+ "name": "signal_name",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": true
1041
+ },
1042
+ "kind": {
1043
+ "name": "kind",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": true
1047
+ },
1048
+ "signal_id": {
1049
+ "name": "signal_id",
1050
+ "type": "text",
1051
+ "primaryKey": false,
1052
+ "notNull": false
1053
+ },
1054
+ "resolved_at": {
1055
+ "name": "resolved_at",
1056
+ "type": "timestamp",
1057
+ "primaryKey": false,
1058
+ "notNull": false
1059
+ },
1060
+ "created_at": {
1061
+ "name": "created_at",
1062
+ "type": "timestamp",
1063
+ "primaryKey": false,
1064
+ "notNull": true,
1065
+ "default": "now()"
1066
+ }
1067
+ },
1068
+ "indexes": {},
1069
+ "foreignKeys": {
1070
+ "signal_correlation_tenant_id_tenant_id_fk": {
1071
+ "name": "signal_correlation_tenant_id_tenant_id_fk",
1072
+ "tableFrom": "signal_correlation",
1073
+ "tableTo": "tenant",
1074
+ "columnsFrom": ["tenant_id"],
1075
+ "columnsTo": ["id"],
1076
+ "onDelete": "cascade",
1077
+ "onUpdate": "no action"
1078
+ },
1079
+ "signal_correlation_deployment_id_workflow_run_id_fk": {
1080
+ "name": "signal_correlation_deployment_id_workflow_run_id_fk",
1081
+ "tableFrom": "signal_correlation",
1082
+ "tableTo": "workflow_run",
1083
+ "columnsFrom": ["deployment_id"],
1084
+ "columnsTo": ["id"],
1085
+ "onDelete": "cascade",
1086
+ "onUpdate": "no action"
1087
+ },
1088
+ "signal_correlation_run_id_workflow_run_id_fk": {
1089
+ "name": "signal_correlation_run_id_workflow_run_id_fk",
1090
+ "tableFrom": "signal_correlation",
1091
+ "tableTo": "workflow_run",
1092
+ "columnsFrom": ["run_id"],
1093
+ "columnsTo": ["id"],
1094
+ "onDelete": "cascade",
1095
+ "onUpdate": "no action"
1096
+ }
1097
+ },
1098
+ "compositePrimaryKeys": {},
1099
+ "uniqueConstraints": {},
1100
+ "policies": {},
1101
+ "checkConstraints": {},
1102
+ "isRLSEnabled": false
1103
+ },
1104
+ "public.provider": {
1105
+ "name": "provider",
1106
+ "schema": "",
1107
+ "columns": {
1108
+ "id": {
1109
+ "name": "id",
1110
+ "type": "text",
1111
+ "primaryKey": true,
1112
+ "notNull": true
1113
+ },
1114
+ "tenant_id": {
1115
+ "name": "tenant_id",
1116
+ "type": "text",
1117
+ "primaryKey": false,
1118
+ "notNull": true
1119
+ },
1120
+ "name": {
1121
+ "name": "name",
1122
+ "type": "text",
1123
+ "primaryKey": false,
1124
+ "notNull": true
1125
+ },
1126
+ "plugin": {
1127
+ "name": "plugin",
1128
+ "type": "text",
1129
+ "primaryKey": false,
1130
+ "notNull": true
1131
+ },
1132
+ "authorization_url": {
1133
+ "name": "authorization_url",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": false
1137
+ },
1138
+ "token_url": {
1139
+ "name": "token_url",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": false
1143
+ },
1144
+ "user_info_url": {
1145
+ "name": "user_info_url",
1146
+ "type": "text",
1147
+ "primaryKey": false,
1148
+ "notNull": false
1149
+ },
1150
+ "scopes": {
1151
+ "name": "scopes",
1152
+ "type": "text[]",
1153
+ "primaryKey": false,
1154
+ "notNull": false
1155
+ },
1156
+ "metadata": {
1157
+ "name": "metadata",
1158
+ "type": "jsonb",
1159
+ "primaryKey": false,
1160
+ "notNull": false
1161
+ },
1162
+ "created_at": {
1163
+ "name": "created_at",
1164
+ "type": "timestamp",
1165
+ "primaryKey": false,
1166
+ "notNull": true,
1167
+ "default": "now()"
1168
+ },
1169
+ "updated_at": {
1170
+ "name": "updated_at",
1171
+ "type": "timestamp",
1172
+ "primaryKey": false,
1173
+ "notNull": true,
1174
+ "default": "now()"
1175
+ }
1176
+ },
1177
+ "indexes": {},
1178
+ "foreignKeys": {
1179
+ "provider_tenant_id_tenant_id_fk": {
1180
+ "name": "provider_tenant_id_tenant_id_fk",
1181
+ "tableFrom": "provider",
1182
+ "tableTo": "tenant",
1183
+ "columnsFrom": ["tenant_id"],
1184
+ "columnsTo": ["id"],
1185
+ "onDelete": "cascade",
1186
+ "onUpdate": "no action"
1187
+ }
1188
+ },
1189
+ "compositePrimaryKeys": {},
1190
+ "uniqueConstraints": {
1191
+ "provider_tenant_name": {
1192
+ "name": "provider_tenant_name",
1193
+ "nullsNotDistinct": false,
1194
+ "columns": ["tenant_id", "name"]
1195
+ }
1196
+ },
1197
+ "policies": {},
1198
+ "checkConstraints": {},
1199
+ "isRLSEnabled": false
1200
+ },
1201
+ "public.oauth_client": {
1202
+ "name": "oauth_client",
1203
+ "schema": "",
1204
+ "columns": {
1205
+ "id": {
1206
+ "name": "id",
1207
+ "type": "text",
1208
+ "primaryKey": true,
1209
+ "notNull": true
1210
+ },
1211
+ "tenant_id": {
1212
+ "name": "tenant_id",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": true
1216
+ },
1217
+ "provider_id": {
1218
+ "name": "provider_id",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": true
1222
+ },
1223
+ "name": {
1224
+ "name": "name",
1225
+ "type": "text",
1226
+ "primaryKey": false,
1227
+ "notNull": true
1228
+ },
1229
+ "client_id": {
1230
+ "name": "client_id",
1231
+ "type": "text",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "client_secret": {
1236
+ "name": "client_secret",
1237
+ "type": "text",
1238
+ "primaryKey": false,
1239
+ "notNull": true
1240
+ },
1241
+ "redirect_uris": {
1242
+ "name": "redirect_uris",
1243
+ "type": "text[]",
1244
+ "primaryKey": false,
1245
+ "notNull": false
1246
+ },
1247
+ "default_scopes": {
1248
+ "name": "default_scopes",
1249
+ "type": "text[]",
1250
+ "primaryKey": false,
1251
+ "notNull": false
1252
+ },
1253
+ "metadata": {
1254
+ "name": "metadata",
1255
+ "type": "jsonb",
1256
+ "primaryKey": false,
1257
+ "notNull": false
1258
+ },
1259
+ "created_at": {
1260
+ "name": "created_at",
1261
+ "type": "timestamp",
1262
+ "primaryKey": false,
1263
+ "notNull": true,
1264
+ "default": "now()"
1265
+ },
1266
+ "updated_at": {
1267
+ "name": "updated_at",
1268
+ "type": "timestamp",
1269
+ "primaryKey": false,
1270
+ "notNull": true,
1271
+ "default": "now()"
1272
+ }
1273
+ },
1274
+ "indexes": {},
1275
+ "foreignKeys": {
1276
+ "oauth_client_tenant_id_tenant_id_fk": {
1277
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1278
+ "tableFrom": "oauth_client",
1279
+ "tableTo": "tenant",
1280
+ "columnsFrom": ["tenant_id"],
1281
+ "columnsTo": ["id"],
1282
+ "onDelete": "cascade",
1283
+ "onUpdate": "no action"
1284
+ },
1285
+ "oauth_client_provider_id_provider_id_fk": {
1286
+ "name": "oauth_client_provider_id_provider_id_fk",
1287
+ "tableFrom": "oauth_client",
1288
+ "tableTo": "provider",
1289
+ "columnsFrom": ["provider_id"],
1290
+ "columnsTo": ["id"],
1291
+ "onDelete": "cascade",
1292
+ "onUpdate": "no action"
1293
+ }
1294
+ },
1295
+ "compositePrimaryKeys": {},
1296
+ "uniqueConstraints": {
1297
+ "oauth_client_tenant_provider": {
1298
+ "name": "oauth_client_tenant_provider",
1299
+ "nullsNotDistinct": false,
1300
+ "columns": ["tenant_id", "provider_id"]
1301
+ }
1302
+ },
1303
+ "policies": {},
1304
+ "checkConstraints": {},
1305
+ "isRLSEnabled": false
1306
+ },
1307
+ "public.credential": {
1308
+ "name": "credential",
1309
+ "schema": "",
1310
+ "columns": {
1311
+ "id": {
1312
+ "name": "id",
1313
+ "type": "text",
1314
+ "primaryKey": true,
1315
+ "notNull": true
1316
+ },
1317
+ "tenant_id": {
1318
+ "name": "tenant_id",
1319
+ "type": "text",
1320
+ "primaryKey": false,
1321
+ "notNull": true
1322
+ },
1323
+ "principal_id": {
1324
+ "name": "principal_id",
1325
+ "type": "text",
1326
+ "primaryKey": false,
1327
+ "notNull": false
1328
+ },
1329
+ "provider_id": {
1330
+ "name": "provider_id",
1331
+ "type": "text",
1332
+ "primaryKey": false,
1333
+ "notNull": true
1334
+ },
1335
+ "oauth_client_id": {
1336
+ "name": "oauth_client_id",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "name": {
1342
+ "name": "name",
1343
+ "type": "text",
1344
+ "primaryKey": false,
1345
+ "notNull": true
1346
+ },
1347
+ "type": {
1348
+ "name": "type",
1349
+ "type": "text",
1350
+ "primaryKey": false,
1351
+ "notNull": true
1352
+ },
1353
+ "description": {
1354
+ "name": "description",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": false
1358
+ },
1359
+ "secret": {
1360
+ "name": "secret",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": true
1364
+ },
1365
+ "refresh_secret": {
1366
+ "name": "refresh_secret",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": false
1370
+ },
1371
+ "scopes": {
1372
+ "name": "scopes",
1373
+ "type": "text[]",
1374
+ "primaryKey": false,
1375
+ "notNull": false
1376
+ },
1377
+ "expires_at": {
1378
+ "name": "expires_at",
1379
+ "type": "timestamp",
1380
+ "primaryKey": false,
1381
+ "notNull": false
1382
+ },
1383
+ "status": {
1384
+ "name": "status",
1385
+ "type": "text",
1386
+ "primaryKey": false,
1387
+ "notNull": true,
1388
+ "default": "'active'"
1389
+ },
1390
+ "metadata": {
1391
+ "name": "metadata",
1392
+ "type": "jsonb",
1393
+ "primaryKey": false,
1394
+ "notNull": false
1395
+ },
1396
+ "created_at": {
1397
+ "name": "created_at",
1398
+ "type": "timestamp",
1399
+ "primaryKey": false,
1400
+ "notNull": true,
1401
+ "default": "now()"
1402
+ },
1403
+ "updated_at": {
1404
+ "name": "updated_at",
1405
+ "type": "timestamp",
1406
+ "primaryKey": false,
1407
+ "notNull": true,
1408
+ "default": "now()"
1409
+ }
1410
+ },
1411
+ "indexes": {},
1412
+ "foreignKeys": {
1413
+ "credential_tenant_id_tenant_id_fk": {
1414
+ "name": "credential_tenant_id_tenant_id_fk",
1415
+ "tableFrom": "credential",
1416
+ "tableTo": "tenant",
1417
+ "columnsFrom": ["tenant_id"],
1418
+ "columnsTo": ["id"],
1419
+ "onDelete": "cascade",
1420
+ "onUpdate": "no action"
1421
+ },
1422
+ "credential_principal_id_principal_id_fk": {
1423
+ "name": "credential_principal_id_principal_id_fk",
1424
+ "tableFrom": "credential",
1425
+ "tableTo": "principal",
1426
+ "columnsFrom": ["principal_id"],
1427
+ "columnsTo": ["id"],
1428
+ "onDelete": "set null",
1429
+ "onUpdate": "no action"
1430
+ },
1431
+ "credential_provider_id_provider_id_fk": {
1432
+ "name": "credential_provider_id_provider_id_fk",
1433
+ "tableFrom": "credential",
1434
+ "tableTo": "provider",
1435
+ "columnsFrom": ["provider_id"],
1436
+ "columnsTo": ["id"],
1437
+ "onDelete": "cascade",
1438
+ "onUpdate": "no action"
1439
+ },
1440
+ "credential_oauth_client_id_oauth_client_id_fk": {
1441
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1442
+ "tableFrom": "credential",
1443
+ "tableTo": "oauth_client",
1444
+ "columnsFrom": ["oauth_client_id"],
1445
+ "columnsTo": ["id"],
1446
+ "onDelete": "set null",
1447
+ "onUpdate": "no action"
1448
+ }
1449
+ },
1450
+ "compositePrimaryKeys": {},
1451
+ "uniqueConstraints": {
1452
+ "credential_tenant_name": {
1453
+ "name": "credential_tenant_name",
1454
+ "nullsNotDistinct": false,
1455
+ "columns": ["tenant_id", "name"]
1456
+ }
1457
+ },
1458
+ "policies": {},
1459
+ "checkConstraints": {},
1460
+ "isRLSEnabled": false
1461
+ },
1462
+ "public.asset": {
1463
+ "name": "asset",
1464
+ "schema": "",
1465
+ "columns": {
1466
+ "id": {
1467
+ "name": "id",
1468
+ "type": "text",
1469
+ "primaryKey": true,
1470
+ "notNull": true
1471
+ },
1472
+ "tenant_id": {
1473
+ "name": "tenant_id",
1474
+ "type": "text",
1475
+ "primaryKey": false,
1476
+ "notNull": true
1477
+ },
1478
+ "kind": {
1479
+ "name": "kind",
1480
+ "type": "text",
1481
+ "primaryKey": false,
1482
+ "notNull": true
1483
+ },
1484
+ "name": {
1485
+ "name": "name",
1486
+ "type": "text",
1487
+ "primaryKey": false,
1488
+ "notNull": true
1489
+ },
1490
+ "display_name": {
1491
+ "name": "display_name",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": false
1495
+ },
1496
+ "creator_principal_id": {
1497
+ "name": "creator_principal_id",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": false
1501
+ },
1502
+ "created_at": {
1503
+ "name": "created_at",
1504
+ "type": "timestamp",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "default": "now()"
1508
+ },
1509
+ "updated_at": {
1510
+ "name": "updated_at",
1511
+ "type": "timestamp",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "default": "now()"
1515
+ }
1516
+ },
1517
+ "indexes": {},
1518
+ "foreignKeys": {
1519
+ "asset_tenant_id_tenant_id_fk": {
1520
+ "name": "asset_tenant_id_tenant_id_fk",
1521
+ "tableFrom": "asset",
1522
+ "tableTo": "tenant",
1523
+ "columnsFrom": ["tenant_id"],
1524
+ "columnsTo": ["id"],
1525
+ "onDelete": "cascade",
1526
+ "onUpdate": "no action"
1527
+ },
1528
+ "asset_creator_principal_id_principal_id_fk": {
1529
+ "name": "asset_creator_principal_id_principal_id_fk",
1530
+ "tableFrom": "asset",
1531
+ "tableTo": "principal",
1532
+ "columnsFrom": ["creator_principal_id"],
1533
+ "columnsTo": ["id"],
1534
+ "onDelete": "set null",
1535
+ "onUpdate": "no action"
1536
+ }
1537
+ },
1538
+ "compositePrimaryKeys": {},
1539
+ "uniqueConstraints": {
1540
+ "asset_tenant_kind_name": {
1541
+ "name": "asset_tenant_kind_name",
1542
+ "nullsNotDistinct": false,
1543
+ "columns": ["tenant_id", "kind", "name"]
1544
+ }
1545
+ },
1546
+ "policies": {},
1547
+ "checkConstraints": {},
1548
+ "isRLSEnabled": false
1549
+ },
1550
+ "public.transaction": {
1551
+ "name": "transaction",
1552
+ "schema": "",
1553
+ "columns": {
1554
+ "id": {
1555
+ "name": "id",
1556
+ "type": "text",
1557
+ "primaryKey": true,
1558
+ "notNull": true
1559
+ },
1560
+ "wallet_id": {
1561
+ "name": "wallet_id",
1562
+ "type": "text",
1563
+ "primaryKey": false,
1564
+ "notNull": true
1565
+ },
1566
+ "run_id": {
1567
+ "name": "run_id",
1568
+ "type": "text",
1569
+ "primaryKey": false,
1570
+ "notNull": false
1571
+ },
1572
+ "direction": {
1573
+ "name": "direction",
1574
+ "type": "text",
1575
+ "primaryKey": false,
1576
+ "notNull": true
1577
+ },
1578
+ "amount": {
1579
+ "name": "amount",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": true
1583
+ },
1584
+ "currency": {
1585
+ "name": "currency",
1586
+ "type": "text",
1587
+ "primaryKey": false,
1588
+ "notNull": true
1589
+ },
1590
+ "recipient_id": {
1591
+ "name": "recipient_id",
1592
+ "type": "text",
1593
+ "primaryKey": false,
1594
+ "notNull": false
1595
+ },
1596
+ "sender_id": {
1597
+ "name": "sender_id",
1598
+ "type": "text",
1599
+ "primaryKey": false,
1600
+ "notNull": false
1601
+ },
1602
+ "request_id": {
1603
+ "name": "request_id",
1604
+ "type": "text",
1605
+ "primaryKey": false,
1606
+ "notNull": false
1607
+ },
1608
+ "status": {
1609
+ "name": "status",
1610
+ "type": "text",
1611
+ "primaryKey": false,
1612
+ "notNull": true,
1613
+ "default": "'pending'"
1614
+ },
1615
+ "created_at": {
1616
+ "name": "created_at",
1617
+ "type": "timestamp",
1618
+ "primaryKey": false,
1619
+ "notNull": true,
1620
+ "default": "now()"
1621
+ }
1622
+ },
1623
+ "indexes": {},
1624
+ "foreignKeys": {
1625
+ "transaction_wallet_id_wallet_id_fk": {
1626
+ "name": "transaction_wallet_id_wallet_id_fk",
1627
+ "tableFrom": "transaction",
1628
+ "tableTo": "wallet",
1629
+ "columnsFrom": ["wallet_id"],
1630
+ "columnsTo": ["id"],
1631
+ "onDelete": "cascade",
1632
+ "onUpdate": "no action"
1633
+ },
1634
+ "transaction_run_id_workflow_run_id_fk": {
1635
+ "name": "transaction_run_id_workflow_run_id_fk",
1636
+ "tableFrom": "transaction",
1637
+ "tableTo": "workflow_run",
1638
+ "columnsFrom": ["run_id"],
1639
+ "columnsTo": ["id"],
1640
+ "onDelete": "set null",
1641
+ "onUpdate": "no action"
1642
+ }
1643
+ },
1644
+ "compositePrimaryKeys": {},
1645
+ "uniqueConstraints": {},
1646
+ "policies": {},
1647
+ "checkConstraints": {},
1648
+ "isRLSEnabled": false
1649
+ },
1650
+ "public.wallet": {
1651
+ "name": "wallet",
1652
+ "schema": "",
1653
+ "columns": {
1654
+ "id": {
1655
+ "name": "id",
1656
+ "type": "text",
1657
+ "primaryKey": true,
1658
+ "notNull": true
1659
+ },
1660
+ "tenant_id": {
1661
+ "name": "tenant_id",
1662
+ "type": "text",
1663
+ "primaryKey": false,
1664
+ "notNull": true
1665
+ },
1666
+ "name": {
1667
+ "name": "name",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": true
1671
+ },
1672
+ "backend_type": {
1673
+ "name": "backend_type",
1674
+ "type": "text",
1675
+ "primaryKey": false,
1676
+ "notNull": true
1677
+ },
1678
+ "currency": {
1679
+ "name": "currency",
1680
+ "type": "text",
1681
+ "primaryKey": false,
1682
+ "notNull": true
1683
+ },
1684
+ "balance": {
1685
+ "name": "balance",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": true,
1689
+ "default": "'0'"
1690
+ },
1691
+ "config": {
1692
+ "name": "config",
1693
+ "type": "jsonb",
1694
+ "primaryKey": false,
1695
+ "notNull": false
1696
+ },
1697
+ "created_at": {
1698
+ "name": "created_at",
1699
+ "type": "timestamp",
1700
+ "primaryKey": false,
1701
+ "notNull": true,
1702
+ "default": "now()"
1703
+ },
1704
+ "updated_at": {
1705
+ "name": "updated_at",
1706
+ "type": "timestamp",
1707
+ "primaryKey": false,
1708
+ "notNull": true,
1709
+ "default": "now()"
1710
+ }
1711
+ },
1712
+ "indexes": {},
1713
+ "foreignKeys": {
1714
+ "wallet_tenant_id_tenant_id_fk": {
1715
+ "name": "wallet_tenant_id_tenant_id_fk",
1716
+ "tableFrom": "wallet",
1717
+ "tableTo": "tenant",
1718
+ "columnsFrom": ["tenant_id"],
1719
+ "columnsTo": ["id"],
1720
+ "onDelete": "cascade",
1721
+ "onUpdate": "no action"
1722
+ }
1723
+ },
1724
+ "compositePrimaryKeys": {},
1725
+ "uniqueConstraints": {},
1726
+ "policies": {},
1727
+ "checkConstraints": {},
1728
+ "isRLSEnabled": false
1729
+ },
1730
+ "public.offering": {
1731
+ "name": "offering",
1732
+ "schema": "",
1733
+ "columns": {
1734
+ "id": {
1735
+ "name": "id",
1736
+ "type": "text",
1737
+ "primaryKey": true,
1738
+ "notNull": true
1739
+ },
1740
+ "agent_id": {
1741
+ "name": "agent_id",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": true
1745
+ },
1746
+ "tenant_id": {
1747
+ "name": "tenant_id",
1748
+ "type": "text",
1749
+ "primaryKey": false,
1750
+ "notNull": true
1751
+ },
1752
+ "name": {
1753
+ "name": "name",
1754
+ "type": "text",
1755
+ "primaryKey": false,
1756
+ "notNull": true
1757
+ },
1758
+ "description": {
1759
+ "name": "description",
1760
+ "type": "text",
1761
+ "primaryKey": false,
1762
+ "notNull": false
1763
+ },
1764
+ "pricing": {
1765
+ "name": "pricing",
1766
+ "type": "jsonb",
1767
+ "primaryKey": false,
1768
+ "notNull": false
1769
+ },
1770
+ "schema": {
1771
+ "name": "schema",
1772
+ "type": "jsonb",
1773
+ "primaryKey": false,
1774
+ "notNull": false
1775
+ },
1776
+ "created_at": {
1777
+ "name": "created_at",
1778
+ "type": "timestamp",
1779
+ "primaryKey": false,
1780
+ "notNull": true,
1781
+ "default": "now()"
1782
+ },
1783
+ "updated_at": {
1784
+ "name": "updated_at",
1785
+ "type": "timestamp",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "default": "now()"
1789
+ }
1790
+ },
1791
+ "indexes": {},
1792
+ "foreignKeys": {
1793
+ "offering_agent_id_workflow_definition_id_fk": {
1794
+ "name": "offering_agent_id_workflow_definition_id_fk",
1795
+ "tableFrom": "offering",
1796
+ "tableTo": "workflow_definition",
1797
+ "columnsFrom": ["agent_id"],
1798
+ "columnsTo": ["id"],
1799
+ "onDelete": "restrict",
1800
+ "onUpdate": "no action"
1801
+ },
1802
+ "offering_tenant_id_tenant_id_fk": {
1803
+ "name": "offering_tenant_id_tenant_id_fk",
1804
+ "tableFrom": "offering",
1805
+ "tableTo": "tenant",
1806
+ "columnsFrom": ["tenant_id"],
1807
+ "columnsTo": ["id"],
1808
+ "onDelete": "cascade",
1809
+ "onUpdate": "no action"
1810
+ }
1811
+ },
1812
+ "compositePrimaryKeys": {},
1813
+ "uniqueConstraints": {},
1814
+ "policies": {},
1815
+ "checkConstraints": {},
1816
+ "isRLSEnabled": false
1817
+ },
1818
+ "public.model": {
1819
+ "name": "model",
1820
+ "schema": "",
1821
+ "columns": {
1822
+ "id": {
1823
+ "name": "id",
1824
+ "type": "text",
1825
+ "primaryKey": true,
1826
+ "notNull": true
1827
+ },
1828
+ "tenant_id": {
1829
+ "name": "tenant_id",
1830
+ "type": "text",
1831
+ "primaryKey": false,
1832
+ "notNull": true
1833
+ },
1834
+ "canonical_name": {
1835
+ "name": "canonical_name",
1836
+ "type": "text",
1837
+ "primaryKey": false,
1838
+ "notNull": true
1839
+ },
1840
+ "display_name": {
1841
+ "name": "display_name",
1842
+ "type": "text",
1843
+ "primaryKey": false,
1844
+ "notNull": false
1845
+ },
1846
+ "description": {
1847
+ "name": "description",
1848
+ "type": "text",
1849
+ "primaryKey": false,
1850
+ "notNull": false
1851
+ },
1852
+ "disabled": {
1853
+ "name": "disabled",
1854
+ "type": "boolean",
1855
+ "primaryKey": false,
1856
+ "notNull": true,
1857
+ "default": false
1858
+ },
1859
+ "created_at": {
1860
+ "name": "created_at",
1861
+ "type": "timestamp",
1862
+ "primaryKey": false,
1863
+ "notNull": true,
1864
+ "default": "now()"
1865
+ },
1866
+ "updated_at": {
1867
+ "name": "updated_at",
1868
+ "type": "timestamp",
1869
+ "primaryKey": false,
1870
+ "notNull": true,
1871
+ "default": "now()"
1872
+ }
1873
+ },
1874
+ "indexes": {},
1875
+ "foreignKeys": {
1876
+ "model_tenant_id_tenant_id_fk": {
1877
+ "name": "model_tenant_id_tenant_id_fk",
1878
+ "tableFrom": "model",
1879
+ "tableTo": "tenant",
1880
+ "columnsFrom": ["tenant_id"],
1881
+ "columnsTo": ["id"],
1882
+ "onDelete": "cascade",
1883
+ "onUpdate": "no action"
1884
+ }
1885
+ },
1886
+ "compositePrimaryKeys": {},
1887
+ "uniqueConstraints": {
1888
+ "model_tenant_canonical_name": {
1889
+ "name": "model_tenant_canonical_name",
1890
+ "nullsNotDistinct": false,
1891
+ "columns": ["tenant_id", "canonical_name"]
1892
+ }
1893
+ },
1894
+ "policies": {},
1895
+ "checkConstraints": {},
1896
+ "isRLSEnabled": false
1897
+ },
1898
+ "public.model_offering": {
1899
+ "name": "model_offering",
1900
+ "schema": "",
1901
+ "columns": {
1902
+ "id": {
1903
+ "name": "id",
1904
+ "type": "text",
1905
+ "primaryKey": true,
1906
+ "notNull": true
1907
+ },
1908
+ "tenant_id": {
1909
+ "name": "tenant_id",
1910
+ "type": "text",
1911
+ "primaryKey": false,
1912
+ "notNull": true
1913
+ },
1914
+ "model_id": {
1915
+ "name": "model_id",
1916
+ "type": "text",
1917
+ "primaryKey": false,
1918
+ "notNull": true
1919
+ },
1920
+ "provider_id": {
1921
+ "name": "provider_id",
1922
+ "type": "text",
1923
+ "primaryKey": false,
1924
+ "notNull": true
1925
+ },
1926
+ "priority": {
1927
+ "name": "priority",
1928
+ "type": "integer",
1929
+ "primaryKey": false,
1930
+ "notNull": true
1931
+ },
1932
+ "deployment_tags": {
1933
+ "name": "deployment_tags",
1934
+ "type": "text[]",
1935
+ "primaryKey": false,
1936
+ "notNull": true,
1937
+ "default": "'{}'"
1938
+ },
1939
+ "capabilities": {
1940
+ "name": "capabilities",
1941
+ "type": "text[]",
1942
+ "primaryKey": false,
1943
+ "notNull": true,
1944
+ "default": "'{}'"
1945
+ },
1946
+ "quirks": {
1947
+ "name": "quirks",
1948
+ "type": "jsonb",
1949
+ "primaryKey": false,
1950
+ "notNull": false
1951
+ },
1952
+ "disabled": {
1953
+ "name": "disabled",
1954
+ "type": "boolean",
1955
+ "primaryKey": false,
1956
+ "notNull": true,
1957
+ "default": false
1958
+ },
1959
+ "created_at": {
1960
+ "name": "created_at",
1961
+ "type": "timestamp",
1962
+ "primaryKey": false,
1963
+ "notNull": true,
1964
+ "default": "now()"
1965
+ },
1966
+ "updated_at": {
1967
+ "name": "updated_at",
1968
+ "type": "timestamp",
1969
+ "primaryKey": false,
1970
+ "notNull": true,
1971
+ "default": "now()"
1972
+ }
1973
+ },
1974
+ "indexes": {},
1975
+ "foreignKeys": {
1976
+ "model_offering_tenant_id_tenant_id_fk": {
1977
+ "name": "model_offering_tenant_id_tenant_id_fk",
1978
+ "tableFrom": "model_offering",
1979
+ "tableTo": "tenant",
1980
+ "columnsFrom": ["tenant_id"],
1981
+ "columnsTo": ["id"],
1982
+ "onDelete": "cascade",
1983
+ "onUpdate": "no action"
1984
+ },
1985
+ "model_offering_model_id_model_id_fk": {
1986
+ "name": "model_offering_model_id_model_id_fk",
1987
+ "tableFrom": "model_offering",
1988
+ "tableTo": "model",
1989
+ "columnsFrom": ["model_id"],
1990
+ "columnsTo": ["id"],
1991
+ "onDelete": "cascade",
1992
+ "onUpdate": "no action"
1993
+ },
1994
+ "model_offering_provider_id_model_provider_id_fk": {
1995
+ "name": "model_offering_provider_id_model_provider_id_fk",
1996
+ "tableFrom": "model_offering",
1997
+ "tableTo": "model_provider",
1998
+ "columnsFrom": ["provider_id"],
1999
+ "columnsTo": ["id"],
2000
+ "onDelete": "cascade",
2001
+ "onUpdate": "no action"
2002
+ }
2003
+ },
2004
+ "compositePrimaryKeys": {},
2005
+ "uniqueConstraints": {
2006
+ "model_offering_tenant_model_provider": {
2007
+ "name": "model_offering_tenant_model_provider",
2008
+ "nullsNotDistinct": false,
2009
+ "columns": ["tenant_id", "model_id", "provider_id"]
2010
+ }
2011
+ },
2012
+ "policies": {},
2013
+ "checkConstraints": {},
2014
+ "isRLSEnabled": false
2015
+ },
2016
+ "public.model_pricing": {
2017
+ "name": "model_pricing",
2018
+ "schema": "",
2019
+ "columns": {
2020
+ "id": {
2021
+ "name": "id",
2022
+ "type": "text",
2023
+ "primaryKey": true,
2024
+ "notNull": true
2025
+ },
2026
+ "tenant_id": {
2027
+ "name": "tenant_id",
2028
+ "type": "text",
2029
+ "primaryKey": false,
2030
+ "notNull": true
2031
+ },
2032
+ "offering_id": {
2033
+ "name": "offering_id",
2034
+ "type": "text",
2035
+ "primaryKey": false,
2036
+ "notNull": true
2037
+ },
2038
+ "currency": {
2039
+ "name": "currency",
2040
+ "type": "text",
2041
+ "primaryKey": false,
2042
+ "notNull": true
2043
+ },
2044
+ "input_token_price": {
2045
+ "name": "input_token_price",
2046
+ "type": "text",
2047
+ "primaryKey": false,
2048
+ "notNull": false
2049
+ },
2050
+ "output_token_price": {
2051
+ "name": "output_token_price",
2052
+ "type": "text",
2053
+ "primaryKey": false,
2054
+ "notNull": false
2055
+ },
2056
+ "cache_read_token_price": {
2057
+ "name": "cache_read_token_price",
2058
+ "type": "text",
2059
+ "primaryKey": false,
2060
+ "notNull": false
2061
+ },
2062
+ "cache_write_token_price": {
2063
+ "name": "cache_write_token_price",
2064
+ "type": "text",
2065
+ "primaryKey": false,
2066
+ "notNull": false
2067
+ },
2068
+ "thinking_token_price": {
2069
+ "name": "thinking_token_price",
2070
+ "type": "text",
2071
+ "primaryKey": false,
2072
+ "notNull": false
2073
+ },
2074
+ "per_request_fee": {
2075
+ "name": "per_request_fee",
2076
+ "type": "text",
2077
+ "primaryKey": false,
2078
+ "notNull": false
2079
+ },
2080
+ "per_image_fee": {
2081
+ "name": "per_image_fee",
2082
+ "type": "text",
2083
+ "primaryKey": false,
2084
+ "notNull": false
2085
+ },
2086
+ "per_audio_fee": {
2087
+ "name": "per_audio_fee",
2088
+ "type": "text",
2089
+ "primaryKey": false,
2090
+ "notNull": false
2091
+ },
2092
+ "effective_from": {
2093
+ "name": "effective_from",
2094
+ "type": "timestamp with time zone",
2095
+ "primaryKey": false,
2096
+ "notNull": true
2097
+ },
2098
+ "created_at": {
2099
+ "name": "created_at",
2100
+ "type": "timestamp with time zone",
2101
+ "primaryKey": false,
2102
+ "notNull": true,
2103
+ "default": "now()"
2104
+ }
2105
+ },
2106
+ "indexes": {},
2107
+ "foreignKeys": {
2108
+ "model_pricing_tenant_id_tenant_id_fk": {
2109
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2110
+ "tableFrom": "model_pricing",
2111
+ "tableTo": "tenant",
2112
+ "columnsFrom": ["tenant_id"],
2113
+ "columnsTo": ["id"],
2114
+ "onDelete": "cascade",
2115
+ "onUpdate": "no action"
2116
+ },
2117
+ "model_pricing_offering_id_model_offering_id_fk": {
2118
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2119
+ "tableFrom": "model_pricing",
2120
+ "tableTo": "model_offering",
2121
+ "columnsFrom": ["offering_id"],
2122
+ "columnsTo": ["id"],
2123
+ "onDelete": "cascade",
2124
+ "onUpdate": "no action"
2125
+ }
2126
+ },
2127
+ "compositePrimaryKeys": {},
2128
+ "uniqueConstraints": {
2129
+ "model_pricing_offering_currency_effective_from": {
2130
+ "name": "model_pricing_offering_currency_effective_from",
2131
+ "nullsNotDistinct": false,
2132
+ "columns": ["offering_id", "currency", "effective_from"]
2133
+ }
2134
+ },
2135
+ "policies": {},
2136
+ "checkConstraints": {},
2137
+ "isRLSEnabled": false
2138
+ },
2139
+ "public.model_provider": {
2140
+ "name": "model_provider",
2141
+ "schema": "",
2142
+ "columns": {
2143
+ "id": {
2144
+ "name": "id",
2145
+ "type": "text",
2146
+ "primaryKey": true,
2147
+ "notNull": true
2148
+ },
2149
+ "tenant_id": {
2150
+ "name": "tenant_id",
2151
+ "type": "text",
2152
+ "primaryKey": false,
2153
+ "notNull": true
2154
+ },
2155
+ "name": {
2156
+ "name": "name",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true
2160
+ },
2161
+ "plugin": {
2162
+ "name": "plugin",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true
2166
+ },
2167
+ "base_url": {
2168
+ "name": "base_url",
2169
+ "type": "text",
2170
+ "primaryKey": false,
2171
+ "notNull": true
2172
+ },
2173
+ "credential_id": {
2174
+ "name": "credential_id",
2175
+ "type": "text",
2176
+ "primaryKey": false,
2177
+ "notNull": false
2178
+ },
2179
+ "wallet_id": {
2180
+ "name": "wallet_id",
2181
+ "type": "text",
2182
+ "primaryKey": false,
2183
+ "notNull": false
2184
+ },
2185
+ "disabled": {
2186
+ "name": "disabled",
2187
+ "type": "boolean",
2188
+ "primaryKey": false,
2189
+ "notNull": true,
2190
+ "default": false
2191
+ },
2192
+ "created_at": {
2193
+ "name": "created_at",
2194
+ "type": "timestamp",
2195
+ "primaryKey": false,
2196
+ "notNull": true,
2197
+ "default": "now()"
2198
+ },
2199
+ "updated_at": {
2200
+ "name": "updated_at",
2201
+ "type": "timestamp",
2202
+ "primaryKey": false,
2203
+ "notNull": true,
2204
+ "default": "now()"
2205
+ }
2206
+ },
2207
+ "indexes": {},
2208
+ "foreignKeys": {
2209
+ "model_provider_tenant_id_tenant_id_fk": {
2210
+ "name": "model_provider_tenant_id_tenant_id_fk",
2211
+ "tableFrom": "model_provider",
2212
+ "tableTo": "tenant",
2213
+ "columnsFrom": ["tenant_id"],
2214
+ "columnsTo": ["id"],
2215
+ "onDelete": "cascade",
2216
+ "onUpdate": "no action"
2217
+ },
2218
+ "model_provider_credential_id_credential_id_fk": {
2219
+ "name": "model_provider_credential_id_credential_id_fk",
2220
+ "tableFrom": "model_provider",
2221
+ "tableTo": "credential",
2222
+ "columnsFrom": ["credential_id"],
2223
+ "columnsTo": ["id"],
2224
+ "onDelete": "restrict",
2225
+ "onUpdate": "no action"
2226
+ },
2227
+ "model_provider_wallet_id_wallet_id_fk": {
2228
+ "name": "model_provider_wallet_id_wallet_id_fk",
2229
+ "tableFrom": "model_provider",
2230
+ "tableTo": "wallet",
2231
+ "columnsFrom": ["wallet_id"],
2232
+ "columnsTo": ["id"],
2233
+ "onDelete": "restrict",
2234
+ "onUpdate": "no action"
2235
+ }
2236
+ },
2237
+ "compositePrimaryKeys": {},
2238
+ "uniqueConstraints": {
2239
+ "model_provider_tenant_name": {
2240
+ "name": "model_provider_tenant_name",
2241
+ "nullsNotDistinct": false,
2242
+ "columns": ["tenant_id", "name"]
2243
+ }
2244
+ },
2245
+ "policies": {},
2246
+ "checkConstraints": {
2247
+ "model_provider_auth_xor": {
2248
+ "name": "model_provider_auth_xor",
2249
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2250
+ }
2251
+ },
2252
+ "isRLSEnabled": false
2253
+ },
2254
+ "public.sidecar": {
2255
+ "name": "sidecar",
2256
+ "schema": "",
2257
+ "columns": {
2258
+ "id": {
2259
+ "name": "id",
2260
+ "type": "text",
2261
+ "primaryKey": true,
2262
+ "notNull": true
2263
+ },
2264
+ "url": {
2265
+ "name": "url",
2266
+ "type": "text",
2267
+ "primaryKey": false,
2268
+ "notNull": true
2269
+ },
2270
+ "token_hash_sha256": {
2271
+ "name": "token_hash_sha256",
2272
+ "type": "bytea",
2273
+ "primaryKey": false,
2274
+ "notNull": true
2275
+ },
2276
+ "status": {
2277
+ "name": "status",
2278
+ "type": "text",
2279
+ "primaryKey": false,
2280
+ "notNull": true,
2281
+ "default": "'online'"
2282
+ },
2283
+ "last_heartbeat": {
2284
+ "name": "last_heartbeat",
2285
+ "type": "timestamp",
2286
+ "primaryKey": false,
2287
+ "notNull": false
2288
+ },
2289
+ "created_at": {
2290
+ "name": "created_at",
2291
+ "type": "timestamp",
2292
+ "primaryKey": false,
2293
+ "notNull": true,
2294
+ "default": "now()"
2295
+ },
2296
+ "updated_at": {
2297
+ "name": "updated_at",
2298
+ "type": "timestamp",
2299
+ "primaryKey": false,
2300
+ "notNull": true,
2301
+ "default": "now()"
2302
+ }
2303
+ },
2304
+ "indexes": {},
2305
+ "foreignKeys": {},
2306
+ "compositePrimaryKeys": {},
2307
+ "uniqueConstraints": {
2308
+ "sidecar_token_hash_sha256_unique": {
2309
+ "name": "sidecar_token_hash_sha256_unique",
2310
+ "nullsNotDistinct": false,
2311
+ "columns": ["token_hash_sha256"]
2312
+ }
2313
+ },
2314
+ "policies": {},
2315
+ "checkConstraints": {},
2316
+ "isRLSEnabled": false
2317
+ },
2318
+ "public.agent_session": {
2319
+ "name": "agent_session",
2320
+ "schema": "",
2321
+ "columns": {
2322
+ "id": {
2323
+ "name": "id",
2324
+ "type": "text",
2325
+ "primaryKey": true,
2326
+ "notNull": true
2327
+ },
2328
+ "tenant_id": {
2329
+ "name": "tenant_id",
2330
+ "type": "text",
2331
+ "primaryKey": false,
2332
+ "notNull": true
2333
+ },
2334
+ "agent_id": {
2335
+ "name": "agent_id",
2336
+ "type": "text",
2337
+ "primaryKey": false,
2338
+ "notNull": true
2339
+ },
2340
+ "principal_id": {
2341
+ "name": "principal_id",
2342
+ "type": "text",
2343
+ "primaryKey": false,
2344
+ "notNull": true
2345
+ },
2346
+ "status": {
2347
+ "name": "status",
2348
+ "type": "text",
2349
+ "primaryKey": false,
2350
+ "notNull": true,
2351
+ "default": "'active'"
2352
+ },
2353
+ "created_at": {
2354
+ "name": "created_at",
2355
+ "type": "timestamp",
2356
+ "primaryKey": false,
2357
+ "notNull": true,
2358
+ "default": "now()"
2359
+ },
2360
+ "updated_at": {
2361
+ "name": "updated_at",
2362
+ "type": "timestamp",
2363
+ "primaryKey": false,
2364
+ "notNull": true,
2365
+ "default": "now()"
2366
+ },
2367
+ "ended_at": {
2368
+ "name": "ended_at",
2369
+ "type": "timestamp",
2370
+ "primaryKey": false,
2371
+ "notNull": false
2372
+ }
2373
+ },
2374
+ "indexes": {},
2375
+ "foreignKeys": {
2376
+ "agent_session_tenant_id_tenant_id_fk": {
2377
+ "name": "agent_session_tenant_id_tenant_id_fk",
2378
+ "tableFrom": "agent_session",
2379
+ "tableTo": "tenant",
2380
+ "columnsFrom": ["tenant_id"],
2381
+ "columnsTo": ["id"],
2382
+ "onDelete": "cascade",
2383
+ "onUpdate": "no action"
2384
+ },
2385
+ "agent_session_agent_id_workflow_definition_id_fk": {
2386
+ "name": "agent_session_agent_id_workflow_definition_id_fk",
2387
+ "tableFrom": "agent_session",
2388
+ "tableTo": "workflow_definition",
2389
+ "columnsFrom": ["agent_id"],
2390
+ "columnsTo": ["id"],
2391
+ "onDelete": "restrict",
2392
+ "onUpdate": "no action"
2393
+ },
2394
+ "agent_session_principal_id_principal_id_fk": {
2395
+ "name": "agent_session_principal_id_principal_id_fk",
2396
+ "tableFrom": "agent_session",
2397
+ "tableTo": "principal",
2398
+ "columnsFrom": ["principal_id"],
2399
+ "columnsTo": ["id"],
2400
+ "onDelete": "no action",
2401
+ "onUpdate": "no action"
2402
+ }
2403
+ },
2404
+ "compositePrimaryKeys": {},
2405
+ "uniqueConstraints": {},
2406
+ "policies": {},
2407
+ "checkConstraints": {},
2408
+ "isRLSEnabled": false
2409
+ },
2410
+ "public.session_asset": {
2411
+ "name": "session_asset",
2412
+ "schema": "",
2413
+ "columns": {
2414
+ "instance_id": {
2415
+ "name": "instance_id",
2416
+ "type": "text",
2417
+ "primaryKey": false,
2418
+ "notNull": true
2419
+ },
2420
+ "mount_path": {
2421
+ "name": "mount_path",
2422
+ "type": "text",
2423
+ "primaryKey": false,
2424
+ "notNull": true
2425
+ },
2426
+ "asset_pack_sha": {
2427
+ "name": "asset_pack_sha",
2428
+ "type": "text",
2429
+ "primaryKey": false,
2430
+ "notNull": true
2431
+ },
2432
+ "source_commit_sha": {
2433
+ "name": "source_commit_sha",
2434
+ "type": "text",
2435
+ "primaryKey": false,
2436
+ "notNull": true
2437
+ },
2438
+ "materialized_at": {
2439
+ "name": "materialized_at",
2440
+ "type": "timestamp",
2441
+ "primaryKey": false,
2442
+ "notNull": true,
2443
+ "default": "now()"
2444
+ }
2445
+ },
2446
+ "indexes": {
2447
+ "session_asset_pack_sha_idx": {
2448
+ "name": "session_asset_pack_sha_idx",
2449
+ "columns": [
2450
+ {
2451
+ "expression": "asset_pack_sha",
2452
+ "isExpression": false,
2453
+ "asc": true,
2454
+ "nulls": "last"
2455
+ }
2456
+ ],
2457
+ "isUnique": false,
2458
+ "concurrently": false,
2459
+ "method": "btree",
2460
+ "with": {}
2461
+ }
2462
+ },
2463
+ "foreignKeys": {},
2464
+ "compositePrimaryKeys": {
2465
+ "session_asset_instance_id_mount_path_pk": {
2466
+ "name": "session_asset_instance_id_mount_path_pk",
2467
+ "columns": ["instance_id", "mount_path"]
2468
+ }
2469
+ },
2470
+ "uniqueConstraints": {},
2471
+ "policies": {},
2472
+ "checkConstraints": {},
2473
+ "isRLSEnabled": false
2474
+ },
2475
+ "public.inference_turn": {
2476
+ "name": "inference_turn",
2477
+ "schema": "",
2478
+ "columns": {
2479
+ "id": {
2480
+ "name": "id",
2481
+ "type": "text",
2482
+ "primaryKey": true,
2483
+ "notNull": true
2484
+ },
2485
+ "session_id": {
2486
+ "name": "session_id",
2487
+ "type": "text",
2488
+ "primaryKey": false,
2489
+ "notNull": true
2490
+ },
2491
+ "instance_id": {
2492
+ "name": "instance_id",
2493
+ "type": "text",
2494
+ "primaryKey": false,
2495
+ "notNull": true
2496
+ },
2497
+ "tenant_id": {
2498
+ "name": "tenant_id",
2499
+ "type": "text",
2500
+ "primaryKey": false,
2501
+ "notNull": true
2502
+ },
2503
+ "model": {
2504
+ "name": "model",
2505
+ "type": "text",
2506
+ "primaryKey": false,
2507
+ "notNull": true
2508
+ },
2509
+ "status": {
2510
+ "name": "status",
2511
+ "type": "text",
2512
+ "primaryKey": false,
2513
+ "notNull": true,
2514
+ "default": "'running'"
2515
+ },
2516
+ "started_at": {
2517
+ "name": "started_at",
2518
+ "type": "timestamp",
2519
+ "primaryKey": false,
2520
+ "notNull": true
2521
+ },
2522
+ "ended_at": {
2523
+ "name": "ended_at",
2524
+ "type": "timestamp",
2525
+ "primaryKey": false,
2526
+ "notNull": false
2527
+ }
2528
+ },
2529
+ "indexes": {
2530
+ "inference_turn_instance_id_started_at_idx": {
2531
+ "name": "inference_turn_instance_id_started_at_idx",
2532
+ "columns": [
2533
+ {
2534
+ "expression": "instance_id",
2535
+ "isExpression": false,
2536
+ "asc": true,
2537
+ "nulls": "last"
2538
+ },
2539
+ {
2540
+ "expression": "started_at",
2541
+ "isExpression": false,
2542
+ "asc": true,
2543
+ "nulls": "last"
2544
+ }
2545
+ ],
2546
+ "isUnique": false,
2547
+ "concurrently": false,
2548
+ "method": "btree",
2549
+ "with": {}
2550
+ }
2551
+ },
2552
+ "foreignKeys": {
2553
+ "inference_turn_session_id_agent_session_id_fk": {
2554
+ "name": "inference_turn_session_id_agent_session_id_fk",
2555
+ "tableFrom": "inference_turn",
2556
+ "tableTo": "agent_session",
2557
+ "columnsFrom": ["session_id"],
2558
+ "columnsTo": ["id"],
2559
+ "onDelete": "cascade",
2560
+ "onUpdate": "no action"
2561
+ },
2562
+ "inference_turn_tenant_id_tenant_id_fk": {
2563
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2564
+ "tableFrom": "inference_turn",
2565
+ "tableTo": "tenant",
2566
+ "columnsFrom": ["tenant_id"],
2567
+ "columnsTo": ["id"],
2568
+ "onDelete": "cascade",
2569
+ "onUpdate": "no action"
2570
+ }
2571
+ },
2572
+ "compositePrimaryKeys": {},
2573
+ "uniqueConstraints": {},
2574
+ "policies": {},
2575
+ "checkConstraints": {},
2576
+ "isRLSEnabled": false
2577
+ },
2578
+ "public.session_mail": {
2579
+ "name": "session_mail",
2580
+ "schema": "",
2581
+ "columns": {
2582
+ "id": {
2583
+ "name": "id",
2584
+ "type": "text",
2585
+ "primaryKey": true,
2586
+ "notNull": true
2587
+ },
2588
+ "session_id": {
2589
+ "name": "session_id",
2590
+ "type": "text",
2591
+ "primaryKey": false,
2592
+ "notNull": true
2593
+ },
2594
+ "instance_id": {
2595
+ "name": "instance_id",
2596
+ "type": "text",
2597
+ "primaryKey": false,
2598
+ "notNull": false
2599
+ },
2600
+ "tenant_id": {
2601
+ "name": "tenant_id",
2602
+ "type": "text",
2603
+ "primaryKey": false,
2604
+ "notNull": true
2605
+ },
2606
+ "direction": {
2607
+ "name": "direction",
2608
+ "type": "text",
2609
+ "primaryKey": false,
2610
+ "notNull": true
2611
+ },
2612
+ "status": {
2613
+ "name": "status",
2614
+ "type": "text",
2615
+ "primaryKey": false,
2616
+ "notNull": true,
2617
+ "default": "'pending'"
2618
+ },
2619
+ "raw": {
2620
+ "name": "raw",
2621
+ "type": "bytea",
2622
+ "primaryKey": false,
2623
+ "notNull": true
2624
+ },
2625
+ "created_at": {
2626
+ "name": "created_at",
2627
+ "type": "timestamp",
2628
+ "primaryKey": false,
2629
+ "notNull": true,
2630
+ "default": "now()"
2631
+ }
2632
+ },
2633
+ "indexes": {
2634
+ "session_mail_instance_id_created_at_idx": {
2635
+ "name": "session_mail_instance_id_created_at_idx",
2636
+ "columns": [
2637
+ {
2638
+ "expression": "instance_id",
2639
+ "isExpression": false,
2640
+ "asc": true,
2641
+ "nulls": "last"
2642
+ },
2643
+ {
2644
+ "expression": "created_at",
2645
+ "isExpression": false,
2646
+ "asc": true,
2647
+ "nulls": "last"
2648
+ }
2649
+ ],
2650
+ "isUnique": false,
2651
+ "concurrently": false,
2652
+ "method": "btree",
2653
+ "with": {}
2654
+ },
2655
+ "session_mail_session_id_created_at_idx": {
2656
+ "name": "session_mail_session_id_created_at_idx",
2657
+ "columns": [
2658
+ {
2659
+ "expression": "session_id",
2660
+ "isExpression": false,
2661
+ "asc": true,
2662
+ "nulls": "last"
2663
+ },
2664
+ {
2665
+ "expression": "created_at",
2666
+ "isExpression": false,
2667
+ "asc": true,
2668
+ "nulls": "last"
2669
+ }
2670
+ ],
2671
+ "isUnique": false,
2672
+ "concurrently": false,
2673
+ "method": "btree",
2674
+ "with": {}
2675
+ }
2676
+ },
2677
+ "foreignKeys": {
2678
+ "session_mail_session_id_agent_session_id_fk": {
2679
+ "name": "session_mail_session_id_agent_session_id_fk",
2680
+ "tableFrom": "session_mail",
2681
+ "tableTo": "agent_session",
2682
+ "columnsFrom": ["session_id"],
2683
+ "columnsTo": ["id"],
2684
+ "onDelete": "cascade",
2685
+ "onUpdate": "no action"
2686
+ },
2687
+ "session_mail_tenant_id_tenant_id_fk": {
2688
+ "name": "session_mail_tenant_id_tenant_id_fk",
2689
+ "tableFrom": "session_mail",
2690
+ "tableTo": "tenant",
2691
+ "columnsFrom": ["tenant_id"],
2692
+ "columnsTo": ["id"],
2693
+ "onDelete": "cascade",
2694
+ "onUpdate": "no action"
2695
+ }
2696
+ },
2697
+ "compositePrimaryKeys": {},
2698
+ "uniqueConstraints": {},
2699
+ "policies": {},
2700
+ "checkConstraints": {},
2701
+ "isRLSEnabled": false
2702
+ },
2703
+ "public.turn_part": {
2704
+ "name": "turn_part",
2705
+ "schema": "",
2706
+ "columns": {
2707
+ "id": {
2708
+ "name": "id",
2709
+ "type": "text",
2710
+ "primaryKey": true,
2711
+ "notNull": true
2712
+ },
2713
+ "turn_id": {
2714
+ "name": "turn_id",
2715
+ "type": "text",
2716
+ "primaryKey": false,
2717
+ "notNull": true
2718
+ },
2719
+ "session_id": {
2720
+ "name": "session_id",
2721
+ "type": "text",
2722
+ "primaryKey": false,
2723
+ "notNull": true
2724
+ },
2725
+ "type": {
2726
+ "name": "type",
2727
+ "type": "text",
2728
+ "primaryKey": false,
2729
+ "notNull": true
2730
+ },
2731
+ "content": {
2732
+ "name": "content",
2733
+ "type": "text",
2734
+ "primaryKey": false,
2735
+ "notNull": false
2736
+ },
2737
+ "metadata": {
2738
+ "name": "metadata",
2739
+ "type": "jsonb",
2740
+ "primaryKey": false,
2741
+ "notNull": false
2742
+ },
2743
+ "ordinal": {
2744
+ "name": "ordinal",
2745
+ "type": "integer",
2746
+ "primaryKey": false,
2747
+ "notNull": true
2748
+ }
2749
+ },
2750
+ "indexes": {},
2751
+ "foreignKeys": {
2752
+ "turn_part_turn_id_inference_turn_id_fk": {
2753
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2754
+ "tableFrom": "turn_part",
2755
+ "tableTo": "inference_turn",
2756
+ "columnsFrom": ["turn_id"],
2757
+ "columnsTo": ["id"],
2758
+ "onDelete": "cascade",
2759
+ "onUpdate": "no action"
2760
+ },
2761
+ "turn_part_session_id_agent_session_id_fk": {
2762
+ "name": "turn_part_session_id_agent_session_id_fk",
2763
+ "tableFrom": "turn_part",
2764
+ "tableTo": "agent_session",
2765
+ "columnsFrom": ["session_id"],
2766
+ "columnsTo": ["id"],
2767
+ "onDelete": "cascade",
2768
+ "onUpdate": "no action"
2769
+ }
2770
+ },
2771
+ "compositePrimaryKeys": {},
2772
+ "uniqueConstraints": {},
2773
+ "policies": {},
2774
+ "checkConstraints": {},
2775
+ "isRLSEnabled": false
2776
+ },
2777
+ "public.git_token": {
2778
+ "name": "git_token",
2779
+ "schema": "",
2780
+ "columns": {
2781
+ "id": {
2782
+ "name": "id",
2783
+ "type": "text",
2784
+ "primaryKey": true,
2785
+ "notNull": true
2786
+ },
2787
+ "tenant_id": {
2788
+ "name": "tenant_id",
2789
+ "type": "text",
2790
+ "primaryKey": false,
2791
+ "notNull": false
2792
+ },
2793
+ "user_id": {
2794
+ "name": "user_id",
2795
+ "type": "text",
2796
+ "primaryKey": false,
2797
+ "notNull": true
2798
+ },
2799
+ "principal_id": {
2800
+ "name": "principal_id",
2801
+ "type": "text",
2802
+ "primaryKey": false,
2803
+ "notNull": false
2804
+ },
2805
+ "name": {
2806
+ "name": "name",
2807
+ "type": "text",
2808
+ "primaryKey": false,
2809
+ "notNull": true
2810
+ },
2811
+ "kind": {
2812
+ "name": "kind",
2813
+ "type": "text",
2814
+ "primaryKey": false,
2815
+ "notNull": true
2816
+ },
2817
+ "token_hash_sha256": {
2818
+ "name": "token_hash_sha256",
2819
+ "type": "bytea",
2820
+ "primaryKey": false,
2821
+ "notNull": true
2822
+ },
2823
+ "resource": {
2824
+ "name": "resource",
2825
+ "type": "text",
2826
+ "primaryKey": false,
2827
+ "notNull": true
2828
+ },
2829
+ "ref_pattern": {
2830
+ "name": "ref_pattern",
2831
+ "type": "text",
2832
+ "primaryKey": false,
2833
+ "notNull": true
2834
+ },
2835
+ "actions": {
2836
+ "name": "actions",
2837
+ "type": "text[]",
2838
+ "primaryKey": false,
2839
+ "notNull": true
2840
+ },
2841
+ "expires_at": {
2842
+ "name": "expires_at",
2843
+ "type": "timestamp with time zone",
2844
+ "primaryKey": false,
2845
+ "notNull": true
2846
+ },
2847
+ "revoked_at": {
2848
+ "name": "revoked_at",
2849
+ "type": "timestamp with time zone",
2850
+ "primaryKey": false,
2851
+ "notNull": false
2852
+ },
2853
+ "created_at": {
2854
+ "name": "created_at",
2855
+ "type": "timestamp with time zone",
2856
+ "primaryKey": false,
2857
+ "notNull": true,
2858
+ "default": "now()"
2859
+ }
2860
+ },
2861
+ "indexes": {
2862
+ "git_token_user_id_name_active_idx": {
2863
+ "name": "git_token_user_id_name_active_idx",
2864
+ "columns": [
2865
+ {
2866
+ "expression": "user_id",
2867
+ "isExpression": false,
2868
+ "asc": true,
2869
+ "nulls": "last"
2870
+ },
2871
+ {
2872
+ "expression": "name",
2873
+ "isExpression": false,
2874
+ "asc": true,
2875
+ "nulls": "last"
2876
+ }
2877
+ ],
2878
+ "isUnique": true,
2879
+ "where": "\"git_token\".\"revoked_at\" is null",
2880
+ "concurrently": false,
2881
+ "method": "btree",
2882
+ "with": {}
2883
+ }
2884
+ },
2885
+ "foreignKeys": {
2886
+ "git_token_tenant_id_tenant_id_fk": {
2887
+ "name": "git_token_tenant_id_tenant_id_fk",
2888
+ "tableFrom": "git_token",
2889
+ "tableTo": "tenant",
2890
+ "columnsFrom": ["tenant_id"],
2891
+ "columnsTo": ["id"],
2892
+ "onDelete": "no action",
2893
+ "onUpdate": "no action"
2894
+ },
2895
+ "git_token_user_id_user_id_fk": {
2896
+ "name": "git_token_user_id_user_id_fk",
2897
+ "tableFrom": "git_token",
2898
+ "tableTo": "user",
2899
+ "columnsFrom": ["user_id"],
2900
+ "columnsTo": ["id"],
2901
+ "onDelete": "cascade",
2902
+ "onUpdate": "no action"
2903
+ },
2904
+ "git_token_principal_id_principal_id_fk": {
2905
+ "name": "git_token_principal_id_principal_id_fk",
2906
+ "tableFrom": "git_token",
2907
+ "tableTo": "principal",
2908
+ "columnsFrom": ["principal_id"],
2909
+ "columnsTo": ["id"],
2910
+ "onDelete": "cascade",
2911
+ "onUpdate": "no action"
2912
+ }
2913
+ },
2914
+ "compositePrimaryKeys": {},
2915
+ "uniqueConstraints": {
2916
+ "git_token_token_hash_sha256_unique": {
2917
+ "name": "git_token_token_hash_sha256_unique",
2918
+ "nullsNotDistinct": false,
2919
+ "columns": ["token_hash_sha256"]
2920
+ }
2921
+ },
2922
+ "policies": {},
2923
+ "checkConstraints": {},
2924
+ "isRLSEnabled": false
2925
+ },
2926
+ "public.workflow_definition": {
2927
+ "name": "workflow_definition",
2928
+ "schema": "",
2929
+ "columns": {
2930
+ "id": {
2931
+ "name": "id",
2932
+ "type": "text",
2933
+ "primaryKey": true,
2934
+ "notNull": true
2935
+ },
2936
+ "tenant_id": {
2937
+ "name": "tenant_id",
2938
+ "type": "text",
2939
+ "primaryKey": false,
2940
+ "notNull": true
2941
+ },
2942
+ "creator_principal_id": {
2943
+ "name": "creator_principal_id",
2944
+ "type": "text",
2945
+ "primaryKey": false,
2946
+ "notNull": false
2947
+ },
2948
+ "asset_id": {
2949
+ "name": "asset_id",
2950
+ "type": "text",
2951
+ "primaryKey": false,
2952
+ "notNull": false
2953
+ },
2954
+ "name": {
2955
+ "name": "name",
2956
+ "type": "text",
2957
+ "primaryKey": false,
2958
+ "notNull": true
2959
+ },
2960
+ "description": {
2961
+ "name": "description",
2962
+ "type": "text",
2963
+ "primaryKey": false,
2964
+ "notNull": false
2965
+ },
2966
+ "grant_requirements": {
2967
+ "name": "grant_requirements",
2968
+ "type": "jsonb",
2969
+ "primaryKey": false,
2970
+ "notNull": false
2971
+ },
2972
+ "model_requirements": {
2973
+ "name": "model_requirements",
2974
+ "type": "jsonb",
2975
+ "primaryKey": false,
2976
+ "notNull": false
2977
+ },
2978
+ "current_version": {
2979
+ "name": "current_version",
2980
+ "type": "text",
2981
+ "primaryKey": false,
2982
+ "notNull": true,
2983
+ "default": "'1'"
2984
+ },
2985
+ "status": {
2986
+ "name": "status",
2987
+ "type": "text",
2988
+ "primaryKey": false,
2989
+ "notNull": true,
2990
+ "default": "'deployed'"
2991
+ },
2992
+ "created_at": {
2993
+ "name": "created_at",
2994
+ "type": "timestamp",
2995
+ "primaryKey": false,
2996
+ "notNull": true,
2997
+ "default": "now()"
2998
+ },
2999
+ "updated_at": {
3000
+ "name": "updated_at",
3001
+ "type": "timestamp",
3002
+ "primaryKey": false,
3003
+ "notNull": true,
3004
+ "default": "now()"
3005
+ }
3006
+ },
3007
+ "indexes": {
3008
+ "workflow_definition_tenant_idx": {
3009
+ "name": "workflow_definition_tenant_idx",
3010
+ "columns": [
3011
+ {
3012
+ "expression": "tenant_id",
3013
+ "isExpression": false,
3014
+ "asc": true,
3015
+ "nulls": "last"
3016
+ },
3017
+ {
3018
+ "expression": "created_at",
3019
+ "isExpression": false,
3020
+ "asc": true,
3021
+ "nulls": "last"
3022
+ }
3023
+ ],
3024
+ "isUnique": false,
3025
+ "concurrently": false,
3026
+ "method": "btree",
3027
+ "with": {}
3028
+ },
3029
+ "workflow_definition_asset_idx": {
3030
+ "name": "workflow_definition_asset_idx",
3031
+ "columns": [
3032
+ {
3033
+ "expression": "asset_id",
3034
+ "isExpression": false,
3035
+ "asc": true,
3036
+ "nulls": "last"
3037
+ }
3038
+ ],
3039
+ "isUnique": true,
3040
+ "concurrently": false,
3041
+ "method": "btree",
3042
+ "with": {}
3043
+ }
3044
+ },
3045
+ "foreignKeys": {
3046
+ "workflow_definition_tenant_id_tenant_id_fk": {
3047
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3048
+ "tableFrom": "workflow_definition",
3049
+ "tableTo": "tenant",
3050
+ "columnsFrom": ["tenant_id"],
3051
+ "columnsTo": ["id"],
3052
+ "onDelete": "cascade",
3053
+ "onUpdate": "no action"
3054
+ },
3055
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3056
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3057
+ "tableFrom": "workflow_definition",
3058
+ "tableTo": "principal",
3059
+ "columnsFrom": ["creator_principal_id"],
3060
+ "columnsTo": ["id"],
3061
+ "onDelete": "no action",
3062
+ "onUpdate": "no action"
3063
+ },
3064
+ "workflow_definition_asset_id_asset_id_fk": {
3065
+ "name": "workflow_definition_asset_id_asset_id_fk",
3066
+ "tableFrom": "workflow_definition",
3067
+ "tableTo": "asset",
3068
+ "columnsFrom": ["asset_id"],
3069
+ "columnsTo": ["id"],
3070
+ "onDelete": "restrict",
3071
+ "onUpdate": "no action"
3072
+ }
3073
+ },
3074
+ "compositePrimaryKeys": {},
3075
+ "uniqueConstraints": {},
3076
+ "policies": {},
3077
+ "checkConstraints": {},
3078
+ "isRLSEnabled": false
3079
+ },
3080
+ "public.workflow_definition_version": {
3081
+ "name": "workflow_definition_version",
3082
+ "schema": "",
3083
+ "columns": {
3084
+ "id": {
3085
+ "name": "id",
3086
+ "type": "text",
3087
+ "primaryKey": true,
3088
+ "notNull": true
3089
+ },
3090
+ "definition_id": {
3091
+ "name": "definition_id",
3092
+ "type": "text",
3093
+ "primaryKey": false,
3094
+ "notNull": true
3095
+ },
3096
+ "version": {
3097
+ "name": "version",
3098
+ "type": "text",
3099
+ "primaryKey": false,
3100
+ "notNull": true
3101
+ },
3102
+ "status": {
3103
+ "name": "status",
3104
+ "type": "text",
3105
+ "primaryKey": false,
3106
+ "notNull": true,
3107
+ "default": "'active'"
3108
+ },
3109
+ "created_at": {
3110
+ "name": "created_at",
3111
+ "type": "timestamp",
3112
+ "primaryKey": false,
3113
+ "notNull": true,
3114
+ "default": "now()"
3115
+ }
3116
+ },
3117
+ "indexes": {
3118
+ "workflow_definition_version_definition_idx": {
3119
+ "name": "workflow_definition_version_definition_idx",
3120
+ "columns": [
3121
+ {
3122
+ "expression": "definition_id",
3123
+ "isExpression": false,
3124
+ "asc": true,
3125
+ "nulls": "last"
3126
+ }
3127
+ ],
3128
+ "isUnique": false,
3129
+ "concurrently": false,
3130
+ "method": "btree",
3131
+ "with": {}
3132
+ }
3133
+ },
3134
+ "foreignKeys": {
3135
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3136
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3137
+ "tableFrom": "workflow_definition_version",
3138
+ "tableTo": "workflow_definition",
3139
+ "columnsFrom": ["definition_id"],
3140
+ "columnsTo": ["id"],
3141
+ "onDelete": "cascade",
3142
+ "onUpdate": "no action"
3143
+ }
3144
+ },
3145
+ "compositePrimaryKeys": {},
3146
+ "uniqueConstraints": {
3147
+ "workflow_definition_version_definition_version": {
3148
+ "name": "workflow_definition_version_definition_version",
3149
+ "nullsNotDistinct": false,
3150
+ "columns": ["definition_id", "version"]
3151
+ }
3152
+ },
3153
+ "policies": {},
3154
+ "checkConstraints": {},
3155
+ "isRLSEnabled": false
3156
+ },
3157
+ "public.workflow_run": {
3158
+ "name": "workflow_run",
3159
+ "schema": "",
3160
+ "columns": {
3161
+ "id": {
3162
+ "name": "id",
3163
+ "type": "text",
3164
+ "primaryKey": true,
3165
+ "notNull": true
3166
+ },
3167
+ "definition_id": {
3168
+ "name": "definition_id",
3169
+ "type": "text",
3170
+ "primaryKey": false,
3171
+ "notNull": true
3172
+ },
3173
+ "deployment_id": {
3174
+ "name": "deployment_id",
3175
+ "type": "text",
3176
+ "primaryKey": false,
3177
+ "notNull": false
3178
+ },
3179
+ "tenant_id": {
3180
+ "name": "tenant_id",
3181
+ "type": "text",
3182
+ "primaryKey": false,
3183
+ "notNull": true
3184
+ },
3185
+ "principal_id": {
3186
+ "name": "principal_id",
3187
+ "type": "text",
3188
+ "primaryKey": false,
3189
+ "notNull": false
3190
+ },
3191
+ "status": {
3192
+ "name": "status",
3193
+ "type": "text",
3194
+ "primaryKey": false,
3195
+ "notNull": true,
3196
+ "default": "'running'"
3197
+ },
3198
+ "address": {
3199
+ "name": "address",
3200
+ "type": "text",
3201
+ "primaryKey": false,
3202
+ "notNull": false
3203
+ },
3204
+ "public_key": {
3205
+ "name": "public_key",
3206
+ "type": "text",
3207
+ "primaryKey": false,
3208
+ "notNull": false
3209
+ },
3210
+ "sidecar_id": {
3211
+ "name": "sidecar_id",
3212
+ "type": "text",
3213
+ "primaryKey": false,
3214
+ "notNull": false
3215
+ },
3216
+ "kernel_id": {
3217
+ "name": "kernel_id",
3218
+ "type": "text",
3219
+ "primaryKey": false,
3220
+ "notNull": false
3221
+ },
3222
+ "model_preferences": {
3223
+ "name": "model_preferences",
3224
+ "type": "jsonb",
3225
+ "primaryKey": false,
3226
+ "notNull": false
3227
+ },
3228
+ "created_at": {
3229
+ "name": "created_at",
3230
+ "type": "timestamp",
3231
+ "primaryKey": false,
3232
+ "notNull": true,
3233
+ "default": "now()"
3234
+ },
3235
+ "ended_at": {
3236
+ "name": "ended_at",
3237
+ "type": "timestamp",
3238
+ "primaryKey": false,
3239
+ "notNull": false
3240
+ }
3241
+ },
3242
+ "indexes": {
3243
+ "workflow_run_definition_idx": {
3244
+ "name": "workflow_run_definition_idx",
3245
+ "columns": [
3246
+ {
3247
+ "expression": "definition_id",
3248
+ "isExpression": false,
3249
+ "asc": true,
3250
+ "nulls": "last"
3251
+ }
3252
+ ],
3253
+ "isUnique": false,
3254
+ "concurrently": false,
3255
+ "method": "btree",
3256
+ "with": {}
3257
+ },
3258
+ "workflow_run_address_idx": {
3259
+ "name": "workflow_run_address_idx",
3260
+ "columns": [
3261
+ {
3262
+ "expression": "address",
3263
+ "isExpression": false,
3264
+ "asc": true,
3265
+ "nulls": "last"
3266
+ }
3267
+ ],
3268
+ "isUnique": true,
3269
+ "where": "\"workflow_run\".\"address\" is not null",
3270
+ "concurrently": false,
3271
+ "method": "btree",
3272
+ "with": {}
3273
+ }
3274
+ },
3275
+ "foreignKeys": {
3276
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3277
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3278
+ "tableFrom": "workflow_run",
3279
+ "tableTo": "workflow_definition",
3280
+ "columnsFrom": ["definition_id"],
3281
+ "columnsTo": ["id"],
3282
+ "onDelete": "cascade",
3283
+ "onUpdate": "no action"
3284
+ },
3285
+ "workflow_run_deployment_id_workflow_run_id_fk": {
3286
+ "name": "workflow_run_deployment_id_workflow_run_id_fk",
3287
+ "tableFrom": "workflow_run",
3288
+ "tableTo": "workflow_run",
3289
+ "columnsFrom": ["deployment_id"],
3290
+ "columnsTo": ["id"],
3291
+ "onDelete": "cascade",
3292
+ "onUpdate": "no action"
3293
+ },
3294
+ "workflow_run_tenant_id_tenant_id_fk": {
3295
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3296
+ "tableFrom": "workflow_run",
3297
+ "tableTo": "tenant",
3298
+ "columnsFrom": ["tenant_id"],
3299
+ "columnsTo": ["id"],
3300
+ "onDelete": "cascade",
3301
+ "onUpdate": "no action"
3302
+ },
3303
+ "workflow_run_principal_id_principal_id_fk": {
3304
+ "name": "workflow_run_principal_id_principal_id_fk",
3305
+ "tableFrom": "workflow_run",
3306
+ "tableTo": "principal",
3307
+ "columnsFrom": ["principal_id"],
3308
+ "columnsTo": ["id"],
3309
+ "onDelete": "set null",
3310
+ "onUpdate": "no action"
3311
+ },
3312
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3313
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3314
+ "tableFrom": "workflow_run",
3315
+ "tableTo": "sidecar",
3316
+ "columnsFrom": ["sidecar_id"],
3317
+ "columnsTo": ["id"],
3318
+ "onDelete": "set null",
3319
+ "onUpdate": "no action"
3320
+ }
3321
+ },
3322
+ "compositePrimaryKeys": {},
3323
+ "uniqueConstraints": {},
3324
+ "policies": {},
3325
+ "checkConstraints": {},
3326
+ "isRLSEnabled": false
3327
+ },
3328
+ "public.workflow_run_execution": {
3329
+ "name": "workflow_run_execution",
3330
+ "schema": "",
3331
+ "columns": {
3332
+ "id": {
3333
+ "name": "id",
3334
+ "type": "text",
3335
+ "primaryKey": true,
3336
+ "notNull": true
3337
+ },
3338
+ "run_id": {
3339
+ "name": "run_id",
3340
+ "type": "text",
3341
+ "primaryKey": false,
3342
+ "notNull": true
3343
+ },
3344
+ "message_id": {
3345
+ "name": "message_id",
3346
+ "type": "text",
3347
+ "primaryKey": false,
3348
+ "notNull": true
3349
+ },
3350
+ "status": {
3351
+ "name": "status",
3352
+ "type": "text",
3353
+ "primaryKey": false,
3354
+ "notNull": true,
3355
+ "default": "'running'"
3356
+ },
3357
+ "started_at": {
3358
+ "name": "started_at",
3359
+ "type": "timestamp",
3360
+ "primaryKey": false,
3361
+ "notNull": true,
3362
+ "default": "now()"
3363
+ },
3364
+ "ended_at": {
3365
+ "name": "ended_at",
3366
+ "type": "timestamp",
3367
+ "primaryKey": false,
3368
+ "notNull": false
3369
+ },
3370
+ "failure_reason": {
3371
+ "name": "failure_reason",
3372
+ "type": "text",
3373
+ "primaryKey": false,
3374
+ "notNull": false
3375
+ }
3376
+ },
3377
+ "indexes": {
3378
+ "workflow_run_execution_run_id_id_idx": {
3379
+ "name": "workflow_run_execution_run_id_id_idx",
3380
+ "columns": [
3381
+ {
3382
+ "expression": "run_id",
3383
+ "isExpression": false,
3384
+ "asc": true,
3385
+ "nulls": "last"
3386
+ },
3387
+ {
3388
+ "expression": "id",
3389
+ "isExpression": false,
3390
+ "asc": true,
3391
+ "nulls": "last"
3392
+ }
3393
+ ],
3394
+ "isUnique": true,
3395
+ "concurrently": false,
3396
+ "method": "btree",
3397
+ "with": {}
3398
+ },
3399
+ "workflow_run_execution_status_idx": {
3400
+ "name": "workflow_run_execution_status_idx",
3401
+ "columns": [
3402
+ {
3403
+ "expression": "status",
3404
+ "isExpression": false,
3405
+ "asc": true,
3406
+ "nulls": "last"
3407
+ }
3408
+ ],
3409
+ "isUnique": false,
3410
+ "concurrently": false,
3411
+ "method": "btree",
3412
+ "with": {}
3413
+ }
3414
+ },
3415
+ "foreignKeys": {
3416
+ "workflow_run_execution_run_id_workflow_run_id_fk": {
3417
+ "name": "workflow_run_execution_run_id_workflow_run_id_fk",
3418
+ "tableFrom": "workflow_run_execution",
3419
+ "tableTo": "workflow_run",
3420
+ "columnsFrom": ["run_id"],
3421
+ "columnsTo": ["id"],
3422
+ "onDelete": "cascade",
3423
+ "onUpdate": "no action"
3424
+ }
3425
+ },
3426
+ "compositePrimaryKeys": {},
3427
+ "uniqueConstraints": {},
3428
+ "policies": {},
3429
+ "checkConstraints": {},
3430
+ "isRLSEnabled": false
3431
+ }
3432
+ },
3433
+ "enums": {},
3434
+ "schemas": {},
3435
+ "sequences": {},
3436
+ "roles": {},
3437
+ "policies": {},
3438
+ "views": {},
3439
+ "_meta": {
3440
+ "columns": {},
3441
+ "schemas": {},
3442
+ "tables": {}
3443
+ }
3444
+ }