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