@coffre/db 0.14.5 → 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 (214) 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 -622
  17. package/dist/log.js +178 -13
  18. package/dist/migrate.d.ts +43 -3
  19. package/dist/migrate.js +149 -29
  20. package/dist/migrations/postgres/0022_log_015.sql +672 -0
  21. package/dist/migrations/postgres/0023_change_path.sql +153 -0
  22. package/dist/migrations/postgres/0024_use_015.sql +556 -0
  23. package/dist/migrations/postgres/0025_app_change.sql +221 -0
  24. package/dist/migrations/postgres/0026_issue_lock.sql +106 -0
  25. package/dist/migrations/postgres/0027_retention.sql +118 -0
  26. package/dist/migrations/postgres/0028_use_stalls.sql +594 -0
  27. package/dist/migrations/postgres/0029_use_objects.sql +887 -0
  28. package/dist/migrations/postgres/0030_unarchive_restores.sql +259 -0
  29. package/dist/migrations/postgres/0031_app_read.sql +65 -0
  30. package/dist/migrations/postgres/0032_secrets_live_index.sql +4 -0
  31. package/dist/migrations/postgres/0033_use_generations.sql +582 -0
  32. package/dist/migrations/postgres/0034_vault_credentials.sql +153 -0
  33. package/dist/migrations/postgres/0035_first_days.sql +3 -0
  34. package/dist/migrations/postgres/0036_vault_issues.sql +91 -0
  35. package/dist/migrations/postgres/0037_vault_bindings.sql +271 -0
  36. package/dist/migrations/postgres/0040_binding_origin.sql +159 -0
  37. package/dist/migrations/postgres/0041_cutover.sql +132 -0
  38. package/dist/migrations/postgres/0042_sign_in_index.sql +7 -0
  39. package/dist/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  40. package/dist/migrations/postgres/0044_use_by_name.sql +705 -0
  41. package/dist/migrations/postgres/0045_decide_first.sql +878 -0
  42. package/dist/migrations/postgres/0046_way_in_uses.sql +1149 -0
  43. package/dist/migrations/postgres/0047_cutover_finish.sql +268 -0
  44. package/dist/migrations/postgres/0048_use_batch.sql +59 -0
  45. package/dist/migrations/postgres/0049_reads.sql +171 -0
  46. package/dist/migrations/postgres/meta/0022_snapshot.json +3831 -0
  47. package/dist/migrations/postgres/meta/0023_snapshot.json +3831 -0
  48. package/dist/migrations/postgres/meta/0024_snapshot.json +3831 -0
  49. package/dist/migrations/postgres/meta/0025_snapshot.json +3831 -0
  50. package/dist/migrations/postgres/meta/0026_snapshot.json +3831 -0
  51. package/dist/migrations/postgres/meta/0027_snapshot.json +3853 -0
  52. package/dist/migrations/postgres/meta/0028_snapshot.json +3853 -0
  53. package/dist/migrations/postgres/meta/0029_snapshot.json +3859 -0
  54. package/dist/migrations/postgres/meta/0030_snapshot.json +3859 -0
  55. package/dist/migrations/postgres/meta/0031_snapshot.json +3859 -0
  56. package/dist/migrations/postgres/meta/0032_snapshot.json +3875 -0
  57. package/dist/migrations/postgres/meta/0033_snapshot.json +3875 -0
  58. package/dist/migrations/postgres/meta/0034_snapshot.json +3875 -0
  59. package/dist/migrations/postgres/meta/0035_snapshot.json +3875 -0
  60. package/dist/migrations/postgres/meta/0036_snapshot.json +3875 -0
  61. package/dist/migrations/postgres/meta/0037_snapshot.json +3875 -0
  62. package/dist/migrations/postgres/meta/0038_snapshot.json +3881 -0
  63. package/dist/migrations/postgres/meta/0039_snapshot.json +3881 -0
  64. package/dist/migrations/postgres/meta/0040_snapshot.json +3931 -0
  65. package/dist/migrations/postgres/meta/0041_snapshot.json +3981 -0
  66. package/dist/migrations/postgres/meta/0042_snapshot.json +3981 -0
  67. package/dist/migrations/postgres/meta/0043_snapshot.json +3981 -0
  68. package/dist/migrations/postgres/meta/0044_snapshot.json +3991 -0
  69. package/dist/migrations/postgres/meta/0045_snapshot.json +3997 -0
  70. package/dist/migrations/postgres/meta/0046_snapshot.json +3997 -0
  71. package/dist/migrations/postgres/meta/0047_snapshot.json +4234 -0
  72. package/dist/migrations/postgres/meta/_journal.json +182 -0
  73. package/dist/migrations/sqlite/0018_log_015.sql +84 -0
  74. package/dist/migrations/sqlite/0019_retention.sql +2 -0
  75. package/dist/migrations/sqlite/0020_ended_references.sql +1 -0
  76. package/dist/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  77. package/dist/migrations/sqlite/0022_binding_origin.sql +1 -0
  78. package/dist/migrations/sqlite/0023_sign_in_index.sql +2 -0
  79. package/dist/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  80. package/dist/migrations/sqlite/0025_way_in_uses.sql +42 -0
  81. package/dist/migrations/sqlite/0026_cutover_finish.sql +11 -0
  82. package/dist/migrations/sqlite/0027_reads.sql +38 -0
  83. package/dist/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  84. package/dist/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  85. package/dist/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  86. package/dist/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  87. package/dist/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  88. package/dist/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  89. package/dist/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  90. package/dist/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  91. package/dist/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  92. package/dist/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  93. package/dist/migrations/sqlite/meta/_journal.json +70 -0
  94. package/dist/platform-Y3gICK6n.d.ts +58 -0
  95. package/dist/portable.d.ts +2 -2
  96. package/dist/postgres-BI3xTnyw.js +1718 -0
  97. package/dist/postgres-platform-node.d.ts +14 -0
  98. package/dist/postgres-platform-node.js +21 -0
  99. package/dist/postgres-platform-workerd.d.ts +61 -0
  100. package/dist/postgres-platform-workerd.js +163 -0
  101. package/dist/{schema-BfQEBqFv.d.ts → schema-DgoPqqsI.d.ts} +1326 -7
  102. package/dist/schema-sqlite.d.ts +1306 -6
  103. package/dist/schema-sqlite.js +154 -18
  104. package/dist/schema-version.d.ts +1 -1
  105. package/dist/schema-version.js +254 -2
  106. package/dist/schema.d.ts +2 -2
  107. package/dist/schema.js +226 -20
  108. package/package.json +13 -5
  109. package/src/active-subject.ts +9 -0
  110. package/src/change-records.ts +38 -0
  111. package/src/connect.ts +67 -13
  112. package/src/database.ts +67 -51
  113. package/src/dialect.ts +17 -8
  114. package/src/grants.ts +3 -3
  115. package/src/hyperdrive.ts +181 -104
  116. package/src/log.ts +196 -15
  117. package/src/migrate.ts +157 -30
  118. package/src/migrations/postgres/0022_log_015.sql +672 -0
  119. package/src/migrations/postgres/0023_change_path.sql +153 -0
  120. package/src/migrations/postgres/0024_use_015.sql +556 -0
  121. package/src/migrations/postgres/0025_app_change.sql +221 -0
  122. package/src/migrations/postgres/0026_issue_lock.sql +106 -0
  123. package/src/migrations/postgres/0027_retention.sql +118 -0
  124. package/src/migrations/postgres/0028_use_stalls.sql +594 -0
  125. package/src/migrations/postgres/0029_use_objects.sql +887 -0
  126. package/src/migrations/postgres/0030_unarchive_restores.sql +259 -0
  127. package/src/migrations/postgres/0031_app_read.sql +65 -0
  128. package/src/migrations/postgres/0032_secrets_live_index.sql +4 -0
  129. package/src/migrations/postgres/0033_use_generations.sql +582 -0
  130. package/src/migrations/postgres/0034_vault_credentials.sql +153 -0
  131. package/src/migrations/postgres/0035_first_days.sql +3 -0
  132. package/src/migrations/postgres/0036_vault_issues.sql +91 -0
  133. package/src/migrations/postgres/0037_vault_bindings.sql +271 -0
  134. package/src/migrations/postgres/0040_binding_origin.sql +159 -0
  135. package/src/migrations/postgres/0041_cutover.sql +132 -0
  136. package/src/migrations/postgres/0042_sign_in_index.sql +7 -0
  137. package/src/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  138. package/src/migrations/postgres/0044_use_by_name.sql +705 -0
  139. package/src/migrations/postgres/0045_decide_first.sql +878 -0
  140. package/src/migrations/postgres/0046_way_in_uses.sql +1149 -0
  141. package/src/migrations/postgres/0047_cutover_finish.sql +268 -0
  142. package/src/migrations/postgres/0048_use_batch.sql +59 -0
  143. package/src/migrations/postgres/0049_reads.sql +171 -0
  144. package/src/migrations/postgres/meta/0022_snapshot.json +3831 -0
  145. package/src/migrations/postgres/meta/0023_snapshot.json +3831 -0
  146. package/src/migrations/postgres/meta/0024_snapshot.json +3831 -0
  147. package/src/migrations/postgres/meta/0025_snapshot.json +3831 -0
  148. package/src/migrations/postgres/meta/0026_snapshot.json +3831 -0
  149. package/src/migrations/postgres/meta/0027_snapshot.json +3853 -0
  150. package/src/migrations/postgres/meta/0028_snapshot.json +3853 -0
  151. package/src/migrations/postgres/meta/0029_snapshot.json +3859 -0
  152. package/src/migrations/postgres/meta/0030_snapshot.json +3859 -0
  153. package/src/migrations/postgres/meta/0031_snapshot.json +3859 -0
  154. package/src/migrations/postgres/meta/0032_snapshot.json +3875 -0
  155. package/src/migrations/postgres/meta/0033_snapshot.json +3875 -0
  156. package/src/migrations/postgres/meta/0034_snapshot.json +3875 -0
  157. package/src/migrations/postgres/meta/0035_snapshot.json +3875 -0
  158. package/src/migrations/postgres/meta/0036_snapshot.json +3875 -0
  159. package/src/migrations/postgres/meta/0037_snapshot.json +3875 -0
  160. package/src/migrations/postgres/meta/0038_snapshot.json +3881 -0
  161. package/src/migrations/postgres/meta/0039_snapshot.json +3881 -0
  162. package/src/migrations/postgres/meta/0040_snapshot.json +3931 -0
  163. package/src/migrations/postgres/meta/0041_snapshot.json +3981 -0
  164. package/src/migrations/postgres/meta/0042_snapshot.json +3981 -0
  165. package/src/migrations/postgres/meta/0043_snapshot.json +3981 -0
  166. package/src/migrations/postgres/meta/0044_snapshot.json +3991 -0
  167. package/src/migrations/postgres/meta/0045_snapshot.json +3997 -0
  168. package/src/migrations/postgres/meta/0046_snapshot.json +3997 -0
  169. package/src/migrations/postgres/meta/0047_snapshot.json +4234 -0
  170. package/src/migrations/postgres/meta/_journal.json +182 -0
  171. package/src/migrations/sqlite/0018_log_015.sql +84 -0
  172. package/src/migrations/sqlite/0019_retention.sql +2 -0
  173. package/src/migrations/sqlite/0020_ended_references.sql +1 -0
  174. package/src/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  175. package/src/migrations/sqlite/0022_binding_origin.sql +1 -0
  176. package/src/migrations/sqlite/0023_sign_in_index.sql +2 -0
  177. package/src/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  178. package/src/migrations/sqlite/0025_way_in_uses.sql +42 -0
  179. package/src/migrations/sqlite/0026_cutover_finish.sql +11 -0
  180. package/src/migrations/sqlite/0027_reads.sql +38 -0
  181. package/src/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  182. package/src/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  183. package/src/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  184. package/src/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  185. package/src/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  186. package/src/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  187. package/src/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  188. package/src/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  189. package/src/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  190. package/src/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  191. package/src/migrations/sqlite/meta/_journal.json +70 -0
  192. package/src/postgres-js/README.md +183 -0
  193. package/src/postgres-js/UNLICENSE +24 -0
  194. package/src/postgres-js/bytes.ts +89 -0
  195. package/src/postgres-js/connection.ts +882 -0
  196. package/src/postgres-js/errors.ts +84 -0
  197. package/src/postgres-js/index.ts +516 -0
  198. package/src/postgres-js/platform.node.ts +29 -0
  199. package/src/postgres-js/platform.ts +60 -0
  200. package/src/postgres-js/platform.workerd.ts +225 -0
  201. package/src/postgres-js/query.ts +123 -0
  202. package/src/postgres-js/queue.ts +42 -0
  203. package/src/postgres-js/result.ts +46 -0
  204. package/src/postgres-js/types.ts +52 -0
  205. package/src/postgres.ts +375 -26
  206. package/src/schema-version.ts +2 -2
  207. package/src/schema.sqlite.ts +198 -7
  208. package/src/schema.ts +291 -6
  209. package/src/verify-runtime.ts +18 -29
  210. package/LICENSE +0 -21
  211. package/dist/database-wq1AVRAP.d.ts +0 -73
  212. package/dist/postgres-Bmar8y0q.js +0 -29
  213. package/dist/relations-BfR3JjT1.js +0 -38
  214. package/src/relations.ts +0 -40
