@coffre/db 0.14.4 → 0.15.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 (218) hide show
  1. package/README.md +2 -1
  2. package/dist/change-records-_fKvahvs.js +55 -0
  3. package/dist/connect.d.ts +22 -10
  4. package/dist/connect.js +74 -12
  5. package/dist/database-CVteLhp1.d.ts +410 -0
  6. package/dist/{database-BadNeeN-.js → database-D55ENPX-.js} +46 -25
  7. package/dist/dialect.d.ts +4 -3
  8. package/dist/dialect.js +14 -5
  9. package/dist/grants.d.ts +4 -4
  10. package/dist/grants.js +4 -4
  11. package/dist/hyperdrive.d.ts +48 -23
  12. package/dist/hyperdrive.js +168 -91
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +1 -1
  15. package/dist/log-DaD7fyUq.d.ts +722 -0
  16. package/dist/log.d.ts +2 -596
  17. package/dist/log.js +224 -10
  18. package/dist/migrate.d.ts +43 -3
  19. package/dist/migrate.js +149 -29
  20. package/dist/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  21. package/dist/migrations/postgres/0022_log_015.sql +672 -0
  22. package/dist/migrations/postgres/0023_change_path.sql +153 -0
  23. package/dist/migrations/postgres/0024_use_015.sql +556 -0
  24. package/dist/migrations/postgres/0025_app_change.sql +221 -0
  25. package/dist/migrations/postgres/0026_issue_lock.sql +106 -0
  26. package/dist/migrations/postgres/0027_retention.sql +118 -0
  27. package/dist/migrations/postgres/0028_use_stalls.sql +594 -0
  28. package/dist/migrations/postgres/0029_use_objects.sql +887 -0
  29. package/dist/migrations/postgres/0030_unarchive_restores.sql +259 -0
  30. package/dist/migrations/postgres/0031_app_read.sql +65 -0
  31. package/dist/migrations/postgres/0032_secrets_live_index.sql +4 -0
  32. package/dist/migrations/postgres/0033_use_generations.sql +582 -0
  33. package/dist/migrations/postgres/0034_vault_credentials.sql +153 -0
  34. package/dist/migrations/postgres/0035_first_days.sql +3 -0
  35. package/dist/migrations/postgres/0036_vault_issues.sql +91 -0
  36. package/dist/migrations/postgres/0037_vault_bindings.sql +271 -0
  37. package/dist/migrations/postgres/0040_binding_origin.sql +159 -0
  38. package/dist/migrations/postgres/0041_cutover.sql +132 -0
  39. package/dist/migrations/postgres/0042_sign_in_index.sql +7 -0
  40. package/dist/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  41. package/dist/migrations/postgres/0044_use_by_name.sql +705 -0
  42. package/dist/migrations/postgres/0045_decide_first.sql +878 -0
  43. package/dist/migrations/postgres/0046_way_in_uses.sql +1149 -0
  44. package/dist/migrations/postgres/0047_cutover_finish.sql +268 -0
  45. package/dist/migrations/postgres/0048_use_batch.sql +59 -0
  46. package/dist/migrations/postgres/0049_reads.sql +171 -0
  47. package/dist/migrations/postgres/meta/0021_snapshot.json +3334 -0
  48. package/dist/migrations/postgres/meta/0022_snapshot.json +3831 -0
  49. package/dist/migrations/postgres/meta/0023_snapshot.json +3831 -0
  50. package/dist/migrations/postgres/meta/0024_snapshot.json +3831 -0
  51. package/dist/migrations/postgres/meta/0025_snapshot.json +3831 -0
  52. package/dist/migrations/postgres/meta/0026_snapshot.json +3831 -0
  53. package/dist/migrations/postgres/meta/0027_snapshot.json +3853 -0
  54. package/dist/migrations/postgres/meta/0028_snapshot.json +3853 -0
  55. package/dist/migrations/postgres/meta/0029_snapshot.json +3859 -0
  56. package/dist/migrations/postgres/meta/0030_snapshot.json +3859 -0
  57. package/dist/migrations/postgres/meta/0031_snapshot.json +3859 -0
  58. package/dist/migrations/postgres/meta/0032_snapshot.json +3875 -0
  59. package/dist/migrations/postgres/meta/0033_snapshot.json +3875 -0
  60. package/dist/migrations/postgres/meta/0034_snapshot.json +3875 -0
  61. package/dist/migrations/postgres/meta/0035_snapshot.json +3875 -0
  62. package/dist/migrations/postgres/meta/0036_snapshot.json +3875 -0
  63. package/dist/migrations/postgres/meta/0037_snapshot.json +3875 -0
  64. package/dist/migrations/postgres/meta/0038_snapshot.json +3881 -0
  65. package/dist/migrations/postgres/meta/0039_snapshot.json +3881 -0
  66. package/dist/migrations/postgres/meta/0040_snapshot.json +3931 -0
  67. package/dist/migrations/postgres/meta/0041_snapshot.json +3981 -0
  68. package/dist/migrations/postgres/meta/0042_snapshot.json +3981 -0
  69. package/dist/migrations/postgres/meta/0043_snapshot.json +3981 -0
  70. package/dist/migrations/postgres/meta/0044_snapshot.json +3991 -0
  71. package/dist/migrations/postgres/meta/0045_snapshot.json +3997 -0
  72. package/dist/migrations/postgres/meta/0046_snapshot.json +3997 -0
  73. package/dist/migrations/postgres/meta/0047_snapshot.json +4234 -0
  74. package/dist/migrations/postgres/meta/_journal.json +189 -0
  75. package/dist/migrations/sqlite/0018_log_015.sql +84 -0
  76. package/dist/migrations/sqlite/0019_retention.sql +2 -0
  77. package/dist/migrations/sqlite/0020_ended_references.sql +1 -0
  78. package/dist/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  79. package/dist/migrations/sqlite/0022_binding_origin.sql +1 -0
  80. package/dist/migrations/sqlite/0023_sign_in_index.sql +2 -0
  81. package/dist/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  82. package/dist/migrations/sqlite/0025_way_in_uses.sql +42 -0
  83. package/dist/migrations/sqlite/0026_cutover_finish.sql +11 -0
  84. package/dist/migrations/sqlite/0027_reads.sql +38 -0
  85. package/dist/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  86. package/dist/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  87. package/dist/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  88. package/dist/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  89. package/dist/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  90. package/dist/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  91. package/dist/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  92. package/dist/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  93. package/dist/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  94. package/dist/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  95. package/dist/migrations/sqlite/meta/_journal.json +70 -0
  96. package/dist/platform-Y3gICK6n.d.ts +58 -0
  97. package/dist/portable.d.ts +2 -2
  98. package/dist/postgres-BI3xTnyw.js +1718 -0
  99. package/dist/postgres-platform-node.d.ts +14 -0
  100. package/dist/postgres-platform-node.js +21 -0
  101. package/dist/postgres-platform-workerd.d.ts +61 -0
  102. package/dist/postgres-platform-workerd.js +163 -0
  103. package/dist/{schema-z8GcN_Xu.d.ts → schema-DgoPqqsI.d.ts} +1329 -9
  104. package/dist/schema-sqlite.d.ts +1308 -8
  105. package/dist/schema-sqlite.js +156 -20
  106. package/dist/schema-version.d.ts +1 -1
  107. package/dist/schema-version.js +261 -2
  108. package/dist/schema.d.ts +2 -2
  109. package/dist/schema.js +229 -22
  110. package/package.json +13 -5
  111. package/src/active-subject.ts +9 -0
  112. package/src/change-records.ts +38 -0
  113. package/src/connect.ts +67 -13
  114. package/src/database.ts +67 -51
  115. package/src/dialect.ts +17 -8
  116. package/src/grants.ts +3 -3
  117. package/src/hyperdrive.ts +181 -104
  118. package/src/log.ts +244 -11
  119. package/src/migrate.ts +157 -30
  120. package/src/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  121. package/src/migrations/postgres/0022_log_015.sql +672 -0
  122. package/src/migrations/postgres/0023_change_path.sql +153 -0
  123. package/src/migrations/postgres/0024_use_015.sql +556 -0
  124. package/src/migrations/postgres/0025_app_change.sql +221 -0
  125. package/src/migrations/postgres/0026_issue_lock.sql +106 -0
  126. package/src/migrations/postgres/0027_retention.sql +118 -0
  127. package/src/migrations/postgres/0028_use_stalls.sql +594 -0
  128. package/src/migrations/postgres/0029_use_objects.sql +887 -0
  129. package/src/migrations/postgres/0030_unarchive_restores.sql +259 -0
  130. package/src/migrations/postgres/0031_app_read.sql +65 -0
  131. package/src/migrations/postgres/0032_secrets_live_index.sql +4 -0
  132. package/src/migrations/postgres/0033_use_generations.sql +582 -0
  133. package/src/migrations/postgres/0034_vault_credentials.sql +153 -0
  134. package/src/migrations/postgres/0035_first_days.sql +3 -0
  135. package/src/migrations/postgres/0036_vault_issues.sql +91 -0
  136. package/src/migrations/postgres/0037_vault_bindings.sql +271 -0
  137. package/src/migrations/postgres/0040_binding_origin.sql +159 -0
  138. package/src/migrations/postgres/0041_cutover.sql +132 -0
  139. package/src/migrations/postgres/0042_sign_in_index.sql +7 -0
  140. package/src/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  141. package/src/migrations/postgres/0044_use_by_name.sql +705 -0
  142. package/src/migrations/postgres/0045_decide_first.sql +878 -0
  143. package/src/migrations/postgres/0046_way_in_uses.sql +1149 -0
  144. package/src/migrations/postgres/0047_cutover_finish.sql +268 -0
  145. package/src/migrations/postgres/0048_use_batch.sql +59 -0
  146. package/src/migrations/postgres/0049_reads.sql +171 -0
  147. package/src/migrations/postgres/meta/0021_snapshot.json +3334 -0
  148. package/src/migrations/postgres/meta/0022_snapshot.json +3831 -0
  149. package/src/migrations/postgres/meta/0023_snapshot.json +3831 -0
  150. package/src/migrations/postgres/meta/0024_snapshot.json +3831 -0
  151. package/src/migrations/postgres/meta/0025_snapshot.json +3831 -0
  152. package/src/migrations/postgres/meta/0026_snapshot.json +3831 -0
  153. package/src/migrations/postgres/meta/0027_snapshot.json +3853 -0
  154. package/src/migrations/postgres/meta/0028_snapshot.json +3853 -0
  155. package/src/migrations/postgres/meta/0029_snapshot.json +3859 -0
  156. package/src/migrations/postgres/meta/0030_snapshot.json +3859 -0
  157. package/src/migrations/postgres/meta/0031_snapshot.json +3859 -0
  158. package/src/migrations/postgres/meta/0032_snapshot.json +3875 -0
  159. package/src/migrations/postgres/meta/0033_snapshot.json +3875 -0
  160. package/src/migrations/postgres/meta/0034_snapshot.json +3875 -0
  161. package/src/migrations/postgres/meta/0035_snapshot.json +3875 -0
  162. package/src/migrations/postgres/meta/0036_snapshot.json +3875 -0
  163. package/src/migrations/postgres/meta/0037_snapshot.json +3875 -0
  164. package/src/migrations/postgres/meta/0038_snapshot.json +3881 -0
  165. package/src/migrations/postgres/meta/0039_snapshot.json +3881 -0
  166. package/src/migrations/postgres/meta/0040_snapshot.json +3931 -0
  167. package/src/migrations/postgres/meta/0041_snapshot.json +3981 -0
  168. package/src/migrations/postgres/meta/0042_snapshot.json +3981 -0
  169. package/src/migrations/postgres/meta/0043_snapshot.json +3981 -0
  170. package/src/migrations/postgres/meta/0044_snapshot.json +3991 -0
  171. package/src/migrations/postgres/meta/0045_snapshot.json +3997 -0
  172. package/src/migrations/postgres/meta/0046_snapshot.json +3997 -0
  173. package/src/migrations/postgres/meta/0047_snapshot.json +4234 -0
  174. package/src/migrations/postgres/meta/_journal.json +189 -0
  175. package/src/migrations/sqlite/0018_log_015.sql +84 -0
  176. package/src/migrations/sqlite/0019_retention.sql +2 -0
  177. package/src/migrations/sqlite/0020_ended_references.sql +1 -0
  178. package/src/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  179. package/src/migrations/sqlite/0022_binding_origin.sql +1 -0
  180. package/src/migrations/sqlite/0023_sign_in_index.sql +2 -0
  181. package/src/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  182. package/src/migrations/sqlite/0025_way_in_uses.sql +42 -0
  183. package/src/migrations/sqlite/0026_cutover_finish.sql +11 -0
  184. package/src/migrations/sqlite/0027_reads.sql +38 -0
  185. package/src/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  186. package/src/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  187. package/src/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  188. package/src/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  189. package/src/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  190. package/src/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  191. package/src/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  192. package/src/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  193. package/src/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  194. package/src/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  195. package/src/migrations/sqlite/meta/_journal.json +70 -0
  196. package/src/postgres-js/README.md +183 -0
  197. package/src/postgres-js/UNLICENSE +24 -0
  198. package/src/postgres-js/bytes.ts +89 -0
  199. package/src/postgres-js/connection.ts +882 -0
  200. package/src/postgres-js/errors.ts +84 -0
  201. package/src/postgres-js/index.ts +516 -0
  202. package/src/postgres-js/platform.node.ts +29 -0
  203. package/src/postgres-js/platform.ts +60 -0
  204. package/src/postgres-js/platform.workerd.ts +225 -0
  205. package/src/postgres-js/query.ts +123 -0
  206. package/src/postgres-js/queue.ts +42 -0
  207. package/src/postgres-js/result.ts +46 -0
  208. package/src/postgres-js/types.ts +52 -0
  209. package/src/postgres.ts +375 -26
  210. package/src/schema-version.ts +2 -2
  211. package/src/schema.sqlite.ts +200 -9
  212. package/src/schema.ts +294 -8
  213. package/src/verify-runtime.ts +18 -29
  214. package/LICENSE +0 -21
  215. package/dist/database-CFhTnnzM.d.ts +0 -73
  216. package/dist/postgres-Bmar8y0q.js +0 -29
  217. package/dist/relations-BfR3JjT1.js +0 -38
  218. package/src/relations.ts +0 -40
