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