@@ -0,0 +1,3931 @@
1
+ {
2
+ "id": "86c140a0-bcec-4924-b487-d0d235fc0291",
3
+ "prevId": "86b04a41-4cae-4584-b153-c3611075d6ff",
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
+ "log_changes_sign_in_idx": {
1894
+ "name": "log_changes_sign_in_idx",
1895
+ "columns": [
1896
+ {
1897
+ "expression": "at",
1898
+ "isExpression": false,
1899
+ "asc": true,
1900
+ "nulls": "last"
1901
+ },
1902
+ {
1903
+ "expression": "number",
1904
+ "isExpression": false,
1905
+ "asc": true,
1906
+ "nulls": "last"
1907
+ }
1908
+ ],
1909
+ "isUnique": false,
1910
+ "where": "strpos(\"log_changes\".\"payload\", '\"signIn\":{') > 0",
1911
+ "concurrently": false,
1912
+ "method": "btree",
1913
+ "with": {}
1914
+ },
1915
+ "log_changes_sign_in_actor_idx": {
1916
+ "name": "log_changes_sign_in_actor_idx",
1917
+ "columns": [
1918
+ {
1919
+ "expression": "actor",
1920
+ "isExpression": false,
1921
+ "asc": true,
1922
+ "nulls": "last"
1923
+ },
1924
+ {
1925
+ "expression": "at",
1926
+ "isExpression": false,
1927
+ "asc": true,
1928
+ "nulls": "last"
1929
+ },
1930
+ {
1931
+ "expression": "number",
1932
+ "isExpression": false,
1933
+ "asc": true,
1934
+ "nulls": "last"
1935
+ }
1936
+ ],
1937
+ "isUnique": false,
1938
+ "where": "strpos(\"log_changes\".\"payload\", '\"signIn\":{') > 0",
1939
+ "concurrently": false,
1940
+ "method": "btree",
1941
+ "with": {}
1942
+ }
1943
+ },
1944
+ "foreignKeys": {},
1945
+ "compositePrimaryKeys": {},
1946
+ "uniqueConstraints": {
1947
+ "log_changes_request_id_key": {
1948
+ "name": "log_changes_request_id_key",
1949
+ "nullsNotDistinct": false,
1950
+ "columns": [
1951
+ "request_id"
1952
+ ]
1953
+ }
1954
+ },
1955
+ "policies": {},
1956
+ "checkConstraints": {
1957
+ "log_changes_seal_check": {
1958
+ "name": "log_changes_seal_check",
1959
+ "value": "\"log_changes\".\"seal\" IS NULL OR octet_length(\"log_changes\".\"seal\") = 16"
1960
+ },
1961
+ "log_changes_mac_check": {
1962
+ "name": "log_changes_mac_check",
1963
+ "value": "octet_length(\"log_changes\".\"mac\") = 16"
1964
+ }
1965
+ },
1966
+ "isRLSEnabled": false
1967
+ },
1968
+ "public.log_checkpoints": {
1969
+ "name": "log_checkpoints",
1970
+ "schema": "",
1971
+ "columns": {
1972
+ "upto": {
1973
+ "name": "upto",
1974
+ "type": "bigint",
1975
+ "primaryKey": true,
1976
+ "notNull": true
1977
+ },
1978
+ "at": {
1979
+ "name": "at",
1980
+ "type": "bigint",
1981
+ "primaryKey": false,
1982
+ "notNull": true
1983
+ },
1984
+ "at_floor": {
1985
+ "name": "at_floor",
1986
+ "type": "bigint",
1987
+ "primaryKey": false,
1988
+ "notNull": true
1989
+ },
1990
+ "changes_size": {
1991
+ "name": "changes_size",
1992
+ "type": "bigint",
1993
+ "primaryKey": false,
1994
+ "notNull": true
1995
+ },
1996
+ "changes_root": {
1997
+ "name": "changes_root",
1998
+ "type": "bytea",
1999
+ "primaryKey": false,
2000
+ "notNull": true
2001
+ },
2002
+ "changes_note": {
2003
+ "name": "changes_note",
2004
+ "type": "text",
2005
+ "primaryKey": false,
2006
+ "notNull": true
2007
+ },
2008
+ "uses_size": {
2009
+ "name": "uses_size",
2010
+ "type": "bigint",
2011
+ "primaryKey": false,
2012
+ "notNull": true
2013
+ },
2014
+ "uses_root": {
2015
+ "name": "uses_root",
2016
+ "type": "bytea",
2017
+ "primaryKey": false,
2018
+ "notNull": true
2019
+ },
2020
+ "uses_note": {
2021
+ "name": "uses_note",
2022
+ "type": "text",
2023
+ "primaryKey": false,
2024
+ "notNull": true
2025
+ }
2026
+ },
2027
+ "indexes": {
2028
+ "log_checkpoints_floor_idx": {
2029
+ "name": "log_checkpoints_floor_idx",
2030
+ "columns": [
2031
+ {
2032
+ "expression": "at_floor",
2033
+ "isExpression": false,
2034
+ "asc": true,
2035
+ "nulls": "last"
2036
+ },
2037
+ {
2038
+ "expression": "upto",
2039
+ "isExpression": false,
2040
+ "asc": true,
2041
+ "nulls": "last"
2042
+ }
2043
+ ],
2044
+ "isUnique": false,
2045
+ "concurrently": false,
2046
+ "method": "btree",
2047
+ "with": {}
2048
+ }
2049
+ },
2050
+ "foreignKeys": {},
2051
+ "compositePrimaryKeys": {},
2052
+ "uniqueConstraints": {},
2053
+ "policies": {},
2054
+ "checkConstraints": {
2055
+ "log_checkpoints_changes_root_check": {
2056
+ "name": "log_checkpoints_changes_root_check",
2057
+ "value": "octet_length(\"log_checkpoints\".\"changes_root\") = 32"
2058
+ },
2059
+ "log_checkpoints_uses_root_check": {
2060
+ "name": "log_checkpoints_uses_root_check",
2061
+ "value": "octet_length(\"log_checkpoints\".\"uses_root\") = 32"
2062
+ }
2063
+ },
2064
+ "isRLSEnabled": false
2065
+ },
2066
+ "public.log_config": {
2067
+ "name": "log_config",
2068
+ "schema": "",
2069
+ "columns": {
2070
+ "name": {
2071
+ "name": "name",
2072
+ "type": "text",
2073
+ "primaryKey": true,
2074
+ "notNull": true
2075
+ },
2076
+ "value": {
2077
+ "name": "value",
2078
+ "type": "text",
2079
+ "primaryKey": false,
2080
+ "notNull": true
2081
+ },
2082
+ "seal": {
2083
+ "name": "seal",
2084
+ "type": "bytea",
2085
+ "primaryKey": false,
2086
+ "notNull": false
2087
+ }
2088
+ },
2089
+ "indexes": {},
2090
+ "foreignKeys": {},
2091
+ "compositePrimaryKeys": {},
2092
+ "uniqueConstraints": {},
2093
+ "policies": {},
2094
+ "checkConstraints": {
2095
+ "log_config_name_check": {
2096
+ "name": "log_config_name_check",
2097
+ "value": "\"log_config\".\"name\" IN ('policy', 'roles')"
2098
+ },
2099
+ "log_config_value_check": {
2100
+ "name": "log_config_value_check",
2101
+ "value": "\"log_config\".\"value\"::jsonb IS NOT NULL"
2102
+ },
2103
+ "log_config_seal_check": {
2104
+ "name": "log_config_seal_check",
2105
+ "value": "\"log_config\".\"seal\" IS NULL OR octet_length(\"log_config\".\"seal\") = 16"
2106
+ }
2107
+ },
2108
+ "isRLSEnabled": false
2109
+ },
2110
+ "public.log_fence": {
2111
+ "name": "log_fence",
2112
+ "schema": "",
2113
+ "columns": {
2114
+ "only_row": {
2115
+ "name": "only_row",
2116
+ "type": "boolean",
2117
+ "primaryKey": true,
2118
+ "notNull": true,
2119
+ "default": true
2120
+ },
2121
+ "at_floor": {
2122
+ "name": "at_floor",
2123
+ "type": "bigint",
2124
+ "primaryKey": false,
2125
+ "notNull": true
2126
+ }
2127
+ },
2128
+ "indexes": {},
2129
+ "foreignKeys": {},
2130
+ "compositePrimaryKeys": {},
2131
+ "uniqueConstraints": {},
2132
+ "policies": {},
2133
+ "checkConstraints": {
2134
+ "log_fence_only_row_check": {
2135
+ "name": "log_fence_only_row_check",
2136
+ "value": "\"log_fence\".\"only_row\""
2137
+ }
2138
+ },
2139
+ "isRLSEnabled": false
2140
+ },
2141
+ "public.log_tiles": {
2142
+ "name": "log_tiles",
2143
+ "schema": "",
2144
+ "columns": {
2145
+ "tree": {
2146
+ "name": "tree",
2147
+ "type": "text",
2148
+ "primaryKey": false,
2149
+ "notNull": true
2150
+ },
2151
+ "level": {
2152
+ "name": "level",
2153
+ "type": "smallint",
2154
+ "primaryKey": false,
2155
+ "notNull": true
2156
+ },
2157
+ "leaf": {
2158
+ "name": "leaf",
2159
+ "type": "bigint",
2160
+ "primaryKey": false,
2161
+ "notNull": true
2162
+ },
2163
+ "hashes": {
2164
+ "name": "hashes",
2165
+ "type": "bytea",
2166
+ "primaryKey": false,
2167
+ "notNull": true
2168
+ }
2169
+ },
2170
+ "indexes": {},
2171
+ "foreignKeys": {},
2172
+ "compositePrimaryKeys": {
2173
+ "log_tiles_pkey": {
2174
+ "name": "log_tiles_pkey",
2175
+ "columns": [
2176
+ "tree",
2177
+ "level",
2178
+ "leaf"
2179
+ ]
2180
+ }
2181
+ },
2182
+ "uniqueConstraints": {},
2183
+ "policies": {},
2184
+ "checkConstraints": {
2185
+ "log_tiles_tree_check": {
2186
+ "name": "log_tiles_tree_check",
2187
+ "value": "\"log_tiles\".\"tree\" IN ('changes', 'uses')"
2188
+ },
2189
+ "log_tiles_level_check": {
2190
+ "name": "log_tiles_level_check",
2191
+ "value": "\"log_tiles\".\"level\" BETWEEN 0 AND 7"
2192
+ },
2193
+ "log_tiles_leaf_check": {
2194
+ "name": "log_tiles_leaf_check",
2195
+ "value": "\"log_tiles\".\"leaf\" >= 0 AND \"log_tiles\".\"leaf\" % (256::numeric ^ (\"log_tiles\".\"level\" + 1)) = 0"
2196
+ },
2197
+ "log_tiles_hashes_check": {
2198
+ "name": "log_tiles_hashes_check",
2199
+ "value": "octet_length(\"log_tiles\".\"hashes\") BETWEEN 32 AND 8192 AND octet_length(\"log_tiles\".\"hashes\") % 32 = 0"
2200
+ }
2201
+ },
2202
+ "isRLSEnabled": false
2203
+ },
2204
+ "public.log_uses": {
2205
+ "name": "log_uses",
2206
+ "schema": "",
2207
+ "columns": {
2208
+ "number": {
2209
+ "name": "number",
2210
+ "type": "bigint",
2211
+ "primaryKey": false,
2212
+ "notNull": true
2213
+ },
2214
+ "at": {
2215
+ "name": "at",
2216
+ "type": "bigint",
2217
+ "primaryKey": false,
2218
+ "notNull": true
2219
+ },
2220
+ "request_id": {
2221
+ "name": "request_id",
2222
+ "type": "bigint",
2223
+ "primaryKey": false,
2224
+ "notNull": true
2225
+ },
2226
+ "credential": {
2227
+ "name": "credential",
2228
+ "type": "uuid",
2229
+ "primaryKey": false,
2230
+ "notNull": true
2231
+ },
2232
+ "secret": {
2233
+ "name": "secret",
2234
+ "type": "uuid",
2235
+ "primaryKey": false,
2236
+ "notNull": true
2237
+ },
2238
+ "purpose": {
2239
+ "name": "purpose",
2240
+ "type": "smallint",
2241
+ "primaryKey": false,
2242
+ "notNull": true
2243
+ },
2244
+ "mac": {
2245
+ "name": "mac",
2246
+ "type": "bytea",
2247
+ "primaryKey": false,
2248
+ "notNull": true
2249
+ },
2250
+ "place": {
2251
+ "name": "place",
2252
+ "type": "uuid",
2253
+ "primaryKey": false,
2254
+ "notNull": false
2255
+ }
2256
+ },
2257
+ "indexes": {
2258
+ "log_uses_request_idx": {
2259
+ "name": "log_uses_request_idx",
2260
+ "columns": [
2261
+ {
2262
+ "expression": "at",
2263
+ "isExpression": false,
2264
+ "asc": true,
2265
+ "nulls": "last"
2266
+ },
2267
+ {
2268
+ "expression": "request_id",
2269
+ "isExpression": false,
2270
+ "asc": true,
2271
+ "nulls": "last"
2272
+ }
2273
+ ],
2274
+ "isUnique": true,
2275
+ "concurrently": false,
2276
+ "method": "btree",
2277
+ "with": {}
2278
+ }
2279
+ },
2280
+ "foreignKeys": {},
2281
+ "compositePrimaryKeys": {},
2282
+ "uniqueConstraints": {},
2283
+ "policies": {},
2284
+ "checkConstraints": {
2285
+ "log_uses_mac_check": {
2286
+ "name": "log_uses_mac_check",
2287
+ "value": "octet_length(\"log_uses\".\"mac\") = 16"
2288
+ }
2289
+ },
2290
+ "isRLSEnabled": false
2291
+ },
2292
+ "public.mcp_approvals": {
2293
+ "name": "mcp_approvals",
2294
+ "schema": "",
2295
+ "columns": {
2296
+ "id": {
2297
+ "name": "id",
2298
+ "type": "uuid",
2299
+ "primaryKey": true,
2300
+ "notNull": true
2301
+ },
2302
+ "connection_id": {
2303
+ "name": "connection_id",
2304
+ "type": "uuid",
2305
+ "primaryKey": false,
2306
+ "notNull": true
2307
+ },
2308
+ "tool": {
2309
+ "name": "tool",
2310
+ "type": "text",
2311
+ "primaryKey": false,
2312
+ "notNull": true
2313
+ },
2314
+ "arguments": {
2315
+ "name": "arguments",
2316
+ "type": "text",
2317
+ "primaryKey": false,
2318
+ "notNull": true
2319
+ },
2320
+ "digest": {
2321
+ "name": "digest",
2322
+ "type": "bytea",
2323
+ "primaryKey": false,
2324
+ "notNull": true
2325
+ },
2326
+ "status": {
2327
+ "name": "status",
2328
+ "type": "text",
2329
+ "primaryKey": false,
2330
+ "notNull": true,
2331
+ "default": "'pending'"
2332
+ },
2333
+ "outcome": {
2334
+ "name": "outcome",
2335
+ "type": "text",
2336
+ "primaryKey": false,
2337
+ "notNull": false
2338
+ },
2339
+ "created_at": {
2340
+ "name": "created_at",
2341
+ "type": "timestamp with time zone",
2342
+ "primaryKey": false,
2343
+ "notNull": true,
2344
+ "default": "now()"
2345
+ },
2346
+ "expires_at": {
2347
+ "name": "expires_at",
2348
+ "type": "timestamp with time zone",
2349
+ "primaryKey": false,
2350
+ "notNull": true
2351
+ },
2352
+ "decided_at": {
2353
+ "name": "decided_at",
2354
+ "type": "timestamp with time zone",
2355
+ "primaryKey": false,
2356
+ "notNull": false
2357
+ },
2358
+ "reported_at": {
2359
+ "name": "reported_at",
2360
+ "type": "timestamp with time zone",
2361
+ "primaryKey": false,
2362
+ "notNull": false
2363
+ }
2364
+ },
2365
+ "indexes": {
2366
+ "mcp_approvals_open_idx": {
2367
+ "name": "mcp_approvals_open_idx",
2368
+ "columns": [
2369
+ {
2370
+ "expression": "connection_id",
2371
+ "isExpression": false,
2372
+ "asc": true,
2373
+ "nulls": "last"
2374
+ },
2375
+ {
2376
+ "expression": "digest",
2377
+ "isExpression": false,
2378
+ "asc": true,
2379
+ "nulls": "last"
2380
+ }
2381
+ ],
2382
+ "isUnique": false,
2383
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL",
2384
+ "concurrently": false,
2385
+ "method": "btree",
2386
+ "with": {}
2387
+ }
2388
+ },
2389
+ "foreignKeys": {
2390
+ "mcp_approvals_connection_fkey": {
2391
+ "name": "mcp_approvals_connection_fkey",
2392
+ "tableFrom": "mcp_approvals",
2393
+ "tableTo": "mcp_connections",
2394
+ "columnsFrom": [
2395
+ "connection_id"
2396
+ ],
2397
+ "columnsTo": [
2398
+ "id"
2399
+ ],
2400
+ "onDelete": "restrict",
2401
+ "onUpdate": "no action"
2402
+ }
2403
+ },
2404
+ "compositePrimaryKeys": {},
2405
+ "uniqueConstraints": {},
2406
+ "policies": {},
2407
+ "checkConstraints": {
2408
+ "mcp_approvals_status_check": {
2409
+ "name": "mcp_approvals_status_check",
2410
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
2411
+ },
2412
+ "mcp_approvals_digest_check": {
2413
+ "name": "mcp_approvals_digest_check",
2414
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
2415
+ },
2416
+ "mcp_approvals_arguments_check": {
2417
+ "name": "mcp_approvals_arguments_check",
2418
+ "value": "\"mcp_approvals\".\"arguments\"::jsonb IS NOT NULL"
2419
+ }
2420
+ },
2421
+ "isRLSEnabled": false
2422
+ },
2423
+ "public.mcp_connections": {
2424
+ "name": "mcp_connections",
2425
+ "schema": "",
2426
+ "columns": {
2427
+ "id": {
2428
+ "name": "id",
2429
+ "type": "uuid",
2430
+ "primaryKey": true,
2431
+ "notNull": true
2432
+ },
2433
+ "auth_mac": {
2434
+ "name": "auth_mac",
2435
+ "type": "bytea",
2436
+ "primaryKey": false,
2437
+ "notNull": true
2438
+ },
2439
+ "principal": {
2440
+ "name": "principal",
2441
+ "type": "text",
2442
+ "primaryKey": false,
2443
+ "notNull": true
2444
+ },
2445
+ "generation": {
2446
+ "name": "generation",
2447
+ "type": "integer",
2448
+ "primaryKey": false,
2449
+ "notNull": true
2450
+ },
2451
+ "client_id": {
2452
+ "name": "client_id",
2453
+ "type": "text",
2454
+ "primaryKey": false,
2455
+ "notNull": true
2456
+ },
2457
+ "client_name": {
2458
+ "name": "client_name",
2459
+ "type": "text",
2460
+ "primaryKey": false,
2461
+ "notNull": true
2462
+ },
2463
+ "client_host": {
2464
+ "name": "client_host",
2465
+ "type": "text",
2466
+ "primaryKey": false,
2467
+ "notNull": false
2468
+ },
2469
+ "registration": {
2470
+ "name": "registration",
2471
+ "type": "text",
2472
+ "primaryKey": false,
2473
+ "notNull": true
2474
+ },
2475
+ "scopes": {
2476
+ "name": "scopes",
2477
+ "type": "text",
2478
+ "primaryKey": false,
2479
+ "notNull": true
2480
+ },
2481
+ "redirect_uri": {
2482
+ "name": "redirect_uri",
2483
+ "type": "text",
2484
+ "primaryKey": false,
2485
+ "notNull": true
2486
+ },
2487
+ "code_hash": {
2488
+ "name": "code_hash",
2489
+ "type": "bytea",
2490
+ "primaryKey": false,
2491
+ "notNull": false
2492
+ },
2493
+ "code_challenge": {
2494
+ "name": "code_challenge",
2495
+ "type": "text",
2496
+ "primaryKey": false,
2497
+ "notNull": false
2498
+ },
2499
+ "code_expires_at": {
2500
+ "name": "code_expires_at",
2501
+ "type": "timestamp with time zone",
2502
+ "primaryKey": false,
2503
+ "notNull": false
2504
+ },
2505
+ "refresh_hash": {
2506
+ "name": "refresh_hash",
2507
+ "type": "bytea",
2508
+ "primaryKey": false,
2509
+ "notNull": false
2510
+ },
2511
+ "refresh_previous_hash": {
2512
+ "name": "refresh_previous_hash",
2513
+ "type": "bytea",
2514
+ "primaryKey": false,
2515
+ "notNull": false
2516
+ },
2517
+ "expires_at": {
2518
+ "name": "expires_at",
2519
+ "type": "timestamp with time zone",
2520
+ "primaryKey": false,
2521
+ "notNull": true
2522
+ },
2523
+ "created_at": {
2524
+ "name": "created_at",
2525
+ "type": "timestamp with time zone",
2526
+ "primaryKey": false,
2527
+ "notNull": true,
2528
+ "default": "now()"
2529
+ },
2530
+ "last_used_at": {
2531
+ "name": "last_used_at",
2532
+ "type": "timestamp with time zone",
2533
+ "primaryKey": false,
2534
+ "notNull": false
2535
+ },
2536
+ "last_used_ip": {
2537
+ "name": "last_used_ip",
2538
+ "type": "text",
2539
+ "primaryKey": false,
2540
+ "notNull": false
2541
+ },
2542
+ "revoked_at": {
2543
+ "name": "revoked_at",
2544
+ "type": "timestamp with time zone",
2545
+ "primaryKey": false,
2546
+ "notNull": false
2547
+ },
2548
+ "revoked_by": {
2549
+ "name": "revoked_by",
2550
+ "type": "text",
2551
+ "primaryKey": false,
2552
+ "notNull": false
2553
+ }
2554
+ },
2555
+ "indexes": {
2556
+ "mcp_connections_refresh_previous_idx": {
2557
+ "name": "mcp_connections_refresh_previous_idx",
2558
+ "columns": [
2559
+ {
2560
+ "expression": "refresh_previous_hash",
2561
+ "isExpression": false,
2562
+ "asc": true,
2563
+ "nulls": "last"
2564
+ }
2565
+ ],
2566
+ "isUnique": false,
2567
+ "concurrently": false,
2568
+ "method": "btree",
2569
+ "with": {}
2570
+ },
2571
+ "mcp_connections_live_idx": {
2572
+ "name": "mcp_connections_live_idx",
2573
+ "columns": [
2574
+ {
2575
+ "expression": "principal",
2576
+ "isExpression": false,
2577
+ "asc": true,
2578
+ "nulls": "last"
2579
+ },
2580
+ {
2581
+ "expression": "expires_at",
2582
+ "isExpression": false,
2583
+ "asc": true,
2584
+ "nulls": "last"
2585
+ }
2586
+ ],
2587
+ "isUnique": false,
2588
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL",
2589
+ "concurrently": false,
2590
+ "method": "btree",
2591
+ "with": {}
2592
+ }
2593
+ },
2594
+ "foreignKeys": {
2595
+ "mcp_connections_principal_fkey": {
2596
+ "name": "mcp_connections_principal_fkey",
2597
+ "tableFrom": "mcp_connections",
2598
+ "tableTo": "vault_members",
2599
+ "columnsFrom": [
2600
+ "principal"
2601
+ ],
2602
+ "columnsTo": [
2603
+ "principal"
2604
+ ],
2605
+ "onDelete": "restrict",
2606
+ "onUpdate": "no action"
2607
+ }
2608
+ },
2609
+ "compositePrimaryKeys": {},
2610
+ "uniqueConstraints": {
2611
+ "mcp_connections_code_hash_key": {
2612
+ "name": "mcp_connections_code_hash_key",
2613
+ "nullsNotDistinct": false,
2614
+ "columns": [
2615
+ "code_hash"
2616
+ ]
2617
+ },
2618
+ "mcp_connections_refresh_hash_key": {
2619
+ "name": "mcp_connections_refresh_hash_key",
2620
+ "nullsNotDistinct": false,
2621
+ "columns": [
2622
+ "refresh_hash"
2623
+ ]
2624
+ }
2625
+ },
2626
+ "policies": {},
2627
+ "checkConstraints": {
2628
+ "mcp_connections_principal_check": {
2629
+ "name": "mcp_connections_principal_check",
2630
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
2631
+ },
2632
+ "mcp_connections_registration_check": {
2633
+ "name": "mcp_connections_registration_check",
2634
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
2635
+ },
2636
+ "mcp_connections_auth_mac_check": {
2637
+ "name": "mcp_connections_auth_mac_check",
2638
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
2639
+ },
2640
+ "mcp_connections_code_hash_check": {
2641
+ "name": "mcp_connections_code_hash_check",
2642
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
2643
+ },
2644
+ "mcp_connections_refresh_hash_check": {
2645
+ "name": "mcp_connections_refresh_hash_check",
2646
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
2647
+ }
2648
+ },
2649
+ "isRLSEnabled": false
2650
+ },
2651
+ "public.oauth_clients": {
2652
+ "name": "oauth_clients",
2653
+ "schema": "",
2654
+ "columns": {
2655
+ "id": {
2656
+ "name": "id",
2657
+ "type": "uuid",
2658
+ "primaryKey": true,
2659
+ "notNull": true
2660
+ },
2661
+ "auth_mac": {
2662
+ "name": "auth_mac",
2663
+ "type": "bytea",
2664
+ "primaryKey": false,
2665
+ "notNull": true
2666
+ },
2667
+ "name": {
2668
+ "name": "name",
2669
+ "type": "text",
2670
+ "primaryKey": false,
2671
+ "notNull": true
2672
+ },
2673
+ "redirect_uris": {
2674
+ "name": "redirect_uris",
2675
+ "type": "text",
2676
+ "primaryKey": false,
2677
+ "notNull": true
2678
+ },
2679
+ "created_at": {
2680
+ "name": "created_at",
2681
+ "type": "timestamp with time zone",
2682
+ "primaryKey": false,
2683
+ "notNull": true,
2684
+ "default": "now()"
2685
+ },
2686
+ "created_ip": {
2687
+ "name": "created_ip",
2688
+ "type": "text",
2689
+ "primaryKey": false,
2690
+ "notNull": false
2691
+ },
2692
+ "revoked_at": {
2693
+ "name": "revoked_at",
2694
+ "type": "timestamp with time zone",
2695
+ "primaryKey": false,
2696
+ "notNull": false
2697
+ }
2698
+ },
2699
+ "indexes": {},
2700
+ "foreignKeys": {},
2701
+ "compositePrimaryKeys": {},
2702
+ "uniqueConstraints": {},
2703
+ "policies": {},
2704
+ "checkConstraints": {
2705
+ "oauth_clients_auth_mac_check": {
2706
+ "name": "oauth_clients_auth_mac_check",
2707
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
2708
+ },
2709
+ "oauth_clients_redirect_uris_check": {
2710
+ "name": "oauth_clients_redirect_uris_check",
2711
+ "value": "\"oauth_clients\".\"redirect_uris\"::jsonb IS NOT NULL"
2712
+ }
2713
+ },
2714
+ "isRLSEnabled": false
2715
+ },
2716
+ "public.projects": {
2717
+ "name": "projects",
2718
+ "schema": "",
2719
+ "columns": {
2720
+ "id": {
2721
+ "name": "id",
2722
+ "type": "uuid",
2723
+ "primaryKey": true,
2724
+ "notNull": true,
2725
+ "default": "gen_random_uuid()"
2726
+ },
2727
+ "slug": {
2728
+ "name": "slug",
2729
+ "type": "text",
2730
+ "primaryKey": false,
2731
+ "notNull": true
2732
+ },
2733
+ "name": {
2734
+ "name": "name",
2735
+ "type": "text",
2736
+ "primaryKey": false,
2737
+ "notNull": true
2738
+ },
2739
+ "created_at": {
2740
+ "name": "created_at",
2741
+ "type": "timestamp with time zone",
2742
+ "primaryKey": false,
2743
+ "notNull": true,
2744
+ "default": "now()"
2745
+ },
2746
+ "archived_at": {
2747
+ "name": "archived_at",
2748
+ "type": "timestamp with time zone",
2749
+ "primaryKey": false,
2750
+ "notNull": false
2751
+ },
2752
+ "folder": {
2753
+ "name": "folder",
2754
+ "type": "text",
2755
+ "primaryKey": false,
2756
+ "notNull": false
2757
+ }
2758
+ },
2759
+ "indexes": {},
2760
+ "foreignKeys": {},
2761
+ "compositePrimaryKeys": {},
2762
+ "uniqueConstraints": {
2763
+ "projects_slug_key": {
2764
+ "name": "projects_slug_key",
2765
+ "nullsNotDistinct": false,
2766
+ "columns": [
2767
+ "slug"
2768
+ ]
2769
+ }
2770
+ },
2771
+ "policies": {},
2772
+ "checkConstraints": {
2773
+ "projects_slug_check": {
2774
+ "name": "projects_slug_check",
2775
+ "value": "\"projects\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
2776
+ },
2777
+ "projects_folder_check": {
2778
+ "name": "projects_folder_check",
2779
+ "value": "\"projects\".\"folder\" IS NULL OR (char_length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" !~ '[/[:cntrl:]]' AND \"projects\".\"folder\" = btrim(\"projects\".\"folder\"))"
2780
+ }
2781
+ },
2782
+ "isRLSEnabled": false
2783
+ },
2784
+ "public.secret_references": {
2785
+ "name": "secret_references",
2786
+ "schema": "",
2787
+ "columns": {
2788
+ "id": {
2789
+ "name": "id",
2790
+ "type": "uuid",
2791
+ "primaryKey": true,
2792
+ "notNull": true
2793
+ },
2794
+ "project_id": {
2795
+ "name": "project_id",
2796
+ "type": "uuid",
2797
+ "primaryKey": false,
2798
+ "notNull": true
2799
+ },
2800
+ "environment_id": {
2801
+ "name": "environment_id",
2802
+ "type": "uuid",
2803
+ "primaryKey": false,
2804
+ "notNull": true
2805
+ },
2806
+ "secret_id": {
2807
+ "name": "secret_id",
2808
+ "type": "uuid",
2809
+ "primaryKey": false,
2810
+ "notNull": true
2811
+ },
2812
+ "source_project_id": {
2813
+ "name": "source_project_id",
2814
+ "type": "uuid",
2815
+ "primaryKey": false,
2816
+ "notNull": true
2817
+ },
2818
+ "source_environment_id": {
2819
+ "name": "source_environment_id",
2820
+ "type": "uuid",
2821
+ "primaryKey": false,
2822
+ "notNull": true
2823
+ },
2824
+ "source_secret_id": {
2825
+ "name": "source_secret_id",
2826
+ "type": "uuid",
2827
+ "primaryKey": false,
2828
+ "notNull": true
2829
+ },
2830
+ "created_seq": {
2831
+ "name": "created_seq",
2832
+ "type": "bigint",
2833
+ "primaryKey": false,
2834
+ "notNull": true
2835
+ },
2836
+ "created_at": {
2837
+ "name": "created_at",
2838
+ "type": "timestamp with time zone",
2839
+ "primaryKey": false,
2840
+ "notNull": true,
2841
+ "default": "now()"
2842
+ },
2843
+ "created_by": {
2844
+ "name": "created_by",
2845
+ "type": "text",
2846
+ "primaryKey": false,
2847
+ "notNull": true
2848
+ },
2849
+ "ended_at": {
2850
+ "name": "ended_at",
2851
+ "type": "timestamp with time zone",
2852
+ "primaryKey": false,
2853
+ "notNull": false
2854
+ }
2855
+ },
2856
+ "indexes": {
2857
+ "secret_references_holder_idx": {
2858
+ "name": "secret_references_holder_idx",
2859
+ "columns": [
2860
+ {
2861
+ "expression": "secret_id",
2862
+ "isExpression": false,
2863
+ "asc": true,
2864
+ "nulls": "last"
2865
+ },
2866
+ {
2867
+ "expression": "created_seq",
2868
+ "isExpression": false,
2869
+ "asc": true,
2870
+ "nulls": "last"
2871
+ }
2872
+ ],
2873
+ "isUnique": false,
2874
+ "concurrently": false,
2875
+ "method": "btree",
2876
+ "with": {}
2877
+ },
2878
+ "secret_references_source_idx": {
2879
+ "name": "secret_references_source_idx",
2880
+ "columns": [
2881
+ {
2882
+ "expression": "source_secret_id",
2883
+ "isExpression": false,
2884
+ "asc": true,
2885
+ "nulls": "last"
2886
+ }
2887
+ ],
2888
+ "isUnique": false,
2889
+ "concurrently": false,
2890
+ "method": "btree",
2891
+ "with": {}
2892
+ },
2893
+ "secret_references_project_idx": {
2894
+ "name": "secret_references_project_idx",
2895
+ "columns": [
2896
+ {
2897
+ "expression": "project_id",
2898
+ "isExpression": false,
2899
+ "asc": true,
2900
+ "nulls": "last"
2901
+ }
2902
+ ],
2903
+ "isUnique": false,
2904
+ "concurrently": false,
2905
+ "method": "btree",
2906
+ "with": {}
2907
+ },
2908
+ "secret_references_source_project_idx": {
2909
+ "name": "secret_references_source_project_idx",
2910
+ "columns": [
2911
+ {
2912
+ "expression": "source_project_id",
2913
+ "isExpression": false,
2914
+ "asc": true,
2915
+ "nulls": "last"
2916
+ }
2917
+ ],
2918
+ "isUnique": false,
2919
+ "concurrently": false,
2920
+ "method": "btree",
2921
+ "with": {}
2922
+ },
2923
+ "secret_references_created_by_idx": {
2924
+ "name": "secret_references_created_by_idx",
2925
+ "columns": [
2926
+ {
2927
+ "expression": "created_by",
2928
+ "isExpression": false,
2929
+ "asc": true,
2930
+ "nulls": "last"
2931
+ }
2932
+ ],
2933
+ "isUnique": false,
2934
+ "concurrently": false,
2935
+ "method": "btree",
2936
+ "with": {}
2937
+ }
2938
+ },
2939
+ "foreignKeys": {
2940
+ "secret_references_secret_id_fkey": {
2941
+ "name": "secret_references_secret_id_fkey",
2942
+ "tableFrom": "secret_references",
2943
+ "tableTo": "secrets",
2944
+ "columnsFrom": [
2945
+ "secret_id"
2946
+ ],
2947
+ "columnsTo": [
2948
+ "id"
2949
+ ],
2950
+ "onDelete": "restrict",
2951
+ "onUpdate": "no action"
2952
+ },
2953
+ "secret_references_source_secret_id_fkey": {
2954
+ "name": "secret_references_source_secret_id_fkey",
2955
+ "tableFrom": "secret_references",
2956
+ "tableTo": "secrets",
2957
+ "columnsFrom": [
2958
+ "source_secret_id"
2959
+ ],
2960
+ "columnsTo": [
2961
+ "id"
2962
+ ],
2963
+ "onDelete": "restrict",
2964
+ "onUpdate": "no action"
2965
+ },
2966
+ "secret_references_created_seq_fkey": {
2967
+ "name": "secret_references_created_seq_fkey",
2968
+ "tableFrom": "secret_references",
2969
+ "tableTo": "audit_log",
2970
+ "columnsFrom": [
2971
+ "created_seq"
2972
+ ],
2973
+ "columnsTo": [
2974
+ "seq"
2975
+ ],
2976
+ "onDelete": "restrict",
2977
+ "onUpdate": "no action"
2978
+ }
2979
+ },
2980
+ "compositePrimaryKeys": {},
2981
+ "uniqueConstraints": {
2982
+ "secret_references_created_seq_key": {
2983
+ "name": "secret_references_created_seq_key",
2984
+ "nullsNotDistinct": false,
2985
+ "columns": [
2986
+ "created_seq"
2987
+ ]
2988
+ }
2989
+ },
2990
+ "policies": {},
2991
+ "checkConstraints": {},
2992
+ "isRLSEnabled": false
2993
+ },
2994
+ "public.secret_versions": {
2995
+ "name": "secret_versions",
2996
+ "schema": "",
2997
+ "columns": {
2998
+ "id": {
2999
+ "name": "id",
3000
+ "type": "uuid",
3001
+ "primaryKey": true,
3002
+ "notNull": true,
3003
+ "default": "gen_random_uuid()"
3004
+ },
3005
+ "secret_id": {
3006
+ "name": "secret_id",
3007
+ "type": "uuid",
3008
+ "primaryKey": false,
3009
+ "notNull": true
3010
+ },
3011
+ "version": {
3012
+ "name": "version",
3013
+ "type": "integer",
3014
+ "primaryKey": false,
3015
+ "notNull": true
3016
+ },
3017
+ "envelope_version": {
3018
+ "name": "envelope_version",
3019
+ "type": "integer",
3020
+ "primaryKey": false,
3021
+ "notNull": true
3022
+ },
3023
+ "ciphertext": {
3024
+ "name": "ciphertext",
3025
+ "type": "bytea",
3026
+ "primaryKey": false,
3027
+ "notNull": true
3028
+ },
3029
+ "iv": {
3030
+ "name": "iv",
3031
+ "type": "bytea",
3032
+ "primaryKey": false,
3033
+ "notNull": true
3034
+ },
3035
+ "auth_tag": {
3036
+ "name": "auth_tag",
3037
+ "type": "bytea",
3038
+ "primaryKey": false,
3039
+ "notNull": true
3040
+ },
3041
+ "wrapped_dek": {
3042
+ "name": "wrapped_dek",
3043
+ "type": "bytea",
3044
+ "primaryKey": false,
3045
+ "notNull": true
3046
+ },
3047
+ "kek_provider": {
3048
+ "name": "kek_provider",
3049
+ "type": "text",
3050
+ "primaryKey": false,
3051
+ "notNull": true
3052
+ },
3053
+ "kek_id": {
3054
+ "name": "kek_id",
3055
+ "type": "text",
3056
+ "primaryKey": false,
3057
+ "notNull": true
3058
+ },
3059
+ "kek_version": {
3060
+ "name": "kek_version",
3061
+ "type": "text",
3062
+ "primaryKey": false,
3063
+ "notNull": true
3064
+ },
3065
+ "created_at": {
3066
+ "name": "created_at",
3067
+ "type": "timestamp with time zone",
3068
+ "primaryKey": false,
3069
+ "notNull": true,
3070
+ "default": "now()"
3071
+ },
3072
+ "created_by": {
3073
+ "name": "created_by",
3074
+ "type": "text",
3075
+ "primaryKey": false,
3076
+ "notNull": true
3077
+ },
3078
+ "recipe": {
3079
+ "name": "recipe",
3080
+ "type": "text",
3081
+ "primaryKey": false,
3082
+ "notNull": false
3083
+ },
3084
+ "pair_id": {
3085
+ "name": "pair_id",
3086
+ "type": "uuid",
3087
+ "primaryKey": false,
3088
+ "notNull": false
3089
+ },
3090
+ "pair_half": {
3091
+ "name": "pair_half",
3092
+ "type": "text",
3093
+ "primaryKey": false,
3094
+ "notNull": false
3095
+ },
3096
+ "plaintext": {
3097
+ "name": "plaintext",
3098
+ "type": "text",
3099
+ "primaryKey": false,
3100
+ "notNull": false
3101
+ },
3102
+ "sensitive": {
3103
+ "name": "sensitive",
3104
+ "type": "boolean",
3105
+ "primaryKey": false,
3106
+ "notNull": true,
3107
+ "default": false
3108
+ }
3109
+ },
3110
+ "indexes": {
3111
+ "secret_versions_secret_idx": {
3112
+ "name": "secret_versions_secret_idx",
3113
+ "columns": [
3114
+ {
3115
+ "expression": "secret_id",
3116
+ "isExpression": false,
3117
+ "asc": true,
3118
+ "nulls": "last"
3119
+ },
3120
+ {
3121
+ "expression": "version",
3122
+ "isExpression": false,
3123
+ "asc": false,
3124
+ "nulls": "last"
3125
+ }
3126
+ ],
3127
+ "isUnique": false,
3128
+ "concurrently": false,
3129
+ "method": "btree",
3130
+ "with": {}
3131
+ }
3132
+ },
3133
+ "foreignKeys": {
3134
+ "secret_versions_secret_id_fkey": {
3135
+ "name": "secret_versions_secret_id_fkey",
3136
+ "tableFrom": "secret_versions",
3137
+ "tableTo": "secrets",
3138
+ "columnsFrom": [
3139
+ "secret_id"
3140
+ ],
3141
+ "columnsTo": [
3142
+ "id"
3143
+ ],
3144
+ "onDelete": "restrict",
3145
+ "onUpdate": "no action"
3146
+ }
3147
+ },
3148
+ "compositePrimaryKeys": {},
3149
+ "uniqueConstraints": {
3150
+ "secret_versions_secret_id_version_key": {
3151
+ "name": "secret_versions_secret_id_version_key",
3152
+ "nullsNotDistinct": false,
3153
+ "columns": [
3154
+ "secret_id",
3155
+ "version"
3156
+ ]
3157
+ }
3158
+ },
3159
+ "policies": {},
3160
+ "checkConstraints": {
3161
+ "secret_versions_version_check": {
3162
+ "name": "secret_versions_version_check",
3163
+ "value": "\"secret_versions\".\"version\" > 0"
3164
+ },
3165
+ "secret_versions_iv_check": {
3166
+ "name": "secret_versions_iv_check",
3167
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
3168
+ },
3169
+ "secret_versions_auth_tag_check": {
3170
+ "name": "secret_versions_auth_tag_check",
3171
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
3172
+ }
3173
+ },
3174
+ "isRLSEnabled": false
3175
+ },
3176
+ "public.secrets": {
3177
+ "name": "secrets",
3178
+ "schema": "",
3179
+ "columns": {
3180
+ "id": {
3181
+ "name": "id",
3182
+ "type": "uuid",
3183
+ "primaryKey": true,
3184
+ "notNull": true,
3185
+ "default": "gen_random_uuid()"
3186
+ },
3187
+ "project_id": {
3188
+ "name": "project_id",
3189
+ "type": "uuid",
3190
+ "primaryKey": false,
3191
+ "notNull": true
3192
+ },
3193
+ "environment_id": {
3194
+ "name": "environment_id",
3195
+ "type": "uuid",
3196
+ "primaryKey": false,
3197
+ "notNull": true
3198
+ },
3199
+ "key": {
3200
+ "name": "key",
3201
+ "type": "text",
3202
+ "primaryKey": false,
3203
+ "notNull": true
3204
+ },
3205
+ "created_at": {
3206
+ "name": "created_at",
3207
+ "type": "timestamp with time zone",
3208
+ "primaryKey": false,
3209
+ "notNull": true,
3210
+ "default": "now()"
3211
+ },
3212
+ "updated_at": {
3213
+ "name": "updated_at",
3214
+ "type": "timestamp with time zone",
3215
+ "primaryKey": false,
3216
+ "notNull": true,
3217
+ "default": "now()"
3218
+ },
3219
+ "current_version_id": {
3220
+ "name": "current_version_id",
3221
+ "type": "uuid",
3222
+ "primaryKey": false,
3223
+ "notNull": false
3224
+ },
3225
+ "current_version": {
3226
+ "name": "current_version",
3227
+ "type": "integer",
3228
+ "primaryKey": false,
3229
+ "notNull": true,
3230
+ "default": 0
3231
+ },
3232
+ "archived_at": {
3233
+ "name": "archived_at",
3234
+ "type": "timestamp with time zone",
3235
+ "primaryKey": false,
3236
+ "notNull": false
3237
+ },
3238
+ "folder": {
3239
+ "name": "folder",
3240
+ "type": "text",
3241
+ "primaryKey": false,
3242
+ "notNull": false
3243
+ },
3244
+ "seal": {
3245
+ "name": "seal",
3246
+ "type": "bytea",
3247
+ "primaryKey": false,
3248
+ "notNull": false
3249
+ }
3250
+ },
3251
+ "indexes": {
3252
+ "secrets_lookup_idx": {
3253
+ "name": "secrets_lookup_idx",
3254
+ "columns": [
3255
+ {
3256
+ "expression": "project_id",
3257
+ "isExpression": false,
3258
+ "asc": true,
3259
+ "nulls": "last"
3260
+ },
3261
+ {
3262
+ "expression": "environment_id",
3263
+ "isExpression": false,
3264
+ "asc": true,
3265
+ "nulls": "last"
3266
+ },
3267
+ {
3268
+ "expression": "key",
3269
+ "isExpression": false,
3270
+ "asc": true,
3271
+ "nulls": "last"
3272
+ }
3273
+ ],
3274
+ "isUnique": false,
3275
+ "concurrently": false,
3276
+ "method": "btree",
3277
+ "with": {}
3278
+ },
3279
+ "secrets_live_idx": {
3280
+ "name": "secrets_live_idx",
3281
+ "columns": [
3282
+ {
3283
+ "expression": "environment_id",
3284
+ "isExpression": false,
3285
+ "asc": true,
3286
+ "nulls": "last"
3287
+ }
3288
+ ],
3289
+ "isUnique": false,
3290
+ "where": "\"secrets\".\"archived_at\" IS NULL",
3291
+ "concurrently": false,
3292
+ "method": "btree",
3293
+ "with": {}
3294
+ }
3295
+ },
3296
+ "foreignKeys": {
3297
+ "secrets_current_version_id_secret_versions_id_fk": {
3298
+ "name": "secrets_current_version_id_secret_versions_id_fk",
3299
+ "tableFrom": "secrets",
3300
+ "tableTo": "secret_versions",
3301
+ "columnsFrom": [
3302
+ "current_version_id"
3303
+ ],
3304
+ "columnsTo": [
3305
+ "id"
3306
+ ],
3307
+ "onDelete": "no action",
3308
+ "onUpdate": "no action"
3309
+ },
3310
+ "secrets_project_id_fkey": {
3311
+ "name": "secrets_project_id_fkey",
3312
+ "tableFrom": "secrets",
3313
+ "tableTo": "projects",
3314
+ "columnsFrom": [
3315
+ "project_id"
3316
+ ],
3317
+ "columnsTo": [
3318
+ "id"
3319
+ ],
3320
+ "onDelete": "restrict",
3321
+ "onUpdate": "no action"
3322
+ },
3323
+ "secrets_environment_id_fkey": {
3324
+ "name": "secrets_environment_id_fkey",
3325
+ "tableFrom": "secrets",
3326
+ "tableTo": "environments",
3327
+ "columnsFrom": [
3328
+ "environment_id"
3329
+ ],
3330
+ "columnsTo": [
3331
+ "id"
3332
+ ],
3333
+ "onDelete": "restrict",
3334
+ "onUpdate": "no action"
3335
+ },
3336
+ "secrets_environment_in_project": {
3337
+ "name": "secrets_environment_in_project",
3338
+ "tableFrom": "secrets",
3339
+ "tableTo": "environments",
3340
+ "columnsFrom": [
3341
+ "environment_id",
3342
+ "project_id"
3343
+ ],
3344
+ "columnsTo": [
3345
+ "id",
3346
+ "project_id"
3347
+ ],
3348
+ "onDelete": "no action",
3349
+ "onUpdate": "no action"
3350
+ }
3351
+ },
3352
+ "compositePrimaryKeys": {},
3353
+ "uniqueConstraints": {
3354
+ "secrets_project_id_environment_id_key_key": {
3355
+ "name": "secrets_project_id_environment_id_key_key",
3356
+ "nullsNotDistinct": false,
3357
+ "columns": [
3358
+ "project_id",
3359
+ "environment_id",
3360
+ "key"
3361
+ ]
3362
+ }
3363
+ },
3364
+ "policies": {},
3365
+ "checkConstraints": {
3366
+ "secrets_seal_check": {
3367
+ "name": "secrets_seal_check",
3368
+ "value": "\"secrets\".\"seal\" IS NULL OR octet_length(\"secrets\".\"seal\") = 16"
3369
+ },
3370
+ "secrets_key_check": {
3371
+ "name": "secrets_key_check",
3372
+ "value": "\"secrets\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
3373
+ },
3374
+ "secrets_folder_check": {
3375
+ "name": "secrets_folder_check",
3376
+ "value": "\"secrets\".\"folder\" IS NULL OR (char_length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" !~ '[/[:cntrl:]]' AND \"secrets\".\"folder\" = btrim(\"secrets\".\"folder\"))"
3377
+ }
3378
+ },
3379
+ "isRLSEnabled": false
3380
+ },
3381
+ "public.service_bindings": {
3382
+ "name": "service_bindings",
3383
+ "schema": "",
3384
+ "columns": {
3385
+ "id": {
3386
+ "name": "id",
3387
+ "type": "uuid",
3388
+ "primaryKey": true,
3389
+ "notNull": true
3390
+ },
3391
+ "auth_mac": {
3392
+ "name": "auth_mac",
3393
+ "type": "bytea",
3394
+ "primaryKey": false,
3395
+ "notNull": true
3396
+ },
3397
+ "principal": {
3398
+ "name": "principal",
3399
+ "type": "text",
3400
+ "primaryKey": false,
3401
+ "notNull": true
3402
+ },
3403
+ "generation": {
3404
+ "name": "generation",
3405
+ "type": "integer",
3406
+ "primaryKey": false,
3407
+ "notNull": true
3408
+ },
3409
+ "profile": {
3410
+ "name": "profile",
3411
+ "type": "text",
3412
+ "primaryKey": false,
3413
+ "notNull": true
3414
+ },
3415
+ "issuer": {
3416
+ "name": "issuer",
3417
+ "type": "text",
3418
+ "primaryKey": false,
3419
+ "notNull": true
3420
+ },
3421
+ "jwks_uri": {
3422
+ "name": "jwks_uri",
3423
+ "type": "text",
3424
+ "primaryKey": false,
3425
+ "notNull": true
3426
+ },
3427
+ "jwks": {
3428
+ "name": "jwks",
3429
+ "type": "text",
3430
+ "primaryKey": false,
3431
+ "notNull": false
3432
+ },
3433
+ "claims": {
3434
+ "name": "claims",
3435
+ "type": "text",
3436
+ "primaryKey": false,
3437
+ "notNull": true
3438
+ },
3439
+ "scope": {
3440
+ "name": "scope",
3441
+ "type": "text",
3442
+ "primaryKey": false,
3443
+ "notNull": false
3444
+ },
3445
+ "policy": {
3446
+ "name": "policy",
3447
+ "type": "text",
3448
+ "primaryKey": false,
3449
+ "notNull": false
3450
+ },
3451
+ "origin": {
3452
+ "name": "origin",
3453
+ "type": "text",
3454
+ "primaryKey": false,
3455
+ "notNull": false
3456
+ },
3457
+ "label": {
3458
+ "name": "label",
3459
+ "type": "text",
3460
+ "primaryKey": false,
3461
+ "notNull": false
3462
+ },
3463
+ "created_at": {
3464
+ "name": "created_at",
3465
+ "type": "timestamp with time zone",
3466
+ "primaryKey": false,
3467
+ "notNull": true,
3468
+ "default": "now()"
3469
+ },
3470
+ "created_by": {
3471
+ "name": "created_by",
3472
+ "type": "text",
3473
+ "primaryKey": false,
3474
+ "notNull": true
3475
+ },
3476
+ "last_used_at": {
3477
+ "name": "last_used_at",
3478
+ "type": "timestamp with time zone",
3479
+ "primaryKey": false,
3480
+ "notNull": false
3481
+ },
3482
+ "revoked_at": {
3483
+ "name": "revoked_at",
3484
+ "type": "timestamp with time zone",
3485
+ "primaryKey": false,
3486
+ "notNull": false
3487
+ },
3488
+ "revoked_by": {
3489
+ "name": "revoked_by",
3490
+ "type": "text",
3491
+ "primaryKey": false,
3492
+ "notNull": false
3493
+ },
3494
+ "seal": {
3495
+ "name": "seal",
3496
+ "type": "bytea",
3497
+ "primaryKey": false,
3498
+ "notNull": false
3499
+ }
3500
+ },
3501
+ "indexes": {
3502
+ "service_bindings_principal_idx": {
3503
+ "name": "service_bindings_principal_idx",
3504
+ "columns": [
3505
+ {
3506
+ "expression": "principal",
3507
+ "isExpression": false,
3508
+ "asc": true,
3509
+ "nulls": "last"
3510
+ },
3511
+ {
3512
+ "expression": "issuer",
3513
+ "isExpression": false,
3514
+ "asc": true,
3515
+ "nulls": "last"
3516
+ }
3517
+ ],
3518
+ "isUnique": false,
3519
+ "concurrently": false,
3520
+ "method": "btree",
3521
+ "with": {}
3522
+ },
3523
+ "service_bindings_live_idx": {
3524
+ "name": "service_bindings_live_idx",
3525
+ "columns": [
3526
+ {
3527
+ "expression": "principal",
3528
+ "isExpression": false,
3529
+ "asc": true,
3530
+ "nulls": "last"
3531
+ },
3532
+ {
3533
+ "expression": "issuer",
3534
+ "isExpression": false,
3535
+ "asc": true,
3536
+ "nulls": "last"
3537
+ },
3538
+ {
3539
+ "expression": "generation",
3540
+ "isExpression": false,
3541
+ "asc": true,
3542
+ "nulls": "last"
3543
+ },
3544
+ {
3545
+ "expression": "created_at",
3546
+ "isExpression": false,
3547
+ "asc": true,
3548
+ "nulls": "last"
3549
+ },
3550
+ {
3551
+ "expression": "id",
3552
+ "isExpression": false,
3553
+ "asc": true,
3554
+ "nulls": "last"
3555
+ }
3556
+ ],
3557
+ "isUnique": false,
3558
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL",
3559
+ "concurrently": false,
3560
+ "method": "btree",
3561
+ "with": {}
3562
+ }
3563
+ },
3564
+ "foreignKeys": {
3565
+ "service_bindings_principal_fkey": {
3566
+ "name": "service_bindings_principal_fkey",
3567
+ "tableFrom": "service_bindings",
3568
+ "tableTo": "vault_members",
3569
+ "columnsFrom": [
3570
+ "principal"
3571
+ ],
3572
+ "columnsTo": [
3573
+ "principal"
3574
+ ],
3575
+ "onDelete": "restrict",
3576
+ "onUpdate": "no action"
3577
+ }
3578
+ },
3579
+ "compositePrimaryKeys": {},
3580
+ "uniqueConstraints": {},
3581
+ "policies": {},
3582
+ "checkConstraints": {
3583
+ "service_bindings_seal_check": {
3584
+ "name": "service_bindings_seal_check",
3585
+ "value": "\"service_bindings\".\"seal\" IS NULL OR octet_length(\"service_bindings\".\"seal\") = 16"
3586
+ },
3587
+ "service_bindings_principal_check": {
3588
+ "name": "service_bindings_principal_check",
3589
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
3590
+ },
3591
+ "service_bindings_auth_mac_check": {
3592
+ "name": "service_bindings_auth_mac_check",
3593
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
3594
+ },
3595
+ "service_bindings_claims_check": {
3596
+ "name": "service_bindings_claims_check",
3597
+ "value": "\"service_bindings\".\"claims\"::jsonb IS NOT NULL"
3598
+ }
3599
+ },
3600
+ "isRLSEnabled": false
3601
+ },
3602
+ "public.vault_grants": {
3603
+ "name": "vault_grants",
3604
+ "schema": "",
3605
+ "columns": {
3606
+ "principal": {
3607
+ "name": "principal",
3608
+ "type": "text",
3609
+ "primaryKey": false,
3610
+ "notNull": true
3611
+ },
3612
+ "project_id": {
3613
+ "name": "project_id",
3614
+ "type": "uuid",
3615
+ "primaryKey": false,
3616
+ "notNull": false
3617
+ },
3618
+ "environment_id": {
3619
+ "name": "environment_id",
3620
+ "type": "uuid",
3621
+ "primaryKey": false,
3622
+ "notNull": false
3623
+ },
3624
+ "environment_slug": {
3625
+ "name": "environment_slug",
3626
+ "type": "text",
3627
+ "primaryKey": false,
3628
+ "notNull": false
3629
+ },
3630
+ "role": {
3631
+ "name": "role",
3632
+ "type": "text",
3633
+ "primaryKey": false,
3634
+ "notNull": true
3635
+ },
3636
+ "expires_at": {
3637
+ "name": "expires_at",
3638
+ "type": "bigint",
3639
+ "primaryKey": false,
3640
+ "notNull": false
3641
+ },
3642
+ "granted_at": {
3643
+ "name": "granted_at",
3644
+ "type": "bigint",
3645
+ "primaryKey": false,
3646
+ "notNull": true
3647
+ },
3648
+ "granted_by": {
3649
+ "name": "granted_by",
3650
+ "type": "text",
3651
+ "primaryKey": false,
3652
+ "notNull": true
3653
+ }
3654
+ },
3655
+ "indexes": {
3656
+ "vault_grants_on_every_project": {
3657
+ "name": "vault_grants_on_every_project",
3658
+ "columns": [
3659
+ {
3660
+ "expression": "principal",
3661
+ "isExpression": false,
3662
+ "asc": true,
3663
+ "nulls": "last"
3664
+ }
3665
+ ],
3666
+ "isUnique": true,
3667
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL",
3668
+ "concurrently": false,
3669
+ "method": "btree",
3670
+ "with": {}
3671
+ }
3672
+ },
3673
+ "foreignKeys": {
3674
+ "vault_grants_principal_fkey": {
3675
+ "name": "vault_grants_principal_fkey",
3676
+ "tableFrom": "vault_grants",
3677
+ "tableTo": "vault_members",
3678
+ "columnsFrom": [
3679
+ "principal"
3680
+ ],
3681
+ "columnsTo": [
3682
+ "principal"
3683
+ ],
3684
+ "onDelete": "restrict",
3685
+ "onUpdate": "no action"
3686
+ },
3687
+ "vault_grants_project_id_fkey": {
3688
+ "name": "vault_grants_project_id_fkey",
3689
+ "tableFrom": "vault_grants",
3690
+ "tableTo": "projects",
3691
+ "columnsFrom": [
3692
+ "project_id"
3693
+ ],
3694
+ "columnsTo": [
3695
+ "id"
3696
+ ],
3697
+ "onDelete": "restrict",
3698
+ "onUpdate": "no action"
3699
+ },
3700
+ "vault_grants_environment_id_fkey": {
3701
+ "name": "vault_grants_environment_id_fkey",
3702
+ "tableFrom": "vault_grants",
3703
+ "tableTo": "environments",
3704
+ "columnsFrom": [
3705
+ "environment_id"
3706
+ ],
3707
+ "columnsTo": [
3708
+ "id"
3709
+ ],
3710
+ "onDelete": "restrict",
3711
+ "onUpdate": "no action"
3712
+ }
3713
+ },
3714
+ "compositePrimaryKeys": {},
3715
+ "uniqueConstraints": {
3716
+ "vault_grants_on_project": {
3717
+ "name": "vault_grants_on_project",
3718
+ "nullsNotDistinct": false,
3719
+ "columns": [
3720
+ "principal",
3721
+ "project_id"
3722
+ ]
3723
+ },
3724
+ "vault_grants_on_environment": {
3725
+ "name": "vault_grants_on_environment",
3726
+ "nullsNotDistinct": false,
3727
+ "columns": [
3728
+ "principal",
3729
+ "environment_id"
3730
+ ]
3731
+ },
3732
+ "vault_grants_on_environment_slug": {
3733
+ "name": "vault_grants_on_environment_slug",
3734
+ "nullsNotDistinct": false,
3735
+ "columns": [
3736
+ "principal",
3737
+ "environment_slug"
3738
+ ]
3739
+ }
3740
+ },
3741
+ "policies": {},
3742
+ "checkConstraints": {
3743
+ "vault_grants_one_place": {
3744
+ "name": "vault_grants_one_place",
3745
+ "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)"
3746
+ },
3747
+ "vault_grants_environment_slug_check": {
3748
+ "name": "vault_grants_environment_slug_check",
3749
+ "value": "\"vault_grants\".\"environment_slug\" IS NULL OR \"vault_grants\".\"environment_slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
3750
+ },
3751
+ "vault_grants_role_check": {
3752
+ "name": "vault_grants_role_check",
3753
+ "value": "\"vault_grants\".\"role\" ~ '^[a-z][a-z0-9-]{1,31}$'"
3754
+ }
3755
+ },
3756
+ "isRLSEnabled": false
3757
+ },
3758
+ "public.vault_members": {
3759
+ "name": "vault_members",
3760
+ "schema": "",
3761
+ "columns": {
3762
+ "principal": {
3763
+ "name": "principal",
3764
+ "type": "text",
3765
+ "primaryKey": true,
3766
+ "notNull": true
3767
+ },
3768
+ "status": {
3769
+ "name": "status",
3770
+ "type": "text",
3771
+ "primaryKey": false,
3772
+ "notNull": true
3773
+ },
3774
+ "owner": {
3775
+ "name": "owner",
3776
+ "type": "boolean",
3777
+ "primaryKey": false,
3778
+ "notNull": true,
3779
+ "default": false
3780
+ },
3781
+ "role": {
3782
+ "name": "role",
3783
+ "type": "text",
3784
+ "primaryKey": false,
3785
+ "notNull": false
3786
+ },
3787
+ "scope": {
3788
+ "name": "scope",
3789
+ "type": "text",
3790
+ "primaryKey": false,
3791
+ "notNull": false
3792
+ },
3793
+ "generation": {
3794
+ "name": "generation",
3795
+ "type": "integer",
3796
+ "primaryKey": false,
3797
+ "notNull": true,
3798
+ "default": 0
3799
+ },
3800
+ "created_at": {
3801
+ "name": "created_at",
3802
+ "type": "bigint",
3803
+ "primaryKey": false,
3804
+ "notNull": true
3805
+ },
3806
+ "created_by": {
3807
+ "name": "created_by",
3808
+ "type": "text",
3809
+ "primaryKey": false,
3810
+ "notNull": true
3811
+ },
3812
+ "status_changed_at": {
3813
+ "name": "status_changed_at",
3814
+ "type": "bigint",
3815
+ "primaryKey": false,
3816
+ "notNull": true
3817
+ },
3818
+ "status_changed_by": {
3819
+ "name": "status_changed_by",
3820
+ "type": "text",
3821
+ "primaryKey": false,
3822
+ "notNull": true
3823
+ },
3824
+ "access_seq": {
3825
+ "name": "access_seq",
3826
+ "type": "bigint",
3827
+ "primaryKey": false,
3828
+ "notNull": true
3829
+ },
3830
+ "mac": {
3831
+ "name": "mac",
3832
+ "type": "bytea",
3833
+ "primaryKey": false,
3834
+ "notNull": true
3835
+ },
3836
+ "seal": {
3837
+ "name": "seal",
3838
+ "type": "bytea",
3839
+ "primaryKey": false,
3840
+ "notNull": false
3841
+ }
3842
+ },
3843
+ "indexes": {},
3844
+ "foreignKeys": {},
3845
+ "compositePrimaryKeys": {},
3846
+ "uniqueConstraints": {},
3847
+ "policies": {},
3848
+ "checkConstraints": {
3849
+ "vault_members_seal_check": {
3850
+ "name": "vault_members_seal_check",
3851
+ "value": "\"vault_members\".\"seal\" IS NULL OR octet_length(\"vault_members\".\"seal\") = 16"
3852
+ },
3853
+ "vault_members_mac_check": {
3854
+ "name": "vault_members_mac_check",
3855
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
3856
+ },
3857
+ "vault_members_principal_check": {
3858
+ "name": "vault_members_principal_check",
3859
+ "value": "\"vault_members\".\"principal\" ~ '^(user|token):[^[:space:]:][^[:space:]]*$'"
3860
+ },
3861
+ "vault_members_user_lowercase": {
3862
+ "name": "vault_members_user_lowercase",
3863
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
3864
+ },
3865
+ "vault_members_status_check": {
3866
+ "name": "vault_members_status_check",
3867
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
3868
+ },
3869
+ "vault_members_owner_check": {
3870
+ "name": "vault_members_owner_check",
3871
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
3872
+ },
3873
+ "vault_members_generation_check": {
3874
+ "name": "vault_members_generation_check",
3875
+ "value": "\"vault_members\".\"generation\" >= 0"
3876
+ }
3877
+ },
3878
+ "isRLSEnabled": false
3879
+ },
3880
+ "public.vault_releases": {
3881
+ "name": "vault_releases",
3882
+ "schema": "",
3883
+ "columns": {
3884
+ "principal": {
3885
+ "name": "principal",
3886
+ "type": "text",
3887
+ "primaryKey": false,
3888
+ "notNull": true
3889
+ },
3890
+ "key": {
3891
+ "name": "key",
3892
+ "type": "text",
3893
+ "primaryKey": false,
3894
+ "notNull": true
3895
+ },
3896
+ "released_at": {
3897
+ "name": "released_at",
3898
+ "type": "bigint",
3899
+ "primaryKey": false,
3900
+ "notNull": true
3901
+ }
3902
+ },
3903
+ "indexes": {},
3904
+ "foreignKeys": {},
3905
+ "compositePrimaryKeys": {
3906
+ "vault_releases_pkey": {
3907
+ "name": "vault_releases_pkey",
3908
+ "columns": [
3909
+ "principal",
3910
+ "key"
3911
+ ]
3912
+ }
3913
+ },
3914
+ "uniqueConstraints": {},
3915
+ "policies": {},
3916
+ "checkConstraints": {},
3917
+ "isRLSEnabled": false
3918
+ }
3919
+ },
3920
+ "enums": {},
3921
+ "schemas": {},
3922
+ "sequences": {},
3923
+ "roles": {},
3924
+ "policies": {},
3925
+ "views": {},
3926
+ "_meta": {
3927
+ "columns": {},
3928
+ "schemas": {},
3929
+ "tables": {}
3930
+ }
3931
+ }