@@ -0,0 +1,3875 @@
1
+ {
2
+ "id": "c0052422-59c3-4632-9371-d7366117e1e9",
3
+ "prevId": "9e5c5ecd-5882-4879-93ec-36a18c1dd284",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.audit_chain_head": {
8
+ "name": "audit_chain_head",
9
+ "schema": "",
10
+ "columns": {
11
+ "only_row": {
12
+ "name": "only_row",
13
+ "type": "boolean",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": true
17
+ },
18
+ "next_seq": {
19
+ "name": "next_seq",
20
+ "type": "bigint",
21
+ "primaryKey": false,
22
+ "notNull": true,
23
+ "default": "0"
24
+ },
25
+ "head_hash": {
26
+ "name": "head_hash",
27
+ "type": "bytea",
28
+ "primaryKey": false,
29
+ "notNull": true
30
+ }
31
+ },
32
+ "indexes": {},
33
+ "foreignKeys": {},
34
+ "compositePrimaryKeys": {},
35
+ "uniqueConstraints": {},
36
+ "policies": {},
37
+ "checkConstraints": {
38
+ "audit_chain_head_only_row_check": {
39
+ "name": "audit_chain_head_only_row_check",
40
+ "value": "\"audit_chain_head\".\"only_row\""
41
+ },
42
+ "audit_chain_head_next_seq_check": {
43
+ "name": "audit_chain_head_next_seq_check",
44
+ "value": "\"audit_chain_head\".\"next_seq\" >= 0"
45
+ },
46
+ "audit_chain_head_head_hash_check": {
47
+ "name": "audit_chain_head_head_hash_check",
48
+ "value": "octet_length(\"audit_chain_head\".\"head_hash\") = 32"
49
+ }
50
+ },
51
+ "isRLSEnabled": false
52
+ },
53
+ "public.audit_log": {
54
+ "name": "audit_log",
55
+ "schema": "",
56
+ "columns": {
57
+ "seq": {
58
+ "name": "seq",
59
+ "type": "bigint",
60
+ "primaryKey": true,
61
+ "notNull": true
62
+ },
63
+ "author": {
64
+ "name": "author",
65
+ "type": "text",
66
+ "primaryKey": false,
67
+ "notNull": true
68
+ },
69
+ "key_id": {
70
+ "name": "key_id",
71
+ "type": "text",
72
+ "primaryKey": false,
73
+ "notNull": true
74
+ },
75
+ "occurred_at": {
76
+ "name": "occurred_at",
77
+ "type": "bigint",
78
+ "primaryKey": false,
79
+ "notNull": true
80
+ },
81
+ "actor": {
82
+ "name": "actor",
83
+ "type": "text",
84
+ "primaryKey": false,
85
+ "notNull": true
86
+ },
87
+ "action": {
88
+ "name": "action",
89
+ "type": "text",
90
+ "primaryKey": false,
91
+ "notNull": true
92
+ },
93
+ "decision": {
94
+ "name": "decision",
95
+ "type": "text",
96
+ "primaryKey": false,
97
+ "notNull": true
98
+ },
99
+ "code": {
100
+ "name": "code",
101
+ "type": "text",
102
+ "primaryKey": false,
103
+ "notNull": false
104
+ },
105
+ "subject_principal": {
106
+ "name": "subject_principal",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": false
110
+ },
111
+ "project_id": {
112
+ "name": "project_id",
113
+ "type": "uuid",
114
+ "primaryKey": false,
115
+ "notNull": false
116
+ },
117
+ "environment_id": {
118
+ "name": "environment_id",
119
+ "type": "uuid",
120
+ "primaryKey": false,
121
+ "notNull": false
122
+ },
123
+ "secret_id": {
124
+ "name": "secret_id",
125
+ "type": "uuid",
126
+ "primaryKey": false,
127
+ "notNull": false
128
+ },
129
+ "secret_version_id": {
130
+ "name": "secret_version_id",
131
+ "type": "uuid",
132
+ "primaryKey": false,
133
+ "notNull": false
134
+ },
135
+ "operation_id": {
136
+ "name": "operation_id",
137
+ "type": "uuid",
138
+ "primaryKey": false,
139
+ "notNull": false
140
+ },
141
+ "request_id": {
142
+ "name": "request_id",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": false
146
+ },
147
+ "source_ip": {
148
+ "name": "source_ip",
149
+ "type": "text",
150
+ "primaryKey": false,
151
+ "notNull": false
152
+ },
153
+ "related_seq": {
154
+ "name": "related_seq",
155
+ "type": "bigint",
156
+ "primaryKey": false,
157
+ "notNull": false
158
+ },
159
+ "metadata": {
160
+ "name": "metadata",
161
+ "type": "text",
162
+ "primaryKey": false,
163
+ "notNull": true,
164
+ "default": "'{}'"
165
+ },
166
+ "prev_hash": {
167
+ "name": "prev_hash",
168
+ "type": "bytea",
169
+ "primaryKey": false,
170
+ "notNull": true
171
+ },
172
+ "mac": {
173
+ "name": "mac",
174
+ "type": "bytea",
175
+ "primaryKey": false,
176
+ "notNull": true
177
+ },
178
+ "hash": {
179
+ "name": "hash",
180
+ "type": "bytea",
181
+ "primaryKey": false,
182
+ "notNull": true
183
+ }
184
+ },
185
+ "indexes": {
186
+ "audit_log_project_idx": {
187
+ "name": "audit_log_project_idx",
188
+ "columns": [
189
+ {
190
+ "expression": "project_id",
191
+ "isExpression": false,
192
+ "asc": true,
193
+ "nulls": "last"
194
+ },
195
+ {
196
+ "expression": "seq",
197
+ "isExpression": false,
198
+ "asc": true,
199
+ "nulls": "last"
200
+ }
201
+ ],
202
+ "isUnique": false,
203
+ "concurrently": false,
204
+ "method": "btree",
205
+ "with": {}
206
+ },
207
+ "audit_log_environment_idx": {
208
+ "name": "audit_log_environment_idx",
209
+ "columns": [
210
+ {
211
+ "expression": "environment_id",
212
+ "isExpression": false,
213
+ "asc": true,
214
+ "nulls": "last"
215
+ },
216
+ {
217
+ "expression": "seq",
218
+ "isExpression": false,
219
+ "asc": true,
220
+ "nulls": "last"
221
+ }
222
+ ],
223
+ "isUnique": false,
224
+ "concurrently": false,
225
+ "method": "btree",
226
+ "with": {}
227
+ },
228
+ "audit_log_secret_idx": {
229
+ "name": "audit_log_secret_idx",
230
+ "columns": [
231
+ {
232
+ "expression": "secret_id",
233
+ "isExpression": false,
234
+ "asc": true,
235
+ "nulls": "last"
236
+ },
237
+ {
238
+ "expression": "seq",
239
+ "isExpression": false,
240
+ "asc": true,
241
+ "nulls": "last"
242
+ }
243
+ ],
244
+ "isUnique": false,
245
+ "concurrently": false,
246
+ "method": "btree",
247
+ "with": {}
248
+ },
249
+ "audit_log_actor_idx": {
250
+ "name": "audit_log_actor_idx",
251
+ "columns": [
252
+ {
253
+ "expression": "actor",
254
+ "isExpression": false,
255
+ "asc": true,
256
+ "nulls": "last"
257
+ },
258
+ {
259
+ "expression": "seq",
260
+ "isExpression": false,
261
+ "asc": true,
262
+ "nulls": "last"
263
+ }
264
+ ],
265
+ "isUnique": false,
266
+ "concurrently": false,
267
+ "method": "btree",
268
+ "with": {}
269
+ },
270
+ "audit_log_operation_idx": {
271
+ "name": "audit_log_operation_idx",
272
+ "columns": [
273
+ {
274
+ "expression": "operation_id",
275
+ "isExpression": false,
276
+ "asc": true,
277
+ "nulls": "last"
278
+ },
279
+ {
280
+ "expression": "seq",
281
+ "isExpression": false,
282
+ "asc": true,
283
+ "nulls": "last"
284
+ }
285
+ ],
286
+ "isUnique": false,
287
+ "concurrently": false,
288
+ "method": "btree",
289
+ "with": {}
290
+ },
291
+ "audit_log_action_idx": {
292
+ "name": "audit_log_action_idx",
293
+ "columns": [
294
+ {
295
+ "expression": "author",
296
+ "isExpression": false,
297
+ "asc": true,
298
+ "nulls": "last"
299
+ },
300
+ {
301
+ "expression": "action",
302
+ "isExpression": false,
303
+ "asc": true,
304
+ "nulls": "last"
305
+ },
306
+ {
307
+ "expression": "seq",
308
+ "isExpression": false,
309
+ "asc": true,
310
+ "nulls": "last"
311
+ }
312
+ ],
313
+ "isUnique": false,
314
+ "concurrently": false,
315
+ "method": "btree",
316
+ "with": {}
317
+ },
318
+ "audit_log_releases_idx": {
319
+ "name": "audit_log_releases_idx",
320
+ "columns": [
321
+ {
322
+ "expression": "author",
323
+ "isExpression": false,
324
+ "asc": true,
325
+ "nulls": "last"
326
+ },
327
+ {
328
+ "expression": "actor",
329
+ "isExpression": false,
330
+ "asc": true,
331
+ "nulls": "last"
332
+ },
333
+ {
334
+ "expression": "action",
335
+ "isExpression": false,
336
+ "asc": true,
337
+ "nulls": "last"
338
+ },
339
+ {
340
+ "expression": "decision",
341
+ "isExpression": false,
342
+ "asc": true,
343
+ "nulls": "last"
344
+ },
345
+ {
346
+ "expression": "occurred_at",
347
+ "isExpression": false,
348
+ "asc": true,
349
+ "nulls": "last"
350
+ }
351
+ ],
352
+ "isUnique": false,
353
+ "concurrently": false,
354
+ "method": "btree",
355
+ "with": {}
356
+ },
357
+ "audit_log_subject_idx": {
358
+ "name": "audit_log_subject_idx",
359
+ "columns": [
360
+ {
361
+ "expression": "author",
362
+ "isExpression": false,
363
+ "asc": true,
364
+ "nulls": "last"
365
+ },
366
+ {
367
+ "expression": "subject_principal",
368
+ "isExpression": false,
369
+ "asc": true,
370
+ "nulls": "last"
371
+ },
372
+ {
373
+ "expression": "seq",
374
+ "isExpression": false,
375
+ "asc": true,
376
+ "nulls": "last"
377
+ }
378
+ ],
379
+ "isUnique": false,
380
+ "concurrently": false,
381
+ "method": "btree",
382
+ "with": {}
383
+ },
384
+ "audit_log_unbind_idx": {
385
+ "name": "audit_log_unbind_idx",
386
+ "columns": [
387
+ {
388
+ "expression": "((\"metadata\")::jsonb ->> 'bindingId')",
389
+ "asc": true,
390
+ "isExpression": true,
391
+ "nulls": "last"
392
+ }
393
+ ],
394
+ "isUnique": false,
395
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.unbind' AND \"audit_log\".\"decision\" = 'allow'",
396
+ "concurrently": false,
397
+ "method": "btree",
398
+ "with": {}
399
+ },
400
+ "audit_log_freeze_idx": {
401
+ "name": "audit_log_freeze_idx",
402
+ "columns": [
403
+ {
404
+ "expression": "((\"metadata\")::jsonb ->> 'target')",
405
+ "asc": true,
406
+ "isExpression": true,
407
+ "nulls": "last"
408
+ },
409
+ {
410
+ "expression": "seq",
411
+ "isExpression": false,
412
+ "asc": false,
413
+ "nulls": "last"
414
+ }
415
+ ],
416
+ "isUnique": false,
417
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" IN ('workload.freeze', 'workload.unfreeze') AND \"audit_log\".\"decision\" = 'allow'",
418
+ "concurrently": false,
419
+ "method": "btree",
420
+ "with": {}
421
+ },
422
+ "audit_log_supersede_idx": {
423
+ "name": "audit_log_supersede_idx",
424
+ "columns": [
425
+ {
426
+ "expression": "((\"metadata\")::jsonb ->> 'enrollmentId')",
427
+ "asc": true,
428
+ "isExpression": true,
429
+ "nulls": "last"
430
+ }
431
+ ],
432
+ "isUnique": false,
433
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'enrollment.supersede' AND \"audit_log\".\"decision\" = 'allow'",
434
+ "concurrently": false,
435
+ "method": "btree",
436
+ "with": {}
437
+ },
438
+ "audit_log_exchange_idx": {
439
+ "name": "audit_log_exchange_idx",
440
+ "columns": [
441
+ {
442
+ "expression": "((\"metadata\")::jsonb ->> 'credentialId')",
443
+ "asc": true,
444
+ "isExpression": true,
445
+ "nulls": "last"
446
+ }
447
+ ],
448
+ "isUnique": false,
449
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.exchange' AND \"audit_log\".\"decision\" = 'allow'",
450
+ "concurrently": false,
451
+ "method": "btree",
452
+ "with": {}
453
+ },
454
+ "audit_log_token_create_idx": {
455
+ "name": "audit_log_token_create_idx",
456
+ "columns": [
457
+ {
458
+ "expression": "((\"metadata\")::jsonb ->> 'targetCredentialId')",
459
+ "asc": true,
460
+ "isExpression": true,
461
+ "nulls": "last"
462
+ }
463
+ ],
464
+ "isUnique": false,
465
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.create' AND \"audit_log\".\"decision\" = 'allow'",
466
+ "concurrently": false,
467
+ "method": "btree",
468
+ "with": {}
469
+ },
470
+ "audit_log_reference_end_idx": {
471
+ "name": "audit_log_reference_end_idx",
472
+ "columns": [
473
+ {
474
+ "expression": "related_seq",
475
+ "isExpression": false,
476
+ "asc": true,
477
+ "nulls": "last"
478
+ }
479
+ ],
480
+ "isUnique": false,
481
+ "where": "\"audit_log\".\"author\" = 'vault' AND \"audit_log\".\"action\" = 'reference.end' AND \"audit_log\".\"decision\" = 'allow'",
482
+ "concurrently": false,
483
+ "method": "btree",
484
+ "with": {}
485
+ },
486
+ "audit_log_also_project_idx": {
487
+ "name": "audit_log_also_project_idx",
488
+ "columns": [
489
+ {
490
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'projectId')",
491
+ "asc": true,
492
+ "isExpression": true,
493
+ "nulls": "last"
494
+ },
495
+ {
496
+ "expression": "seq",
497
+ "isExpression": false,
498
+ "asc": true,
499
+ "nulls": "last"
500
+ }
501
+ ],
502
+ "isUnique": false,
503
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
504
+ "concurrently": false,
505
+ "method": "btree",
506
+ "with": {}
507
+ },
508
+ "audit_log_also_environment_idx": {
509
+ "name": "audit_log_also_environment_idx",
510
+ "columns": [
511
+ {
512
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'environmentId')",
513
+ "asc": true,
514
+ "isExpression": true,
515
+ "nulls": "last"
516
+ },
517
+ {
518
+ "expression": "seq",
519
+ "isExpression": false,
520
+ "asc": true,
521
+ "nulls": "last"
522
+ }
523
+ ],
524
+ "isUnique": false,
525
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
526
+ "concurrently": false,
527
+ "method": "btree",
528
+ "with": {}
529
+ },
530
+ "audit_log_also_secret_idx": {
531
+ "name": "audit_log_also_secret_idx",
532
+ "columns": [
533
+ {
534
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'secretId')",
535
+ "asc": true,
536
+ "isExpression": true,
537
+ "nulls": "last"
538
+ },
539
+ {
540
+ "expression": "seq",
541
+ "isExpression": false,
542
+ "asc": true,
543
+ "nulls": "last"
544
+ }
545
+ ],
546
+ "isUnique": false,
547
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
548
+ "concurrently": false,
549
+ "method": "btree",
550
+ "with": {}
551
+ }
552
+ },
553
+ "foreignKeys": {
554
+ "audit_log_project_id_fkey": {
555
+ "name": "audit_log_project_id_fkey",
556
+ "tableFrom": "audit_log",
557
+ "tableTo": "projects",
558
+ "columnsFrom": [
559
+ "project_id"
560
+ ],
561
+ "columnsTo": [
562
+ "id"
563
+ ],
564
+ "onDelete": "restrict",
565
+ "onUpdate": "no action"
566
+ },
567
+ "audit_log_environment_id_fkey": {
568
+ "name": "audit_log_environment_id_fkey",
569
+ "tableFrom": "audit_log",
570
+ "tableTo": "environments",
571
+ "columnsFrom": [
572
+ "environment_id"
573
+ ],
574
+ "columnsTo": [
575
+ "id"
576
+ ],
577
+ "onDelete": "restrict",
578
+ "onUpdate": "no action"
579
+ },
580
+ "audit_log_secret_id_fkey": {
581
+ "name": "audit_log_secret_id_fkey",
582
+ "tableFrom": "audit_log",
583
+ "tableTo": "secrets",
584
+ "columnsFrom": [
585
+ "secret_id"
586
+ ],
587
+ "columnsTo": [
588
+ "id"
589
+ ],
590
+ "onDelete": "restrict",
591
+ "onUpdate": "no action"
592
+ },
593
+ "audit_log_secret_version_id_fkey": {
594
+ "name": "audit_log_secret_version_id_fkey",
595
+ "tableFrom": "audit_log",
596
+ "tableTo": "secret_versions",
597
+ "columnsFrom": [
598
+ "secret_version_id"
599
+ ],
600
+ "columnsTo": [
601
+ "id"
602
+ ],
603
+ "onDelete": "restrict",
604
+ "onUpdate": "no action"
605
+ },
606
+ "audit_log_related_seq_fkey": {
607
+ "name": "audit_log_related_seq_fkey",
608
+ "tableFrom": "audit_log",
609
+ "tableTo": "audit_log",
610
+ "columnsFrom": [
611
+ "related_seq"
612
+ ],
613
+ "columnsTo": [
614
+ "seq"
615
+ ],
616
+ "onDelete": "restrict",
617
+ "onUpdate": "no action"
618
+ }
619
+ },
620
+ "compositePrimaryKeys": {},
621
+ "uniqueConstraints": {},
622
+ "policies": {},
623
+ "checkConstraints": {
624
+ "audit_log_author_check": {
625
+ "name": "audit_log_author_check",
626
+ "value": "\"audit_log\".\"author\" IN ('app', 'vault')"
627
+ },
628
+ "audit_log_actor_check": {
629
+ "name": "audit_log_actor_check",
630
+ "value": "\"audit_log\".\"actor\" ~ '^(user|token|system):.+$'"
631
+ },
632
+ "audit_log_decision_check": {
633
+ "name": "audit_log_decision_check",
634
+ "value": "\"audit_log\".\"decision\" IN ('allow', 'deny')"
635
+ },
636
+ "audit_log_metadata_check": {
637
+ "name": "audit_log_metadata_check",
638
+ "value": "\"audit_log\".\"metadata\"::jsonb IS NOT NULL"
639
+ },
640
+ "audit_log_prev_hash_check": {
641
+ "name": "audit_log_prev_hash_check",
642
+ "value": "octet_length(\"audit_log\".\"prev_hash\") = 32"
643
+ },
644
+ "audit_log_mac_check": {
645
+ "name": "audit_log_mac_check",
646
+ "value": "octet_length(\"audit_log\".\"mac\") = 32"
647
+ },
648
+ "audit_log_hash_check": {
649
+ "name": "audit_log_hash_check",
650
+ "value": "octet_length(\"audit_log\".\"hash\") = 32"
651
+ }
652
+ },
653
+ "isRLSEnabled": false
654
+ },
655
+ "public.capped_alerts": {
656
+ "name": "capped_alerts",
657
+ "schema": "",
658
+ "columns": {
659
+ "service": {
660
+ "name": "service",
661
+ "type": "text",
662
+ "primaryKey": false,
663
+ "notNull": true
664
+ },
665
+ "kind": {
666
+ "name": "kind",
667
+ "type": "text",
668
+ "primaryKey": false,
669
+ "notNull": true
670
+ },
671
+ "raised_at": {
672
+ "name": "raised_at",
673
+ "type": "timestamp with time zone",
674
+ "primaryKey": false,
675
+ "notNull": true
676
+ }
677
+ },
678
+ "indexes": {},
679
+ "foreignKeys": {},
680
+ "compositePrimaryKeys": {
681
+ "capped_alerts_pkey": {
682
+ "name": "capped_alerts_pkey",
683
+ "columns": [
684
+ "service",
685
+ "kind"
686
+ ]
687
+ }
688
+ },
689
+ "uniqueConstraints": {},
690
+ "policies": {},
691
+ "checkConstraints": {},
692
+ "isRLSEnabled": false
693
+ },
694
+ "public.consumed_tokens": {
695
+ "name": "consumed_tokens",
696
+ "schema": "",
697
+ "columns": {
698
+ "hash": {
699
+ "name": "hash",
700
+ "type": "bytea",
701
+ "primaryKey": true,
702
+ "notNull": true
703
+ },
704
+ "consumed_at": {
705
+ "name": "consumed_at",
706
+ "type": "timestamp with time zone",
707
+ "primaryKey": false,
708
+ "notNull": true,
709
+ "default": "now()"
710
+ }
711
+ },
712
+ "indexes": {},
713
+ "foreignKeys": {},
714
+ "compositePrimaryKeys": {},
715
+ "uniqueConstraints": {},
716
+ "policies": {},
717
+ "checkConstraints": {
718
+ "consumed_tokens_hash_check": {
719
+ "name": "consumed_tokens_hash_check",
720
+ "value": "octet_length(\"consumed_tokens\".\"hash\") = 32"
721
+ }
722
+ },
723
+ "isRLSEnabled": false
724
+ },
725
+ "public.credentials": {
726
+ "name": "credentials",
727
+ "schema": "",
728
+ "columns": {
729
+ "id": {
730
+ "name": "id",
731
+ "type": "uuid",
732
+ "primaryKey": true,
733
+ "notNull": true,
734
+ "default": "gen_random_uuid()"
735
+ },
736
+ "kind": {
737
+ "name": "kind",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": true
741
+ },
742
+ "auth_mac": {
743
+ "name": "auth_mac",
744
+ "type": "bytea",
745
+ "primaryKey": false,
746
+ "notNull": true
747
+ },
748
+ "token_hash": {
749
+ "name": "token_hash",
750
+ "type": "bytea",
751
+ "primaryKey": false,
752
+ "notNull": true
753
+ },
754
+ "token_hint": {
755
+ "name": "token_hint",
756
+ "type": "text",
757
+ "primaryKey": false,
758
+ "notNull": true
759
+ },
760
+ "generation": {
761
+ "name": "generation",
762
+ "type": "integer",
763
+ "primaryKey": false,
764
+ "notNull": true
765
+ },
766
+ "principal": {
767
+ "name": "principal",
768
+ "type": "text",
769
+ "primaryKey": false,
770
+ "notNull": true
771
+ },
772
+ "identity_id": {
773
+ "name": "identity_id",
774
+ "type": "uuid",
775
+ "primaryKey": false,
776
+ "notNull": false
777
+ },
778
+ "scope": {
779
+ "name": "scope",
780
+ "type": "text",
781
+ "primaryKey": false,
782
+ "notNull": false
783
+ },
784
+ "places": {
785
+ "name": "places",
786
+ "type": "text",
787
+ "primaryKey": false,
788
+ "notNull": false
789
+ },
790
+ "label": {
791
+ "name": "label",
792
+ "type": "text",
793
+ "primaryKey": false,
794
+ "notNull": false
795
+ },
796
+ "created_at": {
797
+ "name": "created_at",
798
+ "type": "timestamp with time zone",
799
+ "primaryKey": false,
800
+ "notNull": true,
801
+ "default": "now()"
802
+ },
803
+ "created_by": {
804
+ "name": "created_by",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": true
808
+ },
809
+ "expires_at": {
810
+ "name": "expires_at",
811
+ "type": "timestamp with time zone",
812
+ "primaryKey": false,
813
+ "notNull": true
814
+ },
815
+ "last_used_at": {
816
+ "name": "last_used_at",
817
+ "type": "timestamp with time zone",
818
+ "primaryKey": false,
819
+ "notNull": false
820
+ },
821
+ "last_used_ip": {
822
+ "name": "last_used_ip",
823
+ "type": "text",
824
+ "primaryKey": false,
825
+ "notNull": false
826
+ },
827
+ "revoked_at": {
828
+ "name": "revoked_at",
829
+ "type": "timestamp with time zone",
830
+ "primaryKey": false,
831
+ "notNull": false
832
+ },
833
+ "revoked_by": {
834
+ "name": "revoked_by",
835
+ "type": "text",
836
+ "primaryKey": false,
837
+ "notNull": false
838
+ },
839
+ "jkt": {
840
+ "name": "jkt",
841
+ "type": "text",
842
+ "primaryKey": false,
843
+ "notNull": false
844
+ },
845
+ "not_after": {
846
+ "name": "not_after",
847
+ "type": "timestamp with time zone",
848
+ "primaryKey": false,
849
+ "notNull": false
850
+ },
851
+ "ancestors": {
852
+ "name": "ancestors",
853
+ "type": "text",
854
+ "primaryKey": false,
855
+ "notNull": false
856
+ },
857
+ "constraints": {
858
+ "name": "constraints",
859
+ "type": "text",
860
+ "primaryKey": false,
861
+ "notNull": false
862
+ },
863
+ "enrollment_id": {
864
+ "name": "enrollment_id",
865
+ "type": "uuid",
866
+ "primaryKey": false,
867
+ "notNull": false
868
+ },
869
+ "approved_at": {
870
+ "name": "approved_at",
871
+ "type": "timestamp with time zone",
872
+ "primaryKey": false,
873
+ "notNull": false
874
+ },
875
+ "approved_by": {
876
+ "name": "approved_by",
877
+ "type": "text",
878
+ "primaryKey": false,
879
+ "notNull": false
880
+ },
881
+ "seal": {
882
+ "name": "seal",
883
+ "type": "bytea",
884
+ "primaryKey": false,
885
+ "notNull": false
886
+ }
887
+ },
888
+ "indexes": {
889
+ "credentials_principal_idx": {
890
+ "name": "credentials_principal_idx",
891
+ "columns": [
892
+ {
893
+ "expression": "principal",
894
+ "isExpression": false,
895
+ "asc": true,
896
+ "nulls": "last"
897
+ },
898
+ {
899
+ "expression": "generation",
900
+ "isExpression": false,
901
+ "asc": true,
902
+ "nulls": "last"
903
+ }
904
+ ],
905
+ "isUnique": false,
906
+ "concurrently": false,
907
+ "method": "btree",
908
+ "with": {}
909
+ },
910
+ "credentials_live_idx": {
911
+ "name": "credentials_live_idx",
912
+ "columns": [
913
+ {
914
+ "expression": "principal",
915
+ "isExpression": false,
916
+ "asc": true,
917
+ "nulls": "last"
918
+ },
919
+ {
920
+ "expression": "expires_at",
921
+ "isExpression": false,
922
+ "asc": true,
923
+ "nulls": "last"
924
+ }
925
+ ],
926
+ "isUnique": false,
927
+ "where": "\"credentials\".\"revoked_at\" IS NULL",
928
+ "concurrently": false,
929
+ "method": "btree",
930
+ "with": {}
931
+ },
932
+ "credentials_issued_by_idx": {
933
+ "name": "credentials_issued_by_idx",
934
+ "columns": [
935
+ {
936
+ "expression": "principal",
937
+ "isExpression": false,
938
+ "asc": true,
939
+ "nulls": "last"
940
+ },
941
+ {
942
+ "expression": "created_by",
943
+ "isExpression": false,
944
+ "asc": true,
945
+ "nulls": "last"
946
+ },
947
+ {
948
+ "expression": "created_at",
949
+ "isExpression": false,
950
+ "asc": true,
951
+ "nulls": "last"
952
+ }
953
+ ],
954
+ "isUnique": false,
955
+ "concurrently": false,
956
+ "method": "btree",
957
+ "with": {}
958
+ },
959
+ "credentials_enrollment_roots_idx": {
960
+ "name": "credentials_enrollment_roots_idx",
961
+ "columns": [
962
+ {
963
+ "expression": "enrollment_id",
964
+ "isExpression": false,
965
+ "asc": true,
966
+ "nulls": "last"
967
+ },
968
+ {
969
+ "expression": "created_at",
970
+ "isExpression": false,
971
+ "asc": true,
972
+ "nulls": "last"
973
+ }
974
+ ],
975
+ "isUnique": false,
976
+ "where": "\"credentials\".\"kind\" = 'workload' AND \"credentials\".\"ancestors\" IS NULL",
977
+ "concurrently": false,
978
+ "method": "btree",
979
+ "with": {}
980
+ }
981
+ },
982
+ "foreignKeys": {
983
+ "credentials_principal_fkey": {
984
+ "name": "credentials_principal_fkey",
985
+ "tableFrom": "credentials",
986
+ "tableTo": "vault_members",
987
+ "columnsFrom": [
988
+ "principal"
989
+ ],
990
+ "columnsTo": [
991
+ "principal"
992
+ ],
993
+ "onDelete": "restrict",
994
+ "onUpdate": "no action"
995
+ },
996
+ "credentials_identity_id_fkey": {
997
+ "name": "credentials_identity_id_fkey",
998
+ "tableFrom": "credentials",
999
+ "tableTo": "identities",
1000
+ "columnsFrom": [
1001
+ "identity_id",
1002
+ "principal",
1003
+ "generation"
1004
+ ],
1005
+ "columnsTo": [
1006
+ "id",
1007
+ "principal",
1008
+ "generation"
1009
+ ],
1010
+ "onDelete": "restrict",
1011
+ "onUpdate": "no action"
1012
+ },
1013
+ "credentials_enrollment_id_fkey": {
1014
+ "name": "credentials_enrollment_id_fkey",
1015
+ "tableFrom": "credentials",
1016
+ "tableTo": "enrollments",
1017
+ "columnsFrom": [
1018
+ "enrollment_id"
1019
+ ],
1020
+ "columnsTo": [
1021
+ "id"
1022
+ ],
1023
+ "onDelete": "restrict",
1024
+ "onUpdate": "no action"
1025
+ }
1026
+ },
1027
+ "compositePrimaryKeys": {},
1028
+ "uniqueConstraints": {
1029
+ "credentials_token_hash_key": {
1030
+ "name": "credentials_token_hash_key",
1031
+ "nullsNotDistinct": false,
1032
+ "columns": [
1033
+ "token_hash"
1034
+ ]
1035
+ }
1036
+ },
1037
+ "policies": {},
1038
+ "checkConstraints": {
1039
+ "credentials_seal_check": {
1040
+ "name": "credentials_seal_check",
1041
+ "value": "\"credentials\".\"seal\" IS NULL OR octet_length(\"credentials\".\"seal\") = 16"
1042
+ },
1043
+ "credentials_kind_check": {
1044
+ "name": "credentials_kind_check",
1045
+ "value": "\"credentials\".\"kind\" IN ('browser', 'cli', 'service', 'personal', 'handle', 'workload')"
1046
+ },
1047
+ "credentials_principal_check": {
1048
+ "name": "credentials_principal_check",
1049
+ "value": "\"credentials\".\"principal\" LIKE 'user:%' OR \"credentials\".\"principal\" LIKE 'token:%'"
1050
+ },
1051
+ "credentials_kind_matches_principal": {
1052
+ "name": "credentials_kind_matches_principal",
1053
+ "value": "(\"credentials\".\"kind\" IN ('service', 'workload')) = (\"credentials\".\"principal\" LIKE 'token:%')"
1054
+ },
1055
+ "credentials_workload_jkt_check": {
1056
+ "name": "credentials_workload_jkt_check",
1057
+ "value": "\"credentials\".\"kind\" <> 'workload' OR \"credentials\".\"jkt\" IS NOT NULL"
1058
+ },
1059
+ "credentials_token_hash_check": {
1060
+ "name": "credentials_token_hash_check",
1061
+ "value": "octet_length(\"credentials\".\"token_hash\") = 32"
1062
+ },
1063
+ "credentials_auth_mac_check": {
1064
+ "name": "credentials_auth_mac_check",
1065
+ "value": "octet_length(\"credentials\".\"auth_mac\") = 32"
1066
+ }
1067
+ },
1068
+ "isRLSEnabled": false
1069
+ },
1070
+ "public.device_authorizations": {
1071
+ "name": "device_authorizations",
1072
+ "schema": "",
1073
+ "columns": {
1074
+ "id": {
1075
+ "name": "id",
1076
+ "type": "uuid",
1077
+ "primaryKey": true,
1078
+ "notNull": true,
1079
+ "default": "gen_random_uuid()"
1080
+ },
1081
+ "device_code_hash": {
1082
+ "name": "device_code_hash",
1083
+ "type": "bytea",
1084
+ "primaryKey": false,
1085
+ "notNull": true
1086
+ },
1087
+ "auth_mac": {
1088
+ "name": "auth_mac",
1089
+ "type": "bytea",
1090
+ "primaryKey": false,
1091
+ "notNull": true
1092
+ },
1093
+ "user_code": {
1094
+ "name": "user_code",
1095
+ "type": "text",
1096
+ "primaryKey": false,
1097
+ "notNull": true
1098
+ },
1099
+ "client_label": {
1100
+ "name": "client_label",
1101
+ "type": "text",
1102
+ "primaryKey": false,
1103
+ "notNull": false
1104
+ },
1105
+ "client_ip": {
1106
+ "name": "client_ip",
1107
+ "type": "text",
1108
+ "primaryKey": false,
1109
+ "notNull": false
1110
+ },
1111
+ "created_at": {
1112
+ "name": "created_at",
1113
+ "type": "timestamp with time zone",
1114
+ "primaryKey": false,
1115
+ "notNull": true,
1116
+ "default": "now()"
1117
+ },
1118
+ "expires_at": {
1119
+ "name": "expires_at",
1120
+ "type": "timestamp with time zone",
1121
+ "primaryKey": false,
1122
+ "notNull": true
1123
+ },
1124
+ "decided_at": {
1125
+ "name": "decided_at",
1126
+ "type": "timestamp with time zone",
1127
+ "primaryKey": false,
1128
+ "notNull": false
1129
+ },
1130
+ "decision": {
1131
+ "name": "decision",
1132
+ "type": "text",
1133
+ "primaryKey": false,
1134
+ "notNull": false
1135
+ },
1136
+ "generation": {
1137
+ "name": "generation",
1138
+ "type": "integer",
1139
+ "primaryKey": false,
1140
+ "notNull": true,
1141
+ "default": 0
1142
+ },
1143
+ "principal": {
1144
+ "name": "principal",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": false
1148
+ },
1149
+ "consumed_at": {
1150
+ "name": "consumed_at",
1151
+ "type": "timestamp with time zone",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ }
1155
+ },
1156
+ "indexes": {},
1157
+ "foreignKeys": {
1158
+ "device_authorizations_principal_fkey": {
1159
+ "name": "device_authorizations_principal_fkey",
1160
+ "tableFrom": "device_authorizations",
1161
+ "tableTo": "vault_members",
1162
+ "columnsFrom": [
1163
+ "principal"
1164
+ ],
1165
+ "columnsTo": [
1166
+ "principal"
1167
+ ],
1168
+ "onDelete": "restrict",
1169
+ "onUpdate": "no action"
1170
+ }
1171
+ },
1172
+ "compositePrimaryKeys": {},
1173
+ "uniqueConstraints": {
1174
+ "device_authorizations_device_code_hash_key": {
1175
+ "name": "device_authorizations_device_code_hash_key",
1176
+ "nullsNotDistinct": false,
1177
+ "columns": [
1178
+ "device_code_hash"
1179
+ ]
1180
+ },
1181
+ "device_authorizations_user_code_key": {
1182
+ "name": "device_authorizations_user_code_key",
1183
+ "nullsNotDistinct": false,
1184
+ "columns": [
1185
+ "user_code"
1186
+ ]
1187
+ }
1188
+ },
1189
+ "policies": {},
1190
+ "checkConstraints": {
1191
+ "device_authorizations_auth_mac_check": {
1192
+ "name": "device_authorizations_auth_mac_check",
1193
+ "value": "octet_length(\"device_authorizations\".\"auth_mac\") = 32"
1194
+ },
1195
+ "device_authorizations_decision_check": {
1196
+ "name": "device_authorizations_decision_check",
1197
+ "value": "\"device_authorizations\".\"decision\" IS NULL OR \"device_authorizations\".\"decision\" IN ('approved', 'denied')"
1198
+ },
1199
+ "device_authorizations_approval_names_principal": {
1200
+ "name": "device_authorizations_approval_names_principal",
1201
+ "value": "(\"device_authorizations\".\"decision\" IS NULL AND \"device_authorizations\".\"decided_at\" IS NULL AND \"device_authorizations\".\"principal\" IS NULL AND \"device_authorizations\".\"generation\" = 0 AND \"device_authorizations\".\"consumed_at\" IS NULL)\n OR (\"device_authorizations\".\"decision\" IS NOT NULL AND \"device_authorizations\".\"decided_at\" IS NOT NULL AND (\n (\"device_authorizations\".\"decision\" = 'denied' AND \"device_authorizations\".\"principal\" IS NULL AND \"device_authorizations\".\"generation\" = 0 AND \"device_authorizations\".\"consumed_at\" IS NULL)\n OR (\"device_authorizations\".\"decision\" = 'approved' AND \"device_authorizations\".\"principal\" IS NOT NULL AND \"device_authorizations\".\"principal\" LIKE 'user:%')\n ))"
1202
+ }
1203
+ },
1204
+ "isRLSEnabled": false
1205
+ },
1206
+ "public.dismissed_keys": {
1207
+ "name": "dismissed_keys",
1208
+ "schema": "",
1209
+ "columns": {
1210
+ "environment_id": {
1211
+ "name": "environment_id",
1212
+ "type": "uuid",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "key": {
1217
+ "name": "key",
1218
+ "type": "text",
1219
+ "primaryKey": false,
1220
+ "notNull": true
1221
+ },
1222
+ "dismissed_at": {
1223
+ "name": "dismissed_at",
1224
+ "type": "timestamp with time zone",
1225
+ "primaryKey": false,
1226
+ "notNull": true,
1227
+ "default": "now()"
1228
+ },
1229
+ "dismissed_by": {
1230
+ "name": "dismissed_by",
1231
+ "type": "text",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "restored_at": {
1236
+ "name": "restored_at",
1237
+ "type": "timestamp with time zone",
1238
+ "primaryKey": false,
1239
+ "notNull": false
1240
+ },
1241
+ "restored_by": {
1242
+ "name": "restored_by",
1243
+ "type": "text",
1244
+ "primaryKey": false,
1245
+ "notNull": false
1246
+ }
1247
+ },
1248
+ "indexes": {},
1249
+ "foreignKeys": {
1250
+ "dismissed_keys_environment_id_fkey": {
1251
+ "name": "dismissed_keys_environment_id_fkey",
1252
+ "tableFrom": "dismissed_keys",
1253
+ "tableTo": "environments",
1254
+ "columnsFrom": [
1255
+ "environment_id"
1256
+ ],
1257
+ "columnsTo": [
1258
+ "id"
1259
+ ],
1260
+ "onDelete": "restrict",
1261
+ "onUpdate": "no action"
1262
+ }
1263
+ },
1264
+ "compositePrimaryKeys": {
1265
+ "dismissed_keys_pkey": {
1266
+ "name": "dismissed_keys_pkey",
1267
+ "columns": [
1268
+ "environment_id",
1269
+ "key"
1270
+ ]
1271
+ }
1272
+ },
1273
+ "uniqueConstraints": {},
1274
+ "policies": {},
1275
+ "checkConstraints": {
1276
+ "dismissed_keys_key_check": {
1277
+ "name": "dismissed_keys_key_check",
1278
+ "value": "\"dismissed_keys\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
1279
+ }
1280
+ },
1281
+ "isRLSEnabled": false
1282
+ },
1283
+ "public.enrollments": {
1284
+ "name": "enrollments",
1285
+ "schema": "",
1286
+ "columns": {
1287
+ "id": {
1288
+ "name": "id",
1289
+ "type": "uuid",
1290
+ "primaryKey": true,
1291
+ "notNull": true
1292
+ },
1293
+ "auth_mac": {
1294
+ "name": "auth_mac",
1295
+ "type": "bytea",
1296
+ "primaryKey": false,
1297
+ "notNull": true
1298
+ },
1299
+ "binding_id": {
1300
+ "name": "binding_id",
1301
+ "type": "uuid",
1302
+ "primaryKey": false,
1303
+ "notNull": true
1304
+ },
1305
+ "code_hash": {
1306
+ "name": "code_hash",
1307
+ "type": "bytea",
1308
+ "primaryKey": false,
1309
+ "notNull": true
1310
+ },
1311
+ "code_hint": {
1312
+ "name": "code_hint",
1313
+ "type": "text",
1314
+ "primaryKey": false,
1315
+ "notNull": true
1316
+ },
1317
+ "scope": {
1318
+ "name": "scope",
1319
+ "type": "text",
1320
+ "primaryKey": false,
1321
+ "notNull": true
1322
+ },
1323
+ "created_at": {
1324
+ "name": "created_at",
1325
+ "type": "timestamp with time zone",
1326
+ "primaryKey": false,
1327
+ "notNull": true,
1328
+ "default": "now()"
1329
+ },
1330
+ "created_by": {
1331
+ "name": "created_by",
1332
+ "type": "text",
1333
+ "primaryKey": false,
1334
+ "notNull": true
1335
+ },
1336
+ "created_with": {
1337
+ "name": "created_with",
1338
+ "type": "uuid",
1339
+ "primaryKey": false,
1340
+ "notNull": false
1341
+ },
1342
+ "expires_at": {
1343
+ "name": "expires_at",
1344
+ "type": "timestamp with time zone",
1345
+ "primaryKey": false,
1346
+ "notNull": true
1347
+ }
1348
+ },
1349
+ "indexes": {
1350
+ "enrollments_binding_idx": {
1351
+ "name": "enrollments_binding_idx",
1352
+ "columns": [
1353
+ {
1354
+ "expression": "binding_id",
1355
+ "isExpression": false,
1356
+ "asc": true,
1357
+ "nulls": "last"
1358
+ },
1359
+ {
1360
+ "expression": "created_at",
1361
+ "isExpression": false,
1362
+ "asc": false,
1363
+ "nulls": "last"
1364
+ }
1365
+ ],
1366
+ "isUnique": false,
1367
+ "concurrently": false,
1368
+ "method": "btree",
1369
+ "with": {}
1370
+ }
1371
+ },
1372
+ "foreignKeys": {
1373
+ "enrollments_binding_id_fkey": {
1374
+ "name": "enrollments_binding_id_fkey",
1375
+ "tableFrom": "enrollments",
1376
+ "tableTo": "service_bindings",
1377
+ "columnsFrom": [
1378
+ "binding_id"
1379
+ ],
1380
+ "columnsTo": [
1381
+ "id"
1382
+ ],
1383
+ "onDelete": "restrict",
1384
+ "onUpdate": "no action"
1385
+ }
1386
+ },
1387
+ "compositePrimaryKeys": {},
1388
+ "uniqueConstraints": {
1389
+ "enrollments_code_hash_key": {
1390
+ "name": "enrollments_code_hash_key",
1391
+ "nullsNotDistinct": false,
1392
+ "columns": [
1393
+ "code_hash"
1394
+ ]
1395
+ }
1396
+ },
1397
+ "policies": {},
1398
+ "checkConstraints": {
1399
+ "enrollments_auth_mac_check": {
1400
+ "name": "enrollments_auth_mac_check",
1401
+ "value": "octet_length(\"enrollments\".\"auth_mac\") = 32"
1402
+ },
1403
+ "enrollments_code_hash_check": {
1404
+ "name": "enrollments_code_hash_check",
1405
+ "value": "octet_length(\"enrollments\".\"code_hash\") = 32"
1406
+ },
1407
+ "enrollments_scope_check": {
1408
+ "name": "enrollments_scope_check",
1409
+ "value": "\"enrollments\".\"scope\"::jsonb IS NOT NULL"
1410
+ }
1411
+ },
1412
+ "isRLSEnabled": false
1413
+ },
1414
+ "public.environments": {
1415
+ "name": "environments",
1416
+ "schema": "",
1417
+ "columns": {
1418
+ "id": {
1419
+ "name": "id",
1420
+ "type": "uuid",
1421
+ "primaryKey": true,
1422
+ "notNull": true,
1423
+ "default": "gen_random_uuid()"
1424
+ },
1425
+ "project_id": {
1426
+ "name": "project_id",
1427
+ "type": "uuid",
1428
+ "primaryKey": false,
1429
+ "notNull": true
1430
+ },
1431
+ "slug": {
1432
+ "name": "slug",
1433
+ "type": "text",
1434
+ "primaryKey": false,
1435
+ "notNull": true
1436
+ },
1437
+ "name": {
1438
+ "name": "name",
1439
+ "type": "text",
1440
+ "primaryKey": false,
1441
+ "notNull": true
1442
+ },
1443
+ "created_at": {
1444
+ "name": "created_at",
1445
+ "type": "timestamp with time zone",
1446
+ "primaryKey": false,
1447
+ "notNull": true,
1448
+ "default": "now()"
1449
+ },
1450
+ "archived_at": {
1451
+ "name": "archived_at",
1452
+ "type": "timestamp with time zone",
1453
+ "primaryKey": false,
1454
+ "notNull": false
1455
+ },
1456
+ "parent_id": {
1457
+ "name": "parent_id",
1458
+ "type": "uuid",
1459
+ "primaryKey": false,
1460
+ "notNull": false
1461
+ },
1462
+ "owner": {
1463
+ "name": "owner",
1464
+ "type": "text",
1465
+ "primaryKey": false,
1466
+ "notNull": false
1467
+ },
1468
+ "protected": {
1469
+ "name": "protected",
1470
+ "type": "boolean",
1471
+ "primaryKey": false,
1472
+ "notNull": false
1473
+ },
1474
+ "seal": {
1475
+ "name": "seal",
1476
+ "type": "bytea",
1477
+ "primaryKey": false,
1478
+ "notNull": false
1479
+ }
1480
+ },
1481
+ "indexes": {
1482
+ "environments_parent_id_owner_key": {
1483
+ "name": "environments_parent_id_owner_key",
1484
+ "columns": [
1485
+ {
1486
+ "expression": "parent_id",
1487
+ "isExpression": false,
1488
+ "asc": true,
1489
+ "nulls": "last"
1490
+ },
1491
+ {
1492
+ "expression": "owner",
1493
+ "isExpression": false,
1494
+ "asc": true,
1495
+ "nulls": "last"
1496
+ }
1497
+ ],
1498
+ "isUnique": true,
1499
+ "where": "strpos(\"environments\".\"slug\", '~') = 0",
1500
+ "concurrently": false,
1501
+ "method": "btree",
1502
+ "with": {}
1503
+ },
1504
+ "environments_parent_idx": {
1505
+ "name": "environments_parent_idx",
1506
+ "columns": [
1507
+ {
1508
+ "expression": "parent_id",
1509
+ "isExpression": false,
1510
+ "asc": true,
1511
+ "nulls": "last"
1512
+ }
1513
+ ],
1514
+ "isUnique": false,
1515
+ "concurrently": false,
1516
+ "method": "btree",
1517
+ "with": {}
1518
+ }
1519
+ },
1520
+ "foreignKeys": {
1521
+ "environments_project_id_fkey": {
1522
+ "name": "environments_project_id_fkey",
1523
+ "tableFrom": "environments",
1524
+ "tableTo": "projects",
1525
+ "columnsFrom": [
1526
+ "project_id"
1527
+ ],
1528
+ "columnsTo": [
1529
+ "id"
1530
+ ],
1531
+ "onDelete": "restrict",
1532
+ "onUpdate": "no action"
1533
+ },
1534
+ "environments_parent_in_project": {
1535
+ "name": "environments_parent_in_project",
1536
+ "tableFrom": "environments",
1537
+ "tableTo": "environments",
1538
+ "columnsFrom": [
1539
+ "parent_id",
1540
+ "project_id"
1541
+ ],
1542
+ "columnsTo": [
1543
+ "id",
1544
+ "project_id"
1545
+ ],
1546
+ "onDelete": "no action",
1547
+ "onUpdate": "no action"
1548
+ }
1549
+ },
1550
+ "compositePrimaryKeys": {},
1551
+ "uniqueConstraints": {
1552
+ "environments_project_id_slug_key": {
1553
+ "name": "environments_project_id_slug_key",
1554
+ "nullsNotDistinct": false,
1555
+ "columns": [
1556
+ "project_id",
1557
+ "slug"
1558
+ ]
1559
+ },
1560
+ "environments_project_scoped": {
1561
+ "name": "environments_project_scoped",
1562
+ "nullsNotDistinct": false,
1563
+ "columns": [
1564
+ "id",
1565
+ "project_id"
1566
+ ]
1567
+ }
1568
+ },
1569
+ "policies": {},
1570
+ "checkConstraints": {
1571
+ "environments_seal_check": {
1572
+ "name": "environments_seal_check",
1573
+ "value": "\"environments\".\"seal\" IS NULL OR octet_length(\"environments\".\"seal\") = 16"
1574
+ },
1575
+ "environments_slug_check": {
1576
+ "name": "environments_slug_check",
1577
+ "value": "\"environments\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
1578
+ },
1579
+ "environments_parent_check": {
1580
+ "name": "environments_parent_check",
1581
+ "value": "\"environments\".\"parent_id\" IS NULL OR \"environments\".\"parent_id\" <> \"environments\".\"id\""
1582
+ },
1583
+ "environments_owner_check": {
1584
+ "name": "environments_owner_check",
1585
+ "value": "\"environments\".\"owner\" IS NULL OR (\"environments\".\"parent_id\" IS NOT NULL AND \"environments\".\"owner\" LIKE 'user:_%')"
1586
+ }
1587
+ },
1588
+ "isRLSEnabled": false
1589
+ },
1590
+ "public.identities": {
1591
+ "name": "identities",
1592
+ "schema": "",
1593
+ "columns": {
1594
+ "id": {
1595
+ "name": "id",
1596
+ "type": "uuid",
1597
+ "primaryKey": true,
1598
+ "notNull": true,
1599
+ "default": "gen_random_uuid()"
1600
+ },
1601
+ "provider": {
1602
+ "name": "provider",
1603
+ "type": "text",
1604
+ "primaryKey": false,
1605
+ "notNull": true
1606
+ },
1607
+ "auth_mac": {
1608
+ "name": "auth_mac",
1609
+ "type": "bytea",
1610
+ "primaryKey": false,
1611
+ "notNull": true
1612
+ },
1613
+ "subject": {
1614
+ "name": "subject",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "issuer_hash": {
1620
+ "name": "issuer_hash",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": true
1624
+ },
1625
+ "generation": {
1626
+ "name": "generation",
1627
+ "type": "integer",
1628
+ "primaryKey": false,
1629
+ "notNull": true
1630
+ },
1631
+ "principal": {
1632
+ "name": "principal",
1633
+ "type": "text",
1634
+ "primaryKey": false,
1635
+ "notNull": true
1636
+ },
1637
+ "email": {
1638
+ "name": "email",
1639
+ "type": "text",
1640
+ "primaryKey": false,
1641
+ "notNull": false
1642
+ },
1643
+ "created_at": {
1644
+ "name": "created_at",
1645
+ "type": "timestamp with time zone",
1646
+ "primaryKey": false,
1647
+ "notNull": true,
1648
+ "default": "now()"
1649
+ },
1650
+ "created_by": {
1651
+ "name": "created_by",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "last_sign_in_at": {
1657
+ "name": "last_sign_in_at",
1658
+ "type": "timestamp with time zone",
1659
+ "primaryKey": false,
1660
+ "notNull": false
1661
+ },
1662
+ "revoked_at": {
1663
+ "name": "revoked_at",
1664
+ "type": "timestamp with time zone",
1665
+ "primaryKey": false,
1666
+ "notNull": false
1667
+ },
1668
+ "revoked_by": {
1669
+ "name": "revoked_by",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": false
1673
+ },
1674
+ "active_subject": {
1675
+ "name": "active_subject",
1676
+ "type": "text",
1677
+ "primaryKey": false,
1678
+ "notNull": false,
1679
+ "generated": {
1680
+ "as": "CASE WHEN revoked_at IS NULL THEN subject END",
1681
+ "type": "stored"
1682
+ }
1683
+ }
1684
+ },
1685
+ "indexes": {
1686
+ "identities_active_subject": {
1687
+ "name": "identities_active_subject",
1688
+ "columns": [
1689
+ {
1690
+ "expression": "provider",
1691
+ "isExpression": false,
1692
+ "asc": true,
1693
+ "nulls": "last"
1694
+ },
1695
+ {
1696
+ "expression": "issuer_hash",
1697
+ "isExpression": false,
1698
+ "asc": true,
1699
+ "nulls": "last"
1700
+ },
1701
+ {
1702
+ "expression": "active_subject",
1703
+ "isExpression": false,
1704
+ "asc": true,
1705
+ "nulls": "last"
1706
+ }
1707
+ ],
1708
+ "isUnique": true,
1709
+ "concurrently": false,
1710
+ "method": "btree",
1711
+ "with": {}
1712
+ },
1713
+ "identities_principal_idx": {
1714
+ "name": "identities_principal_idx",
1715
+ "columns": [
1716
+ {
1717
+ "expression": "principal",
1718
+ "isExpression": false,
1719
+ "asc": true,
1720
+ "nulls": "last"
1721
+ },
1722
+ {
1723
+ "expression": "generation",
1724
+ "isExpression": false,
1725
+ "asc": true,
1726
+ "nulls": "last"
1727
+ }
1728
+ ],
1729
+ "isUnique": false,
1730
+ "concurrently": false,
1731
+ "method": "btree",
1732
+ "with": {}
1733
+ }
1734
+ },
1735
+ "foreignKeys": {
1736
+ "identities_principal_fkey": {
1737
+ "name": "identities_principal_fkey",
1738
+ "tableFrom": "identities",
1739
+ "tableTo": "vault_members",
1740
+ "columnsFrom": [
1741
+ "principal"
1742
+ ],
1743
+ "columnsTo": [
1744
+ "principal"
1745
+ ],
1746
+ "onDelete": "restrict",
1747
+ "onUpdate": "no action"
1748
+ }
1749
+ },
1750
+ "compositePrimaryKeys": {},
1751
+ "uniqueConstraints": {
1752
+ "identities_member_generation_key": {
1753
+ "name": "identities_member_generation_key",
1754
+ "nullsNotDistinct": false,
1755
+ "columns": [
1756
+ "id",
1757
+ "principal",
1758
+ "generation"
1759
+ ]
1760
+ }
1761
+ },
1762
+ "policies": {},
1763
+ "checkConstraints": {
1764
+ "identities_principal_check": {
1765
+ "name": "identities_principal_check",
1766
+ "value": "\"identities\".\"principal\" LIKE 'user:%'"
1767
+ },
1768
+ "identities_provider_check": {
1769
+ "name": "identities_provider_check",
1770
+ "value": "\"identities\".\"provider\" ~ '^[a-z0-9][a-z0-9-]{0,31}$'"
1771
+ },
1772
+ "identities_auth_mac_check": {
1773
+ "name": "identities_auth_mac_check",
1774
+ "value": "octet_length(\"identities\".\"auth_mac\") = 32"
1775
+ }
1776
+ },
1777
+ "isRLSEnabled": false
1778
+ },
1779
+ "public.log_bulk": {
1780
+ "name": "log_bulk",
1781
+ "schema": "",
1782
+ "columns": {
1783
+ "principal": {
1784
+ "name": "principal",
1785
+ "type": "text",
1786
+ "primaryKey": false,
1787
+ "notNull": true
1788
+ },
1789
+ "secret": {
1790
+ "name": "secret",
1791
+ "type": "uuid",
1792
+ "primaryKey": false,
1793
+ "notNull": true
1794
+ },
1795
+ "last": {
1796
+ "name": "last",
1797
+ "type": "bigint",
1798
+ "primaryKey": false,
1799
+ "notNull": true
1800
+ }
1801
+ },
1802
+ "indexes": {},
1803
+ "foreignKeys": {},
1804
+ "compositePrimaryKeys": {
1805
+ "log_bulk_pkey": {
1806
+ "name": "log_bulk_pkey",
1807
+ "columns": [
1808
+ "principal",
1809
+ "secret"
1810
+ ]
1811
+ }
1812
+ },
1813
+ "uniqueConstraints": {},
1814
+ "policies": {},
1815
+ "checkConstraints": {},
1816
+ "isRLSEnabled": false
1817
+ },
1818
+ "public.log_changes": {
1819
+ "name": "log_changes",
1820
+ "schema": "",
1821
+ "columns": {
1822
+ "number": {
1823
+ "name": "number",
1824
+ "type": "bigint",
1825
+ "primaryKey": true,
1826
+ "notNull": true
1827
+ },
1828
+ "at": {
1829
+ "name": "at",
1830
+ "type": "bigint",
1831
+ "primaryKey": false,
1832
+ "notNull": true
1833
+ },
1834
+ "request_id": {
1835
+ "name": "request_id",
1836
+ "type": "text",
1837
+ "primaryKey": false,
1838
+ "notNull": true
1839
+ },
1840
+ "object": {
1841
+ "name": "object",
1842
+ "type": "uuid",
1843
+ "primaryKey": false,
1844
+ "notNull": true
1845
+ },
1846
+ "actor": {
1847
+ "name": "actor",
1848
+ "type": "text",
1849
+ "primaryKey": false,
1850
+ "notNull": true
1851
+ },
1852
+ "payload": {
1853
+ "name": "payload",
1854
+ "type": "text",
1855
+ "primaryKey": false,
1856
+ "notNull": true
1857
+ },
1858
+ "seal": {
1859
+ "name": "seal",
1860
+ "type": "bytea",
1861
+ "primaryKey": false,
1862
+ "notNull": false
1863
+ },
1864
+ "mac": {
1865
+ "name": "mac",
1866
+ "type": "bytea",
1867
+ "primaryKey": false,
1868
+ "notNull": true
1869
+ }
1870
+ },
1871
+ "indexes": {
1872
+ "log_changes_object_idx": {
1873
+ "name": "log_changes_object_idx",
1874
+ "columns": [
1875
+ {
1876
+ "expression": "object",
1877
+ "isExpression": false,
1878
+ "asc": true,
1879
+ "nulls": "last"
1880
+ },
1881
+ {
1882
+ "expression": "number",
1883
+ "isExpression": false,
1884
+ "asc": true,
1885
+ "nulls": "last"
1886
+ }
1887
+ ],
1888
+ "isUnique": false,
1889
+ "concurrently": false,
1890
+ "method": "btree",
1891
+ "with": {}
1892
+ }
1893
+ },
1894
+ "foreignKeys": {},
1895
+ "compositePrimaryKeys": {},
1896
+ "uniqueConstraints": {
1897
+ "log_changes_request_id_key": {
1898
+ "name": "log_changes_request_id_key",
1899
+ "nullsNotDistinct": false,
1900
+ "columns": [
1901
+ "request_id"
1902
+ ]
1903
+ }
1904
+ },
1905
+ "policies": {},
1906
+ "checkConstraints": {
1907
+ "log_changes_seal_check": {
1908
+ "name": "log_changes_seal_check",
1909
+ "value": "\"log_changes\".\"seal\" IS NULL OR octet_length(\"log_changes\".\"seal\") = 16"
1910
+ },
1911
+ "log_changes_mac_check": {
1912
+ "name": "log_changes_mac_check",
1913
+ "value": "octet_length(\"log_changes\".\"mac\") = 16"
1914
+ }
1915
+ },
1916
+ "isRLSEnabled": false
1917
+ },
1918
+ "public.log_checkpoints": {
1919
+ "name": "log_checkpoints",
1920
+ "schema": "",
1921
+ "columns": {
1922
+ "upto": {
1923
+ "name": "upto",
1924
+ "type": "bigint",
1925
+ "primaryKey": true,
1926
+ "notNull": true
1927
+ },
1928
+ "at": {
1929
+ "name": "at",
1930
+ "type": "bigint",
1931
+ "primaryKey": false,
1932
+ "notNull": true
1933
+ },
1934
+ "at_floor": {
1935
+ "name": "at_floor",
1936
+ "type": "bigint",
1937
+ "primaryKey": false,
1938
+ "notNull": true
1939
+ },
1940
+ "changes_size": {
1941
+ "name": "changes_size",
1942
+ "type": "bigint",
1943
+ "primaryKey": false,
1944
+ "notNull": true
1945
+ },
1946
+ "changes_root": {
1947
+ "name": "changes_root",
1948
+ "type": "bytea",
1949
+ "primaryKey": false,
1950
+ "notNull": true
1951
+ },
1952
+ "changes_note": {
1953
+ "name": "changes_note",
1954
+ "type": "text",
1955
+ "primaryKey": false,
1956
+ "notNull": true
1957
+ },
1958
+ "uses_size": {
1959
+ "name": "uses_size",
1960
+ "type": "bigint",
1961
+ "primaryKey": false,
1962
+ "notNull": true
1963
+ },
1964
+ "uses_root": {
1965
+ "name": "uses_root",
1966
+ "type": "bytea",
1967
+ "primaryKey": false,
1968
+ "notNull": true
1969
+ },
1970
+ "uses_note": {
1971
+ "name": "uses_note",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true
1975
+ }
1976
+ },
1977
+ "indexes": {
1978
+ "log_checkpoints_floor_idx": {
1979
+ "name": "log_checkpoints_floor_idx",
1980
+ "columns": [
1981
+ {
1982
+ "expression": "at_floor",
1983
+ "isExpression": false,
1984
+ "asc": true,
1985
+ "nulls": "last"
1986
+ },
1987
+ {
1988
+ "expression": "upto",
1989
+ "isExpression": false,
1990
+ "asc": true,
1991
+ "nulls": "last"
1992
+ }
1993
+ ],
1994
+ "isUnique": false,
1995
+ "concurrently": false,
1996
+ "method": "btree",
1997
+ "with": {}
1998
+ }
1999
+ },
2000
+ "foreignKeys": {},
2001
+ "compositePrimaryKeys": {},
2002
+ "uniqueConstraints": {},
2003
+ "policies": {},
2004
+ "checkConstraints": {
2005
+ "log_checkpoints_changes_root_check": {
2006
+ "name": "log_checkpoints_changes_root_check",
2007
+ "value": "octet_length(\"log_checkpoints\".\"changes_root\") = 32"
2008
+ },
2009
+ "log_checkpoints_uses_root_check": {
2010
+ "name": "log_checkpoints_uses_root_check",
2011
+ "value": "octet_length(\"log_checkpoints\".\"uses_root\") = 32"
2012
+ }
2013
+ },
2014
+ "isRLSEnabled": false
2015
+ },
2016
+ "public.log_config": {
2017
+ "name": "log_config",
2018
+ "schema": "",
2019
+ "columns": {
2020
+ "name": {
2021
+ "name": "name",
2022
+ "type": "text",
2023
+ "primaryKey": true,
2024
+ "notNull": true
2025
+ },
2026
+ "value": {
2027
+ "name": "value",
2028
+ "type": "text",
2029
+ "primaryKey": false,
2030
+ "notNull": true
2031
+ },
2032
+ "seal": {
2033
+ "name": "seal",
2034
+ "type": "bytea",
2035
+ "primaryKey": false,
2036
+ "notNull": false
2037
+ }
2038
+ },
2039
+ "indexes": {},
2040
+ "foreignKeys": {},
2041
+ "compositePrimaryKeys": {},
2042
+ "uniqueConstraints": {},
2043
+ "policies": {},
2044
+ "checkConstraints": {
2045
+ "log_config_name_check": {
2046
+ "name": "log_config_name_check",
2047
+ "value": "\"log_config\".\"name\" IN ('policy', 'roles')"
2048
+ },
2049
+ "log_config_value_check": {
2050
+ "name": "log_config_value_check",
2051
+ "value": "\"log_config\".\"value\"::jsonb IS NOT NULL"
2052
+ },
2053
+ "log_config_seal_check": {
2054
+ "name": "log_config_seal_check",
2055
+ "value": "\"log_config\".\"seal\" IS NULL OR octet_length(\"log_config\".\"seal\") = 16"
2056
+ }
2057
+ },
2058
+ "isRLSEnabled": false
2059
+ },
2060
+ "public.log_fence": {
2061
+ "name": "log_fence",
2062
+ "schema": "",
2063
+ "columns": {
2064
+ "only_row": {
2065
+ "name": "only_row",
2066
+ "type": "boolean",
2067
+ "primaryKey": true,
2068
+ "notNull": true,
2069
+ "default": true
2070
+ },
2071
+ "at_floor": {
2072
+ "name": "at_floor",
2073
+ "type": "bigint",
2074
+ "primaryKey": false,
2075
+ "notNull": true
2076
+ }
2077
+ },
2078
+ "indexes": {},
2079
+ "foreignKeys": {},
2080
+ "compositePrimaryKeys": {},
2081
+ "uniqueConstraints": {},
2082
+ "policies": {},
2083
+ "checkConstraints": {
2084
+ "log_fence_only_row_check": {
2085
+ "name": "log_fence_only_row_check",
2086
+ "value": "\"log_fence\".\"only_row\""
2087
+ }
2088
+ },
2089
+ "isRLSEnabled": false
2090
+ },
2091
+ "public.log_tiles": {
2092
+ "name": "log_tiles",
2093
+ "schema": "",
2094
+ "columns": {
2095
+ "tree": {
2096
+ "name": "tree",
2097
+ "type": "text",
2098
+ "primaryKey": false,
2099
+ "notNull": true
2100
+ },
2101
+ "level": {
2102
+ "name": "level",
2103
+ "type": "smallint",
2104
+ "primaryKey": false,
2105
+ "notNull": true
2106
+ },
2107
+ "leaf": {
2108
+ "name": "leaf",
2109
+ "type": "bigint",
2110
+ "primaryKey": false,
2111
+ "notNull": true
2112
+ },
2113
+ "hashes": {
2114
+ "name": "hashes",
2115
+ "type": "bytea",
2116
+ "primaryKey": false,
2117
+ "notNull": true
2118
+ }
2119
+ },
2120
+ "indexes": {},
2121
+ "foreignKeys": {},
2122
+ "compositePrimaryKeys": {
2123
+ "log_tiles_pkey": {
2124
+ "name": "log_tiles_pkey",
2125
+ "columns": [
2126
+ "tree",
2127
+ "level",
2128
+ "leaf"
2129
+ ]
2130
+ }
2131
+ },
2132
+ "uniqueConstraints": {},
2133
+ "policies": {},
2134
+ "checkConstraints": {
2135
+ "log_tiles_tree_check": {
2136
+ "name": "log_tiles_tree_check",
2137
+ "value": "\"log_tiles\".\"tree\" IN ('changes', 'uses')"
2138
+ },
2139
+ "log_tiles_level_check": {
2140
+ "name": "log_tiles_level_check",
2141
+ "value": "\"log_tiles\".\"level\" BETWEEN 0 AND 7"
2142
+ },
2143
+ "log_tiles_leaf_check": {
2144
+ "name": "log_tiles_leaf_check",
2145
+ "value": "\"log_tiles\".\"leaf\" >= 0 AND \"log_tiles\".\"leaf\" % (256::numeric ^ (\"log_tiles\".\"level\" + 1)) = 0"
2146
+ },
2147
+ "log_tiles_hashes_check": {
2148
+ "name": "log_tiles_hashes_check",
2149
+ "value": "octet_length(\"log_tiles\".\"hashes\") BETWEEN 32 AND 8192 AND octet_length(\"log_tiles\".\"hashes\") % 32 = 0"
2150
+ }
2151
+ },
2152
+ "isRLSEnabled": false
2153
+ },
2154
+ "public.log_uses": {
2155
+ "name": "log_uses",
2156
+ "schema": "",
2157
+ "columns": {
2158
+ "number": {
2159
+ "name": "number",
2160
+ "type": "bigint",
2161
+ "primaryKey": false,
2162
+ "notNull": true
2163
+ },
2164
+ "at": {
2165
+ "name": "at",
2166
+ "type": "bigint",
2167
+ "primaryKey": false,
2168
+ "notNull": true
2169
+ },
2170
+ "request_id": {
2171
+ "name": "request_id",
2172
+ "type": "bigint",
2173
+ "primaryKey": false,
2174
+ "notNull": true
2175
+ },
2176
+ "credential": {
2177
+ "name": "credential",
2178
+ "type": "uuid",
2179
+ "primaryKey": false,
2180
+ "notNull": true
2181
+ },
2182
+ "secret": {
2183
+ "name": "secret",
2184
+ "type": "uuid",
2185
+ "primaryKey": false,
2186
+ "notNull": true
2187
+ },
2188
+ "purpose": {
2189
+ "name": "purpose",
2190
+ "type": "smallint",
2191
+ "primaryKey": false,
2192
+ "notNull": true
2193
+ },
2194
+ "mac": {
2195
+ "name": "mac",
2196
+ "type": "bytea",
2197
+ "primaryKey": false,
2198
+ "notNull": true
2199
+ },
2200
+ "place": {
2201
+ "name": "place",
2202
+ "type": "uuid",
2203
+ "primaryKey": false,
2204
+ "notNull": false
2205
+ }
2206
+ },
2207
+ "indexes": {
2208
+ "log_uses_request_idx": {
2209
+ "name": "log_uses_request_idx",
2210
+ "columns": [
2211
+ {
2212
+ "expression": "at",
2213
+ "isExpression": false,
2214
+ "asc": true,
2215
+ "nulls": "last"
2216
+ },
2217
+ {
2218
+ "expression": "request_id",
2219
+ "isExpression": false,
2220
+ "asc": true,
2221
+ "nulls": "last"
2222
+ }
2223
+ ],
2224
+ "isUnique": true,
2225
+ "concurrently": false,
2226
+ "method": "btree",
2227
+ "with": {}
2228
+ }
2229
+ },
2230
+ "foreignKeys": {},
2231
+ "compositePrimaryKeys": {},
2232
+ "uniqueConstraints": {},
2233
+ "policies": {},
2234
+ "checkConstraints": {
2235
+ "log_uses_mac_check": {
2236
+ "name": "log_uses_mac_check",
2237
+ "value": "octet_length(\"log_uses\".\"mac\") = 16"
2238
+ }
2239
+ },
2240
+ "isRLSEnabled": false
2241
+ },
2242
+ "public.mcp_approvals": {
2243
+ "name": "mcp_approvals",
2244
+ "schema": "",
2245
+ "columns": {
2246
+ "id": {
2247
+ "name": "id",
2248
+ "type": "uuid",
2249
+ "primaryKey": true,
2250
+ "notNull": true
2251
+ },
2252
+ "connection_id": {
2253
+ "name": "connection_id",
2254
+ "type": "uuid",
2255
+ "primaryKey": false,
2256
+ "notNull": true
2257
+ },
2258
+ "tool": {
2259
+ "name": "tool",
2260
+ "type": "text",
2261
+ "primaryKey": false,
2262
+ "notNull": true
2263
+ },
2264
+ "arguments": {
2265
+ "name": "arguments",
2266
+ "type": "text",
2267
+ "primaryKey": false,
2268
+ "notNull": true
2269
+ },
2270
+ "digest": {
2271
+ "name": "digest",
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": "'pending'"
2282
+ },
2283
+ "outcome": {
2284
+ "name": "outcome",
2285
+ "type": "text",
2286
+ "primaryKey": false,
2287
+ "notNull": false
2288
+ },
2289
+ "created_at": {
2290
+ "name": "created_at",
2291
+ "type": "timestamp with time zone",
2292
+ "primaryKey": false,
2293
+ "notNull": true,
2294
+ "default": "now()"
2295
+ },
2296
+ "expires_at": {
2297
+ "name": "expires_at",
2298
+ "type": "timestamp with time zone",
2299
+ "primaryKey": false,
2300
+ "notNull": true
2301
+ },
2302
+ "decided_at": {
2303
+ "name": "decided_at",
2304
+ "type": "timestamp with time zone",
2305
+ "primaryKey": false,
2306
+ "notNull": false
2307
+ },
2308
+ "reported_at": {
2309
+ "name": "reported_at",
2310
+ "type": "timestamp with time zone",
2311
+ "primaryKey": false,
2312
+ "notNull": false
2313
+ }
2314
+ },
2315
+ "indexes": {
2316
+ "mcp_approvals_open_idx": {
2317
+ "name": "mcp_approvals_open_idx",
2318
+ "columns": [
2319
+ {
2320
+ "expression": "connection_id",
2321
+ "isExpression": false,
2322
+ "asc": true,
2323
+ "nulls": "last"
2324
+ },
2325
+ {
2326
+ "expression": "digest",
2327
+ "isExpression": false,
2328
+ "asc": true,
2329
+ "nulls": "last"
2330
+ }
2331
+ ],
2332
+ "isUnique": false,
2333
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL",
2334
+ "concurrently": false,
2335
+ "method": "btree",
2336
+ "with": {}
2337
+ }
2338
+ },
2339
+ "foreignKeys": {
2340
+ "mcp_approvals_connection_fkey": {
2341
+ "name": "mcp_approvals_connection_fkey",
2342
+ "tableFrom": "mcp_approvals",
2343
+ "tableTo": "mcp_connections",
2344
+ "columnsFrom": [
2345
+ "connection_id"
2346
+ ],
2347
+ "columnsTo": [
2348
+ "id"
2349
+ ],
2350
+ "onDelete": "restrict",
2351
+ "onUpdate": "no action"
2352
+ }
2353
+ },
2354
+ "compositePrimaryKeys": {},
2355
+ "uniqueConstraints": {},
2356
+ "policies": {},
2357
+ "checkConstraints": {
2358
+ "mcp_approvals_status_check": {
2359
+ "name": "mcp_approvals_status_check",
2360
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
2361
+ },
2362
+ "mcp_approvals_digest_check": {
2363
+ "name": "mcp_approvals_digest_check",
2364
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
2365
+ },
2366
+ "mcp_approvals_arguments_check": {
2367
+ "name": "mcp_approvals_arguments_check",
2368
+ "value": "\"mcp_approvals\".\"arguments\"::jsonb IS NOT NULL"
2369
+ }
2370
+ },
2371
+ "isRLSEnabled": false
2372
+ },
2373
+ "public.mcp_connections": {
2374
+ "name": "mcp_connections",
2375
+ "schema": "",
2376
+ "columns": {
2377
+ "id": {
2378
+ "name": "id",
2379
+ "type": "uuid",
2380
+ "primaryKey": true,
2381
+ "notNull": true
2382
+ },
2383
+ "auth_mac": {
2384
+ "name": "auth_mac",
2385
+ "type": "bytea",
2386
+ "primaryKey": false,
2387
+ "notNull": true
2388
+ },
2389
+ "principal": {
2390
+ "name": "principal",
2391
+ "type": "text",
2392
+ "primaryKey": false,
2393
+ "notNull": true
2394
+ },
2395
+ "generation": {
2396
+ "name": "generation",
2397
+ "type": "integer",
2398
+ "primaryKey": false,
2399
+ "notNull": true
2400
+ },
2401
+ "client_id": {
2402
+ "name": "client_id",
2403
+ "type": "text",
2404
+ "primaryKey": false,
2405
+ "notNull": true
2406
+ },
2407
+ "client_name": {
2408
+ "name": "client_name",
2409
+ "type": "text",
2410
+ "primaryKey": false,
2411
+ "notNull": true
2412
+ },
2413
+ "client_host": {
2414
+ "name": "client_host",
2415
+ "type": "text",
2416
+ "primaryKey": false,
2417
+ "notNull": false
2418
+ },
2419
+ "registration": {
2420
+ "name": "registration",
2421
+ "type": "text",
2422
+ "primaryKey": false,
2423
+ "notNull": true
2424
+ },
2425
+ "scopes": {
2426
+ "name": "scopes",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "redirect_uri": {
2432
+ "name": "redirect_uri",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": true
2436
+ },
2437
+ "code_hash": {
2438
+ "name": "code_hash",
2439
+ "type": "bytea",
2440
+ "primaryKey": false,
2441
+ "notNull": false
2442
+ },
2443
+ "code_challenge": {
2444
+ "name": "code_challenge",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": false
2448
+ },
2449
+ "code_expires_at": {
2450
+ "name": "code_expires_at",
2451
+ "type": "timestamp with time zone",
2452
+ "primaryKey": false,
2453
+ "notNull": false
2454
+ },
2455
+ "refresh_hash": {
2456
+ "name": "refresh_hash",
2457
+ "type": "bytea",
2458
+ "primaryKey": false,
2459
+ "notNull": false
2460
+ },
2461
+ "refresh_previous_hash": {
2462
+ "name": "refresh_previous_hash",
2463
+ "type": "bytea",
2464
+ "primaryKey": false,
2465
+ "notNull": false
2466
+ },
2467
+ "expires_at": {
2468
+ "name": "expires_at",
2469
+ "type": "timestamp with time zone",
2470
+ "primaryKey": false,
2471
+ "notNull": true
2472
+ },
2473
+ "created_at": {
2474
+ "name": "created_at",
2475
+ "type": "timestamp with time zone",
2476
+ "primaryKey": false,
2477
+ "notNull": true,
2478
+ "default": "now()"
2479
+ },
2480
+ "last_used_at": {
2481
+ "name": "last_used_at",
2482
+ "type": "timestamp with time zone",
2483
+ "primaryKey": false,
2484
+ "notNull": false
2485
+ },
2486
+ "last_used_ip": {
2487
+ "name": "last_used_ip",
2488
+ "type": "text",
2489
+ "primaryKey": false,
2490
+ "notNull": false
2491
+ },
2492
+ "revoked_at": {
2493
+ "name": "revoked_at",
2494
+ "type": "timestamp with time zone",
2495
+ "primaryKey": false,
2496
+ "notNull": false
2497
+ },
2498
+ "revoked_by": {
2499
+ "name": "revoked_by",
2500
+ "type": "text",
2501
+ "primaryKey": false,
2502
+ "notNull": false
2503
+ }
2504
+ },
2505
+ "indexes": {
2506
+ "mcp_connections_refresh_previous_idx": {
2507
+ "name": "mcp_connections_refresh_previous_idx",
2508
+ "columns": [
2509
+ {
2510
+ "expression": "refresh_previous_hash",
2511
+ "isExpression": false,
2512
+ "asc": true,
2513
+ "nulls": "last"
2514
+ }
2515
+ ],
2516
+ "isUnique": false,
2517
+ "concurrently": false,
2518
+ "method": "btree",
2519
+ "with": {}
2520
+ },
2521
+ "mcp_connections_live_idx": {
2522
+ "name": "mcp_connections_live_idx",
2523
+ "columns": [
2524
+ {
2525
+ "expression": "principal",
2526
+ "isExpression": false,
2527
+ "asc": true,
2528
+ "nulls": "last"
2529
+ },
2530
+ {
2531
+ "expression": "expires_at",
2532
+ "isExpression": false,
2533
+ "asc": true,
2534
+ "nulls": "last"
2535
+ }
2536
+ ],
2537
+ "isUnique": false,
2538
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL",
2539
+ "concurrently": false,
2540
+ "method": "btree",
2541
+ "with": {}
2542
+ }
2543
+ },
2544
+ "foreignKeys": {
2545
+ "mcp_connections_principal_fkey": {
2546
+ "name": "mcp_connections_principal_fkey",
2547
+ "tableFrom": "mcp_connections",
2548
+ "tableTo": "vault_members",
2549
+ "columnsFrom": [
2550
+ "principal"
2551
+ ],
2552
+ "columnsTo": [
2553
+ "principal"
2554
+ ],
2555
+ "onDelete": "restrict",
2556
+ "onUpdate": "no action"
2557
+ }
2558
+ },
2559
+ "compositePrimaryKeys": {},
2560
+ "uniqueConstraints": {
2561
+ "mcp_connections_code_hash_key": {
2562
+ "name": "mcp_connections_code_hash_key",
2563
+ "nullsNotDistinct": false,
2564
+ "columns": [
2565
+ "code_hash"
2566
+ ]
2567
+ },
2568
+ "mcp_connections_refresh_hash_key": {
2569
+ "name": "mcp_connections_refresh_hash_key",
2570
+ "nullsNotDistinct": false,
2571
+ "columns": [
2572
+ "refresh_hash"
2573
+ ]
2574
+ }
2575
+ },
2576
+ "policies": {},
2577
+ "checkConstraints": {
2578
+ "mcp_connections_principal_check": {
2579
+ "name": "mcp_connections_principal_check",
2580
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
2581
+ },
2582
+ "mcp_connections_registration_check": {
2583
+ "name": "mcp_connections_registration_check",
2584
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
2585
+ },
2586
+ "mcp_connections_auth_mac_check": {
2587
+ "name": "mcp_connections_auth_mac_check",
2588
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
2589
+ },
2590
+ "mcp_connections_code_hash_check": {
2591
+ "name": "mcp_connections_code_hash_check",
2592
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
2593
+ },
2594
+ "mcp_connections_refresh_hash_check": {
2595
+ "name": "mcp_connections_refresh_hash_check",
2596
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
2597
+ }
2598
+ },
2599
+ "isRLSEnabled": false
2600
+ },
2601
+ "public.oauth_clients": {
2602
+ "name": "oauth_clients",
2603
+ "schema": "",
2604
+ "columns": {
2605
+ "id": {
2606
+ "name": "id",
2607
+ "type": "uuid",
2608
+ "primaryKey": true,
2609
+ "notNull": true
2610
+ },
2611
+ "auth_mac": {
2612
+ "name": "auth_mac",
2613
+ "type": "bytea",
2614
+ "primaryKey": false,
2615
+ "notNull": true
2616
+ },
2617
+ "name": {
2618
+ "name": "name",
2619
+ "type": "text",
2620
+ "primaryKey": false,
2621
+ "notNull": true
2622
+ },
2623
+ "redirect_uris": {
2624
+ "name": "redirect_uris",
2625
+ "type": "text",
2626
+ "primaryKey": false,
2627
+ "notNull": true
2628
+ },
2629
+ "created_at": {
2630
+ "name": "created_at",
2631
+ "type": "timestamp with time zone",
2632
+ "primaryKey": false,
2633
+ "notNull": true,
2634
+ "default": "now()"
2635
+ },
2636
+ "created_ip": {
2637
+ "name": "created_ip",
2638
+ "type": "text",
2639
+ "primaryKey": false,
2640
+ "notNull": false
2641
+ },
2642
+ "revoked_at": {
2643
+ "name": "revoked_at",
2644
+ "type": "timestamp with time zone",
2645
+ "primaryKey": false,
2646
+ "notNull": false
2647
+ }
2648
+ },
2649
+ "indexes": {},
2650
+ "foreignKeys": {},
2651
+ "compositePrimaryKeys": {},
2652
+ "uniqueConstraints": {},
2653
+ "policies": {},
2654
+ "checkConstraints": {
2655
+ "oauth_clients_auth_mac_check": {
2656
+ "name": "oauth_clients_auth_mac_check",
2657
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
2658
+ },
2659
+ "oauth_clients_redirect_uris_check": {
2660
+ "name": "oauth_clients_redirect_uris_check",
2661
+ "value": "\"oauth_clients\".\"redirect_uris\"::jsonb IS NOT NULL"
2662
+ }
2663
+ },
2664
+ "isRLSEnabled": false
2665
+ },
2666
+ "public.projects": {
2667
+ "name": "projects",
2668
+ "schema": "",
2669
+ "columns": {
2670
+ "id": {
2671
+ "name": "id",
2672
+ "type": "uuid",
2673
+ "primaryKey": true,
2674
+ "notNull": true,
2675
+ "default": "gen_random_uuid()"
2676
+ },
2677
+ "slug": {
2678
+ "name": "slug",
2679
+ "type": "text",
2680
+ "primaryKey": false,
2681
+ "notNull": true
2682
+ },
2683
+ "name": {
2684
+ "name": "name",
2685
+ "type": "text",
2686
+ "primaryKey": false,
2687
+ "notNull": true
2688
+ },
2689
+ "created_at": {
2690
+ "name": "created_at",
2691
+ "type": "timestamp with time zone",
2692
+ "primaryKey": false,
2693
+ "notNull": true,
2694
+ "default": "now()"
2695
+ },
2696
+ "archived_at": {
2697
+ "name": "archived_at",
2698
+ "type": "timestamp with time zone",
2699
+ "primaryKey": false,
2700
+ "notNull": false
2701
+ },
2702
+ "folder": {
2703
+ "name": "folder",
2704
+ "type": "text",
2705
+ "primaryKey": false,
2706
+ "notNull": false
2707
+ }
2708
+ },
2709
+ "indexes": {},
2710
+ "foreignKeys": {},
2711
+ "compositePrimaryKeys": {},
2712
+ "uniqueConstraints": {
2713
+ "projects_slug_key": {
2714
+ "name": "projects_slug_key",
2715
+ "nullsNotDistinct": false,
2716
+ "columns": [
2717
+ "slug"
2718
+ ]
2719
+ }
2720
+ },
2721
+ "policies": {},
2722
+ "checkConstraints": {
2723
+ "projects_slug_check": {
2724
+ "name": "projects_slug_check",
2725
+ "value": "\"projects\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
2726
+ },
2727
+ "projects_folder_check": {
2728
+ "name": "projects_folder_check",
2729
+ "value": "\"projects\".\"folder\" IS NULL OR (char_length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" !~ '[/[:cntrl:]]' AND \"projects\".\"folder\" = btrim(\"projects\".\"folder\"))"
2730
+ }
2731
+ },
2732
+ "isRLSEnabled": false
2733
+ },
2734
+ "public.secret_references": {
2735
+ "name": "secret_references",
2736
+ "schema": "",
2737
+ "columns": {
2738
+ "id": {
2739
+ "name": "id",
2740
+ "type": "uuid",
2741
+ "primaryKey": true,
2742
+ "notNull": true
2743
+ },
2744
+ "project_id": {
2745
+ "name": "project_id",
2746
+ "type": "uuid",
2747
+ "primaryKey": false,
2748
+ "notNull": true
2749
+ },
2750
+ "environment_id": {
2751
+ "name": "environment_id",
2752
+ "type": "uuid",
2753
+ "primaryKey": false,
2754
+ "notNull": true
2755
+ },
2756
+ "secret_id": {
2757
+ "name": "secret_id",
2758
+ "type": "uuid",
2759
+ "primaryKey": false,
2760
+ "notNull": true
2761
+ },
2762
+ "source_project_id": {
2763
+ "name": "source_project_id",
2764
+ "type": "uuid",
2765
+ "primaryKey": false,
2766
+ "notNull": true
2767
+ },
2768
+ "source_environment_id": {
2769
+ "name": "source_environment_id",
2770
+ "type": "uuid",
2771
+ "primaryKey": false,
2772
+ "notNull": true
2773
+ },
2774
+ "source_secret_id": {
2775
+ "name": "source_secret_id",
2776
+ "type": "uuid",
2777
+ "primaryKey": false,
2778
+ "notNull": true
2779
+ },
2780
+ "created_seq": {
2781
+ "name": "created_seq",
2782
+ "type": "bigint",
2783
+ "primaryKey": false,
2784
+ "notNull": true
2785
+ },
2786
+ "created_at": {
2787
+ "name": "created_at",
2788
+ "type": "timestamp with time zone",
2789
+ "primaryKey": false,
2790
+ "notNull": true,
2791
+ "default": "now()"
2792
+ },
2793
+ "created_by": {
2794
+ "name": "created_by",
2795
+ "type": "text",
2796
+ "primaryKey": false,
2797
+ "notNull": true
2798
+ },
2799
+ "ended_at": {
2800
+ "name": "ended_at",
2801
+ "type": "timestamp with time zone",
2802
+ "primaryKey": false,
2803
+ "notNull": false
2804
+ }
2805
+ },
2806
+ "indexes": {
2807
+ "secret_references_holder_idx": {
2808
+ "name": "secret_references_holder_idx",
2809
+ "columns": [
2810
+ {
2811
+ "expression": "secret_id",
2812
+ "isExpression": false,
2813
+ "asc": true,
2814
+ "nulls": "last"
2815
+ },
2816
+ {
2817
+ "expression": "created_seq",
2818
+ "isExpression": false,
2819
+ "asc": true,
2820
+ "nulls": "last"
2821
+ }
2822
+ ],
2823
+ "isUnique": false,
2824
+ "concurrently": false,
2825
+ "method": "btree",
2826
+ "with": {}
2827
+ },
2828
+ "secret_references_source_idx": {
2829
+ "name": "secret_references_source_idx",
2830
+ "columns": [
2831
+ {
2832
+ "expression": "source_secret_id",
2833
+ "isExpression": false,
2834
+ "asc": true,
2835
+ "nulls": "last"
2836
+ }
2837
+ ],
2838
+ "isUnique": false,
2839
+ "concurrently": false,
2840
+ "method": "btree",
2841
+ "with": {}
2842
+ },
2843
+ "secret_references_project_idx": {
2844
+ "name": "secret_references_project_idx",
2845
+ "columns": [
2846
+ {
2847
+ "expression": "project_id",
2848
+ "isExpression": false,
2849
+ "asc": true,
2850
+ "nulls": "last"
2851
+ }
2852
+ ],
2853
+ "isUnique": false,
2854
+ "concurrently": false,
2855
+ "method": "btree",
2856
+ "with": {}
2857
+ },
2858
+ "secret_references_source_project_idx": {
2859
+ "name": "secret_references_source_project_idx",
2860
+ "columns": [
2861
+ {
2862
+ "expression": "source_project_id",
2863
+ "isExpression": false,
2864
+ "asc": true,
2865
+ "nulls": "last"
2866
+ }
2867
+ ],
2868
+ "isUnique": false,
2869
+ "concurrently": false,
2870
+ "method": "btree",
2871
+ "with": {}
2872
+ },
2873
+ "secret_references_created_by_idx": {
2874
+ "name": "secret_references_created_by_idx",
2875
+ "columns": [
2876
+ {
2877
+ "expression": "created_by",
2878
+ "isExpression": false,
2879
+ "asc": true,
2880
+ "nulls": "last"
2881
+ }
2882
+ ],
2883
+ "isUnique": false,
2884
+ "concurrently": false,
2885
+ "method": "btree",
2886
+ "with": {}
2887
+ }
2888
+ },
2889
+ "foreignKeys": {
2890
+ "secret_references_secret_id_fkey": {
2891
+ "name": "secret_references_secret_id_fkey",
2892
+ "tableFrom": "secret_references",
2893
+ "tableTo": "secrets",
2894
+ "columnsFrom": [
2895
+ "secret_id"
2896
+ ],
2897
+ "columnsTo": [
2898
+ "id"
2899
+ ],
2900
+ "onDelete": "restrict",
2901
+ "onUpdate": "no action"
2902
+ },
2903
+ "secret_references_source_secret_id_fkey": {
2904
+ "name": "secret_references_source_secret_id_fkey",
2905
+ "tableFrom": "secret_references",
2906
+ "tableTo": "secrets",
2907
+ "columnsFrom": [
2908
+ "source_secret_id"
2909
+ ],
2910
+ "columnsTo": [
2911
+ "id"
2912
+ ],
2913
+ "onDelete": "restrict",
2914
+ "onUpdate": "no action"
2915
+ },
2916
+ "secret_references_created_seq_fkey": {
2917
+ "name": "secret_references_created_seq_fkey",
2918
+ "tableFrom": "secret_references",
2919
+ "tableTo": "audit_log",
2920
+ "columnsFrom": [
2921
+ "created_seq"
2922
+ ],
2923
+ "columnsTo": [
2924
+ "seq"
2925
+ ],
2926
+ "onDelete": "restrict",
2927
+ "onUpdate": "no action"
2928
+ }
2929
+ },
2930
+ "compositePrimaryKeys": {},
2931
+ "uniqueConstraints": {
2932
+ "secret_references_created_seq_key": {
2933
+ "name": "secret_references_created_seq_key",
2934
+ "nullsNotDistinct": false,
2935
+ "columns": [
2936
+ "created_seq"
2937
+ ]
2938
+ }
2939
+ },
2940
+ "policies": {},
2941
+ "checkConstraints": {},
2942
+ "isRLSEnabled": false
2943
+ },
2944
+ "public.secret_versions": {
2945
+ "name": "secret_versions",
2946
+ "schema": "",
2947
+ "columns": {
2948
+ "id": {
2949
+ "name": "id",
2950
+ "type": "uuid",
2951
+ "primaryKey": true,
2952
+ "notNull": true,
2953
+ "default": "gen_random_uuid()"
2954
+ },
2955
+ "secret_id": {
2956
+ "name": "secret_id",
2957
+ "type": "uuid",
2958
+ "primaryKey": false,
2959
+ "notNull": true
2960
+ },
2961
+ "version": {
2962
+ "name": "version",
2963
+ "type": "integer",
2964
+ "primaryKey": false,
2965
+ "notNull": true
2966
+ },
2967
+ "envelope_version": {
2968
+ "name": "envelope_version",
2969
+ "type": "integer",
2970
+ "primaryKey": false,
2971
+ "notNull": true
2972
+ },
2973
+ "ciphertext": {
2974
+ "name": "ciphertext",
2975
+ "type": "bytea",
2976
+ "primaryKey": false,
2977
+ "notNull": true
2978
+ },
2979
+ "iv": {
2980
+ "name": "iv",
2981
+ "type": "bytea",
2982
+ "primaryKey": false,
2983
+ "notNull": true
2984
+ },
2985
+ "auth_tag": {
2986
+ "name": "auth_tag",
2987
+ "type": "bytea",
2988
+ "primaryKey": false,
2989
+ "notNull": true
2990
+ },
2991
+ "wrapped_dek": {
2992
+ "name": "wrapped_dek",
2993
+ "type": "bytea",
2994
+ "primaryKey": false,
2995
+ "notNull": true
2996
+ },
2997
+ "kek_provider": {
2998
+ "name": "kek_provider",
2999
+ "type": "text",
3000
+ "primaryKey": false,
3001
+ "notNull": true
3002
+ },
3003
+ "kek_id": {
3004
+ "name": "kek_id",
3005
+ "type": "text",
3006
+ "primaryKey": false,
3007
+ "notNull": true
3008
+ },
3009
+ "kek_version": {
3010
+ "name": "kek_version",
3011
+ "type": "text",
3012
+ "primaryKey": false,
3013
+ "notNull": true
3014
+ },
3015
+ "created_at": {
3016
+ "name": "created_at",
3017
+ "type": "timestamp with time zone",
3018
+ "primaryKey": false,
3019
+ "notNull": true,
3020
+ "default": "now()"
3021
+ },
3022
+ "created_by": {
3023
+ "name": "created_by",
3024
+ "type": "text",
3025
+ "primaryKey": false,
3026
+ "notNull": true
3027
+ },
3028
+ "recipe": {
3029
+ "name": "recipe",
3030
+ "type": "text",
3031
+ "primaryKey": false,
3032
+ "notNull": false
3033
+ },
3034
+ "pair_id": {
3035
+ "name": "pair_id",
3036
+ "type": "uuid",
3037
+ "primaryKey": false,
3038
+ "notNull": false
3039
+ },
3040
+ "pair_half": {
3041
+ "name": "pair_half",
3042
+ "type": "text",
3043
+ "primaryKey": false,
3044
+ "notNull": false
3045
+ },
3046
+ "plaintext": {
3047
+ "name": "plaintext",
3048
+ "type": "text",
3049
+ "primaryKey": false,
3050
+ "notNull": false
3051
+ },
3052
+ "sensitive": {
3053
+ "name": "sensitive",
3054
+ "type": "boolean",
3055
+ "primaryKey": false,
3056
+ "notNull": true,
3057
+ "default": false
3058
+ }
3059
+ },
3060
+ "indexes": {
3061
+ "secret_versions_secret_idx": {
3062
+ "name": "secret_versions_secret_idx",
3063
+ "columns": [
3064
+ {
3065
+ "expression": "secret_id",
3066
+ "isExpression": false,
3067
+ "asc": true,
3068
+ "nulls": "last"
3069
+ },
3070
+ {
3071
+ "expression": "version",
3072
+ "isExpression": false,
3073
+ "asc": false,
3074
+ "nulls": "last"
3075
+ }
3076
+ ],
3077
+ "isUnique": false,
3078
+ "concurrently": false,
3079
+ "method": "btree",
3080
+ "with": {}
3081
+ }
3082
+ },
3083
+ "foreignKeys": {
3084
+ "secret_versions_secret_id_fkey": {
3085
+ "name": "secret_versions_secret_id_fkey",
3086
+ "tableFrom": "secret_versions",
3087
+ "tableTo": "secrets",
3088
+ "columnsFrom": [
3089
+ "secret_id"
3090
+ ],
3091
+ "columnsTo": [
3092
+ "id"
3093
+ ],
3094
+ "onDelete": "restrict",
3095
+ "onUpdate": "no action"
3096
+ }
3097
+ },
3098
+ "compositePrimaryKeys": {},
3099
+ "uniqueConstraints": {
3100
+ "secret_versions_secret_id_version_key": {
3101
+ "name": "secret_versions_secret_id_version_key",
3102
+ "nullsNotDistinct": false,
3103
+ "columns": [
3104
+ "secret_id",
3105
+ "version"
3106
+ ]
3107
+ }
3108
+ },
3109
+ "policies": {},
3110
+ "checkConstraints": {
3111
+ "secret_versions_version_check": {
3112
+ "name": "secret_versions_version_check",
3113
+ "value": "\"secret_versions\".\"version\" > 0"
3114
+ },
3115
+ "secret_versions_iv_check": {
3116
+ "name": "secret_versions_iv_check",
3117
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
3118
+ },
3119
+ "secret_versions_auth_tag_check": {
3120
+ "name": "secret_versions_auth_tag_check",
3121
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
3122
+ }
3123
+ },
3124
+ "isRLSEnabled": false
3125
+ },
3126
+ "public.secrets": {
3127
+ "name": "secrets",
3128
+ "schema": "",
3129
+ "columns": {
3130
+ "id": {
3131
+ "name": "id",
3132
+ "type": "uuid",
3133
+ "primaryKey": true,
3134
+ "notNull": true,
3135
+ "default": "gen_random_uuid()"
3136
+ },
3137
+ "project_id": {
3138
+ "name": "project_id",
3139
+ "type": "uuid",
3140
+ "primaryKey": false,
3141
+ "notNull": true
3142
+ },
3143
+ "environment_id": {
3144
+ "name": "environment_id",
3145
+ "type": "uuid",
3146
+ "primaryKey": false,
3147
+ "notNull": true
3148
+ },
3149
+ "key": {
3150
+ "name": "key",
3151
+ "type": "text",
3152
+ "primaryKey": false,
3153
+ "notNull": true
3154
+ },
3155
+ "created_at": {
3156
+ "name": "created_at",
3157
+ "type": "timestamp with time zone",
3158
+ "primaryKey": false,
3159
+ "notNull": true,
3160
+ "default": "now()"
3161
+ },
3162
+ "updated_at": {
3163
+ "name": "updated_at",
3164
+ "type": "timestamp with time zone",
3165
+ "primaryKey": false,
3166
+ "notNull": true,
3167
+ "default": "now()"
3168
+ },
3169
+ "current_version_id": {
3170
+ "name": "current_version_id",
3171
+ "type": "uuid",
3172
+ "primaryKey": false,
3173
+ "notNull": false
3174
+ },
3175
+ "current_version": {
3176
+ "name": "current_version",
3177
+ "type": "integer",
3178
+ "primaryKey": false,
3179
+ "notNull": true,
3180
+ "default": 0
3181
+ },
3182
+ "archived_at": {
3183
+ "name": "archived_at",
3184
+ "type": "timestamp with time zone",
3185
+ "primaryKey": false,
3186
+ "notNull": false
3187
+ },
3188
+ "folder": {
3189
+ "name": "folder",
3190
+ "type": "text",
3191
+ "primaryKey": false,
3192
+ "notNull": false
3193
+ },
3194
+ "seal": {
3195
+ "name": "seal",
3196
+ "type": "bytea",
3197
+ "primaryKey": false,
3198
+ "notNull": false
3199
+ }
3200
+ },
3201
+ "indexes": {
3202
+ "secrets_lookup_idx": {
3203
+ "name": "secrets_lookup_idx",
3204
+ "columns": [
3205
+ {
3206
+ "expression": "project_id",
3207
+ "isExpression": false,
3208
+ "asc": true,
3209
+ "nulls": "last"
3210
+ },
3211
+ {
3212
+ "expression": "environment_id",
3213
+ "isExpression": false,
3214
+ "asc": true,
3215
+ "nulls": "last"
3216
+ },
3217
+ {
3218
+ "expression": "key",
3219
+ "isExpression": false,
3220
+ "asc": true,
3221
+ "nulls": "last"
3222
+ }
3223
+ ],
3224
+ "isUnique": false,
3225
+ "concurrently": false,
3226
+ "method": "btree",
3227
+ "with": {}
3228
+ },
3229
+ "secrets_live_idx": {
3230
+ "name": "secrets_live_idx",
3231
+ "columns": [
3232
+ {
3233
+ "expression": "environment_id",
3234
+ "isExpression": false,
3235
+ "asc": true,
3236
+ "nulls": "last"
3237
+ }
3238
+ ],
3239
+ "isUnique": false,
3240
+ "where": "\"secrets\".\"archived_at\" IS NULL",
3241
+ "concurrently": false,
3242
+ "method": "btree",
3243
+ "with": {}
3244
+ }
3245
+ },
3246
+ "foreignKeys": {
3247
+ "secrets_current_version_id_secret_versions_id_fk": {
3248
+ "name": "secrets_current_version_id_secret_versions_id_fk",
3249
+ "tableFrom": "secrets",
3250
+ "tableTo": "secret_versions",
3251
+ "columnsFrom": [
3252
+ "current_version_id"
3253
+ ],
3254
+ "columnsTo": [
3255
+ "id"
3256
+ ],
3257
+ "onDelete": "no action",
3258
+ "onUpdate": "no action"
3259
+ },
3260
+ "secrets_project_id_fkey": {
3261
+ "name": "secrets_project_id_fkey",
3262
+ "tableFrom": "secrets",
3263
+ "tableTo": "projects",
3264
+ "columnsFrom": [
3265
+ "project_id"
3266
+ ],
3267
+ "columnsTo": [
3268
+ "id"
3269
+ ],
3270
+ "onDelete": "restrict",
3271
+ "onUpdate": "no action"
3272
+ },
3273
+ "secrets_environment_id_fkey": {
3274
+ "name": "secrets_environment_id_fkey",
3275
+ "tableFrom": "secrets",
3276
+ "tableTo": "environments",
3277
+ "columnsFrom": [
3278
+ "environment_id"
3279
+ ],
3280
+ "columnsTo": [
3281
+ "id"
3282
+ ],
3283
+ "onDelete": "restrict",
3284
+ "onUpdate": "no action"
3285
+ },
3286
+ "secrets_environment_in_project": {
3287
+ "name": "secrets_environment_in_project",
3288
+ "tableFrom": "secrets",
3289
+ "tableTo": "environments",
3290
+ "columnsFrom": [
3291
+ "environment_id",
3292
+ "project_id"
3293
+ ],
3294
+ "columnsTo": [
3295
+ "id",
3296
+ "project_id"
3297
+ ],
3298
+ "onDelete": "no action",
3299
+ "onUpdate": "no action"
3300
+ }
3301
+ },
3302
+ "compositePrimaryKeys": {},
3303
+ "uniqueConstraints": {
3304
+ "secrets_project_id_environment_id_key_key": {
3305
+ "name": "secrets_project_id_environment_id_key_key",
3306
+ "nullsNotDistinct": false,
3307
+ "columns": [
3308
+ "project_id",
3309
+ "environment_id",
3310
+ "key"
3311
+ ]
3312
+ }
3313
+ },
3314
+ "policies": {},
3315
+ "checkConstraints": {
3316
+ "secrets_seal_check": {
3317
+ "name": "secrets_seal_check",
3318
+ "value": "\"secrets\".\"seal\" IS NULL OR octet_length(\"secrets\".\"seal\") = 16"
3319
+ },
3320
+ "secrets_key_check": {
3321
+ "name": "secrets_key_check",
3322
+ "value": "\"secrets\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
3323
+ },
3324
+ "secrets_folder_check": {
3325
+ "name": "secrets_folder_check",
3326
+ "value": "\"secrets\".\"folder\" IS NULL OR (char_length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" !~ '[/[:cntrl:]]' AND \"secrets\".\"folder\" = btrim(\"secrets\".\"folder\"))"
3327
+ }
3328
+ },
3329
+ "isRLSEnabled": false
3330
+ },
3331
+ "public.service_bindings": {
3332
+ "name": "service_bindings",
3333
+ "schema": "",
3334
+ "columns": {
3335
+ "id": {
3336
+ "name": "id",
3337
+ "type": "uuid",
3338
+ "primaryKey": true,
3339
+ "notNull": true
3340
+ },
3341
+ "auth_mac": {
3342
+ "name": "auth_mac",
3343
+ "type": "bytea",
3344
+ "primaryKey": false,
3345
+ "notNull": true
3346
+ },
3347
+ "principal": {
3348
+ "name": "principal",
3349
+ "type": "text",
3350
+ "primaryKey": false,
3351
+ "notNull": true
3352
+ },
3353
+ "generation": {
3354
+ "name": "generation",
3355
+ "type": "integer",
3356
+ "primaryKey": false,
3357
+ "notNull": true
3358
+ },
3359
+ "profile": {
3360
+ "name": "profile",
3361
+ "type": "text",
3362
+ "primaryKey": false,
3363
+ "notNull": true
3364
+ },
3365
+ "issuer": {
3366
+ "name": "issuer",
3367
+ "type": "text",
3368
+ "primaryKey": false,
3369
+ "notNull": true
3370
+ },
3371
+ "jwks_uri": {
3372
+ "name": "jwks_uri",
3373
+ "type": "text",
3374
+ "primaryKey": false,
3375
+ "notNull": true
3376
+ },
3377
+ "jwks": {
3378
+ "name": "jwks",
3379
+ "type": "text",
3380
+ "primaryKey": false,
3381
+ "notNull": false
3382
+ },
3383
+ "claims": {
3384
+ "name": "claims",
3385
+ "type": "text",
3386
+ "primaryKey": false,
3387
+ "notNull": true
3388
+ },
3389
+ "scope": {
3390
+ "name": "scope",
3391
+ "type": "text",
3392
+ "primaryKey": false,
3393
+ "notNull": false
3394
+ },
3395
+ "policy": {
3396
+ "name": "policy",
3397
+ "type": "text",
3398
+ "primaryKey": false,
3399
+ "notNull": false
3400
+ },
3401
+ "label": {
3402
+ "name": "label",
3403
+ "type": "text",
3404
+ "primaryKey": false,
3405
+ "notNull": false
3406
+ },
3407
+ "created_at": {
3408
+ "name": "created_at",
3409
+ "type": "timestamp with time zone",
3410
+ "primaryKey": false,
3411
+ "notNull": true,
3412
+ "default": "now()"
3413
+ },
3414
+ "created_by": {
3415
+ "name": "created_by",
3416
+ "type": "text",
3417
+ "primaryKey": false,
3418
+ "notNull": true
3419
+ },
3420
+ "last_used_at": {
3421
+ "name": "last_used_at",
3422
+ "type": "timestamp with time zone",
3423
+ "primaryKey": false,
3424
+ "notNull": false
3425
+ },
3426
+ "revoked_at": {
3427
+ "name": "revoked_at",
3428
+ "type": "timestamp with time zone",
3429
+ "primaryKey": false,
3430
+ "notNull": false
3431
+ },
3432
+ "revoked_by": {
3433
+ "name": "revoked_by",
3434
+ "type": "text",
3435
+ "primaryKey": false,
3436
+ "notNull": false
3437
+ },
3438
+ "seal": {
3439
+ "name": "seal",
3440
+ "type": "bytea",
3441
+ "primaryKey": false,
3442
+ "notNull": false
3443
+ }
3444
+ },
3445
+ "indexes": {
3446
+ "service_bindings_principal_idx": {
3447
+ "name": "service_bindings_principal_idx",
3448
+ "columns": [
3449
+ {
3450
+ "expression": "principal",
3451
+ "isExpression": false,
3452
+ "asc": true,
3453
+ "nulls": "last"
3454
+ },
3455
+ {
3456
+ "expression": "issuer",
3457
+ "isExpression": false,
3458
+ "asc": true,
3459
+ "nulls": "last"
3460
+ }
3461
+ ],
3462
+ "isUnique": false,
3463
+ "concurrently": false,
3464
+ "method": "btree",
3465
+ "with": {}
3466
+ },
3467
+ "service_bindings_live_idx": {
3468
+ "name": "service_bindings_live_idx",
3469
+ "columns": [
3470
+ {
3471
+ "expression": "principal",
3472
+ "isExpression": false,
3473
+ "asc": true,
3474
+ "nulls": "last"
3475
+ },
3476
+ {
3477
+ "expression": "issuer",
3478
+ "isExpression": false,
3479
+ "asc": true,
3480
+ "nulls": "last"
3481
+ },
3482
+ {
3483
+ "expression": "generation",
3484
+ "isExpression": false,
3485
+ "asc": true,
3486
+ "nulls": "last"
3487
+ },
3488
+ {
3489
+ "expression": "created_at",
3490
+ "isExpression": false,
3491
+ "asc": true,
3492
+ "nulls": "last"
3493
+ },
3494
+ {
3495
+ "expression": "id",
3496
+ "isExpression": false,
3497
+ "asc": true,
3498
+ "nulls": "last"
3499
+ }
3500
+ ],
3501
+ "isUnique": false,
3502
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL",
3503
+ "concurrently": false,
3504
+ "method": "btree",
3505
+ "with": {}
3506
+ }
3507
+ },
3508
+ "foreignKeys": {
3509
+ "service_bindings_principal_fkey": {
3510
+ "name": "service_bindings_principal_fkey",
3511
+ "tableFrom": "service_bindings",
3512
+ "tableTo": "vault_members",
3513
+ "columnsFrom": [
3514
+ "principal"
3515
+ ],
3516
+ "columnsTo": [
3517
+ "principal"
3518
+ ],
3519
+ "onDelete": "restrict",
3520
+ "onUpdate": "no action"
3521
+ }
3522
+ },
3523
+ "compositePrimaryKeys": {},
3524
+ "uniqueConstraints": {},
3525
+ "policies": {},
3526
+ "checkConstraints": {
3527
+ "service_bindings_seal_check": {
3528
+ "name": "service_bindings_seal_check",
3529
+ "value": "\"service_bindings\".\"seal\" IS NULL OR octet_length(\"service_bindings\".\"seal\") = 16"
3530
+ },
3531
+ "service_bindings_principal_check": {
3532
+ "name": "service_bindings_principal_check",
3533
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
3534
+ },
3535
+ "service_bindings_auth_mac_check": {
3536
+ "name": "service_bindings_auth_mac_check",
3537
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
3538
+ },
3539
+ "service_bindings_claims_check": {
3540
+ "name": "service_bindings_claims_check",
3541
+ "value": "\"service_bindings\".\"claims\"::jsonb IS NOT NULL"
3542
+ }
3543
+ },
3544
+ "isRLSEnabled": false
3545
+ },
3546
+ "public.vault_grants": {
3547
+ "name": "vault_grants",
3548
+ "schema": "",
3549
+ "columns": {
3550
+ "principal": {
3551
+ "name": "principal",
3552
+ "type": "text",
3553
+ "primaryKey": false,
3554
+ "notNull": true
3555
+ },
3556
+ "project_id": {
3557
+ "name": "project_id",
3558
+ "type": "uuid",
3559
+ "primaryKey": false,
3560
+ "notNull": false
3561
+ },
3562
+ "environment_id": {
3563
+ "name": "environment_id",
3564
+ "type": "uuid",
3565
+ "primaryKey": false,
3566
+ "notNull": false
3567
+ },
3568
+ "environment_slug": {
3569
+ "name": "environment_slug",
3570
+ "type": "text",
3571
+ "primaryKey": false,
3572
+ "notNull": false
3573
+ },
3574
+ "role": {
3575
+ "name": "role",
3576
+ "type": "text",
3577
+ "primaryKey": false,
3578
+ "notNull": true
3579
+ },
3580
+ "expires_at": {
3581
+ "name": "expires_at",
3582
+ "type": "bigint",
3583
+ "primaryKey": false,
3584
+ "notNull": false
3585
+ },
3586
+ "granted_at": {
3587
+ "name": "granted_at",
3588
+ "type": "bigint",
3589
+ "primaryKey": false,
3590
+ "notNull": true
3591
+ },
3592
+ "granted_by": {
3593
+ "name": "granted_by",
3594
+ "type": "text",
3595
+ "primaryKey": false,
3596
+ "notNull": true
3597
+ }
3598
+ },
3599
+ "indexes": {
3600
+ "vault_grants_on_every_project": {
3601
+ "name": "vault_grants_on_every_project",
3602
+ "columns": [
3603
+ {
3604
+ "expression": "principal",
3605
+ "isExpression": false,
3606
+ "asc": true,
3607
+ "nulls": "last"
3608
+ }
3609
+ ],
3610
+ "isUnique": true,
3611
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL",
3612
+ "concurrently": false,
3613
+ "method": "btree",
3614
+ "with": {}
3615
+ }
3616
+ },
3617
+ "foreignKeys": {
3618
+ "vault_grants_principal_fkey": {
3619
+ "name": "vault_grants_principal_fkey",
3620
+ "tableFrom": "vault_grants",
3621
+ "tableTo": "vault_members",
3622
+ "columnsFrom": [
3623
+ "principal"
3624
+ ],
3625
+ "columnsTo": [
3626
+ "principal"
3627
+ ],
3628
+ "onDelete": "restrict",
3629
+ "onUpdate": "no action"
3630
+ },
3631
+ "vault_grants_project_id_fkey": {
3632
+ "name": "vault_grants_project_id_fkey",
3633
+ "tableFrom": "vault_grants",
3634
+ "tableTo": "projects",
3635
+ "columnsFrom": [
3636
+ "project_id"
3637
+ ],
3638
+ "columnsTo": [
3639
+ "id"
3640
+ ],
3641
+ "onDelete": "restrict",
3642
+ "onUpdate": "no action"
3643
+ },
3644
+ "vault_grants_environment_id_fkey": {
3645
+ "name": "vault_grants_environment_id_fkey",
3646
+ "tableFrom": "vault_grants",
3647
+ "tableTo": "environments",
3648
+ "columnsFrom": [
3649
+ "environment_id"
3650
+ ],
3651
+ "columnsTo": [
3652
+ "id"
3653
+ ],
3654
+ "onDelete": "restrict",
3655
+ "onUpdate": "no action"
3656
+ }
3657
+ },
3658
+ "compositePrimaryKeys": {},
3659
+ "uniqueConstraints": {
3660
+ "vault_grants_on_project": {
3661
+ "name": "vault_grants_on_project",
3662
+ "nullsNotDistinct": false,
3663
+ "columns": [
3664
+ "principal",
3665
+ "project_id"
3666
+ ]
3667
+ },
3668
+ "vault_grants_on_environment": {
3669
+ "name": "vault_grants_on_environment",
3670
+ "nullsNotDistinct": false,
3671
+ "columns": [
3672
+ "principal",
3673
+ "environment_id"
3674
+ ]
3675
+ },
3676
+ "vault_grants_on_environment_slug": {
3677
+ "name": "vault_grants_on_environment_slug",
3678
+ "nullsNotDistinct": false,
3679
+ "columns": [
3680
+ "principal",
3681
+ "environment_slug"
3682
+ ]
3683
+ }
3684
+ },
3685
+ "policies": {},
3686
+ "checkConstraints": {
3687
+ "vault_grants_one_place": {
3688
+ "name": "vault_grants_one_place",
3689
+ "value": "((\"vault_grants\".\"project_id\" IS NULL) <> (\"vault_grants\".\"environment_id\" IS NULL) AND \"vault_grants\".\"environment_slug\" IS NULL) OR (\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL)"
3690
+ },
3691
+ "vault_grants_environment_slug_check": {
3692
+ "name": "vault_grants_environment_slug_check",
3693
+ "value": "\"vault_grants\".\"environment_slug\" IS NULL OR \"vault_grants\".\"environment_slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
3694
+ },
3695
+ "vault_grants_role_check": {
3696
+ "name": "vault_grants_role_check",
3697
+ "value": "\"vault_grants\".\"role\" ~ '^[a-z][a-z0-9-]{1,31}$'"
3698
+ }
3699
+ },
3700
+ "isRLSEnabled": false
3701
+ },
3702
+ "public.vault_members": {
3703
+ "name": "vault_members",
3704
+ "schema": "",
3705
+ "columns": {
3706
+ "principal": {
3707
+ "name": "principal",
3708
+ "type": "text",
3709
+ "primaryKey": true,
3710
+ "notNull": true
3711
+ },
3712
+ "status": {
3713
+ "name": "status",
3714
+ "type": "text",
3715
+ "primaryKey": false,
3716
+ "notNull": true
3717
+ },
3718
+ "owner": {
3719
+ "name": "owner",
3720
+ "type": "boolean",
3721
+ "primaryKey": false,
3722
+ "notNull": true,
3723
+ "default": false
3724
+ },
3725
+ "role": {
3726
+ "name": "role",
3727
+ "type": "text",
3728
+ "primaryKey": false,
3729
+ "notNull": false
3730
+ },
3731
+ "scope": {
3732
+ "name": "scope",
3733
+ "type": "text",
3734
+ "primaryKey": false,
3735
+ "notNull": false
3736
+ },
3737
+ "generation": {
3738
+ "name": "generation",
3739
+ "type": "integer",
3740
+ "primaryKey": false,
3741
+ "notNull": true,
3742
+ "default": 0
3743
+ },
3744
+ "created_at": {
3745
+ "name": "created_at",
3746
+ "type": "bigint",
3747
+ "primaryKey": false,
3748
+ "notNull": true
3749
+ },
3750
+ "created_by": {
3751
+ "name": "created_by",
3752
+ "type": "text",
3753
+ "primaryKey": false,
3754
+ "notNull": true
3755
+ },
3756
+ "status_changed_at": {
3757
+ "name": "status_changed_at",
3758
+ "type": "bigint",
3759
+ "primaryKey": false,
3760
+ "notNull": true
3761
+ },
3762
+ "status_changed_by": {
3763
+ "name": "status_changed_by",
3764
+ "type": "text",
3765
+ "primaryKey": false,
3766
+ "notNull": true
3767
+ },
3768
+ "access_seq": {
3769
+ "name": "access_seq",
3770
+ "type": "bigint",
3771
+ "primaryKey": false,
3772
+ "notNull": true
3773
+ },
3774
+ "mac": {
3775
+ "name": "mac",
3776
+ "type": "bytea",
3777
+ "primaryKey": false,
3778
+ "notNull": true
3779
+ },
3780
+ "seal": {
3781
+ "name": "seal",
3782
+ "type": "bytea",
3783
+ "primaryKey": false,
3784
+ "notNull": false
3785
+ }
3786
+ },
3787
+ "indexes": {},
3788
+ "foreignKeys": {},
3789
+ "compositePrimaryKeys": {},
3790
+ "uniqueConstraints": {},
3791
+ "policies": {},
3792
+ "checkConstraints": {
3793
+ "vault_members_seal_check": {
3794
+ "name": "vault_members_seal_check",
3795
+ "value": "\"vault_members\".\"seal\" IS NULL OR octet_length(\"vault_members\".\"seal\") = 16"
3796
+ },
3797
+ "vault_members_mac_check": {
3798
+ "name": "vault_members_mac_check",
3799
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
3800
+ },
3801
+ "vault_members_principal_check": {
3802
+ "name": "vault_members_principal_check",
3803
+ "value": "\"vault_members\".\"principal\" ~ '^(user|token):[^[:space:]:][^[:space:]]*$'"
3804
+ },
3805
+ "vault_members_user_lowercase": {
3806
+ "name": "vault_members_user_lowercase",
3807
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
3808
+ },
3809
+ "vault_members_status_check": {
3810
+ "name": "vault_members_status_check",
3811
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
3812
+ },
3813
+ "vault_members_owner_check": {
3814
+ "name": "vault_members_owner_check",
3815
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
3816
+ },
3817
+ "vault_members_generation_check": {
3818
+ "name": "vault_members_generation_check",
3819
+ "value": "\"vault_members\".\"generation\" >= 0"
3820
+ }
3821
+ },
3822
+ "isRLSEnabled": false
3823
+ },
3824
+ "public.vault_releases": {
3825
+ "name": "vault_releases",
3826
+ "schema": "",
3827
+ "columns": {
3828
+ "principal": {
3829
+ "name": "principal",
3830
+ "type": "text",
3831
+ "primaryKey": false,
3832
+ "notNull": true
3833
+ },
3834
+ "key": {
3835
+ "name": "key",
3836
+ "type": "text",
3837
+ "primaryKey": false,
3838
+ "notNull": true
3839
+ },
3840
+ "released_at": {
3841
+ "name": "released_at",
3842
+ "type": "bigint",
3843
+ "primaryKey": false,
3844
+ "notNull": true
3845
+ }
3846
+ },
3847
+ "indexes": {},
3848
+ "foreignKeys": {},
3849
+ "compositePrimaryKeys": {
3850
+ "vault_releases_pkey": {
3851
+ "name": "vault_releases_pkey",
3852
+ "columns": [
3853
+ "principal",
3854
+ "key"
3855
+ ]
3856
+ }
3857
+ },
3858
+ "uniqueConstraints": {},
3859
+ "policies": {},
3860
+ "checkConstraints": {},
3861
+ "isRLSEnabled": false
3862
+ }
3863
+ },
3864
+ "enums": {},
3865
+ "schemas": {},
3866
+ "sequences": {},
3867
+ "roles": {},
3868
+ "policies": {},
3869
+ "views": {},
3870
+ "_meta": {
3871
+ "columns": {},
3872
+ "schemas": {},
3873
+ "tables": {}
3874
+ }
3875
+ }