@coffre/db 0.14.4 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +2 -1
  2. package/dist/change-records-_fKvahvs.js +55 -0
  3. package/dist/connect.d.ts +22 -10
  4. package/dist/connect.js +74 -12
  5. package/dist/database-CVteLhp1.d.ts +410 -0
  6. package/dist/{database-BadNeeN-.js → database-D55ENPX-.js} +46 -25
  7. package/dist/dialect.d.ts +4 -3
  8. package/dist/dialect.js +14 -5
  9. package/dist/grants.d.ts +4 -4
  10. package/dist/grants.js +4 -4
  11. package/dist/hyperdrive.d.ts +48 -23
  12. package/dist/hyperdrive.js +168 -91
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +1 -1
  15. package/dist/log-DaD7fyUq.d.ts +722 -0
  16. package/dist/log.d.ts +2 -596
  17. package/dist/log.js +224 -10
  18. package/dist/migrate.d.ts +43 -3
  19. package/dist/migrate.js +149 -29
  20. package/dist/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  21. package/dist/migrations/postgres/0022_log_015.sql +672 -0
  22. package/dist/migrations/postgres/0023_change_path.sql +153 -0
  23. package/dist/migrations/postgres/0024_use_015.sql +556 -0
  24. package/dist/migrations/postgres/0025_app_change.sql +221 -0
  25. package/dist/migrations/postgres/0026_issue_lock.sql +106 -0
  26. package/dist/migrations/postgres/0027_retention.sql +118 -0
  27. package/dist/migrations/postgres/0028_use_stalls.sql +594 -0
  28. package/dist/migrations/postgres/0029_use_objects.sql +887 -0
  29. package/dist/migrations/postgres/0030_unarchive_restores.sql +259 -0
  30. package/dist/migrations/postgres/0031_app_read.sql +65 -0
  31. package/dist/migrations/postgres/0032_secrets_live_index.sql +4 -0
  32. package/dist/migrations/postgres/0033_use_generations.sql +582 -0
  33. package/dist/migrations/postgres/0034_vault_credentials.sql +153 -0
  34. package/dist/migrations/postgres/0035_first_days.sql +3 -0
  35. package/dist/migrations/postgres/0036_vault_issues.sql +91 -0
  36. package/dist/migrations/postgres/0037_vault_bindings.sql +271 -0
  37. package/dist/migrations/postgres/0040_binding_origin.sql +159 -0
  38. package/dist/migrations/postgres/0041_cutover.sql +132 -0
  39. package/dist/migrations/postgres/0042_sign_in_index.sql +7 -0
  40. package/dist/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  41. package/dist/migrations/postgres/0044_use_by_name.sql +705 -0
  42. package/dist/migrations/postgres/0045_decide_first.sql +878 -0
  43. package/dist/migrations/postgres/0046_way_in_uses.sql +1149 -0
  44. package/dist/migrations/postgres/0047_cutover_finish.sql +268 -0
  45. package/dist/migrations/postgres/0048_use_batch.sql +59 -0
  46. package/dist/migrations/postgres/0049_reads.sql +171 -0
  47. package/dist/migrations/postgres/meta/0021_snapshot.json +3334 -0
  48. package/dist/migrations/postgres/meta/0022_snapshot.json +3831 -0
  49. package/dist/migrations/postgres/meta/0023_snapshot.json +3831 -0
  50. package/dist/migrations/postgres/meta/0024_snapshot.json +3831 -0
  51. package/dist/migrations/postgres/meta/0025_snapshot.json +3831 -0
  52. package/dist/migrations/postgres/meta/0026_snapshot.json +3831 -0
  53. package/dist/migrations/postgres/meta/0027_snapshot.json +3853 -0
  54. package/dist/migrations/postgres/meta/0028_snapshot.json +3853 -0
  55. package/dist/migrations/postgres/meta/0029_snapshot.json +3859 -0
  56. package/dist/migrations/postgres/meta/0030_snapshot.json +3859 -0
  57. package/dist/migrations/postgres/meta/0031_snapshot.json +3859 -0
  58. package/dist/migrations/postgres/meta/0032_snapshot.json +3875 -0
  59. package/dist/migrations/postgres/meta/0033_snapshot.json +3875 -0
  60. package/dist/migrations/postgres/meta/0034_snapshot.json +3875 -0
  61. package/dist/migrations/postgres/meta/0035_snapshot.json +3875 -0
  62. package/dist/migrations/postgres/meta/0036_snapshot.json +3875 -0
  63. package/dist/migrations/postgres/meta/0037_snapshot.json +3875 -0
  64. package/dist/migrations/postgres/meta/0038_snapshot.json +3881 -0
  65. package/dist/migrations/postgres/meta/0039_snapshot.json +3881 -0
  66. package/dist/migrations/postgres/meta/0040_snapshot.json +3931 -0
  67. package/dist/migrations/postgres/meta/0041_snapshot.json +3981 -0
  68. package/dist/migrations/postgres/meta/0042_snapshot.json +3981 -0
  69. package/dist/migrations/postgres/meta/0043_snapshot.json +3981 -0
  70. package/dist/migrations/postgres/meta/0044_snapshot.json +3991 -0
  71. package/dist/migrations/postgres/meta/0045_snapshot.json +3997 -0
  72. package/dist/migrations/postgres/meta/0046_snapshot.json +3997 -0
  73. package/dist/migrations/postgres/meta/0047_snapshot.json +4234 -0
  74. package/dist/migrations/postgres/meta/_journal.json +189 -0
  75. package/dist/migrations/sqlite/0018_log_015.sql +84 -0
  76. package/dist/migrations/sqlite/0019_retention.sql +2 -0
  77. package/dist/migrations/sqlite/0020_ended_references.sql +1 -0
  78. package/dist/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  79. package/dist/migrations/sqlite/0022_binding_origin.sql +1 -0
  80. package/dist/migrations/sqlite/0023_sign_in_index.sql +2 -0
  81. package/dist/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  82. package/dist/migrations/sqlite/0025_way_in_uses.sql +42 -0
  83. package/dist/migrations/sqlite/0026_cutover_finish.sql +11 -0
  84. package/dist/migrations/sqlite/0027_reads.sql +38 -0
  85. package/dist/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  86. package/dist/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  87. package/dist/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  88. package/dist/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  89. package/dist/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  90. package/dist/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  91. package/dist/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  92. package/dist/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  93. package/dist/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  94. package/dist/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  95. package/dist/migrations/sqlite/meta/_journal.json +70 -0
  96. package/dist/platform-Y3gICK6n.d.ts +58 -0
  97. package/dist/portable.d.ts +2 -2
  98. package/dist/postgres-BI3xTnyw.js +1718 -0
  99. package/dist/postgres-platform-node.d.ts +14 -0
  100. package/dist/postgres-platform-node.js +21 -0
  101. package/dist/postgres-platform-workerd.d.ts +61 -0
  102. package/dist/postgres-platform-workerd.js +163 -0
  103. package/dist/{schema-z8GcN_Xu.d.ts → schema-DgoPqqsI.d.ts} +1329 -9
  104. package/dist/schema-sqlite.d.ts +1308 -8
  105. package/dist/schema-sqlite.js +156 -20
  106. package/dist/schema-version.d.ts +1 -1
  107. package/dist/schema-version.js +261 -2
  108. package/dist/schema.d.ts +2 -2
  109. package/dist/schema.js +229 -22
  110. package/package.json +13 -5
  111. package/src/active-subject.ts +9 -0
  112. package/src/change-records.ts +38 -0
  113. package/src/connect.ts +67 -13
  114. package/src/database.ts +67 -51
  115. package/src/dialect.ts +17 -8
  116. package/src/grants.ts +3 -3
  117. package/src/hyperdrive.ts +181 -104
  118. package/src/log.ts +244 -11
  119. package/src/migrate.ts +157 -30
  120. package/src/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  121. package/src/migrations/postgres/0022_log_015.sql +672 -0
  122. package/src/migrations/postgres/0023_change_path.sql +153 -0
  123. package/src/migrations/postgres/0024_use_015.sql +556 -0
  124. package/src/migrations/postgres/0025_app_change.sql +221 -0
  125. package/src/migrations/postgres/0026_issue_lock.sql +106 -0
  126. package/src/migrations/postgres/0027_retention.sql +118 -0
  127. package/src/migrations/postgres/0028_use_stalls.sql +594 -0
  128. package/src/migrations/postgres/0029_use_objects.sql +887 -0
  129. package/src/migrations/postgres/0030_unarchive_restores.sql +259 -0
  130. package/src/migrations/postgres/0031_app_read.sql +65 -0
  131. package/src/migrations/postgres/0032_secrets_live_index.sql +4 -0
  132. package/src/migrations/postgres/0033_use_generations.sql +582 -0
  133. package/src/migrations/postgres/0034_vault_credentials.sql +153 -0
  134. package/src/migrations/postgres/0035_first_days.sql +3 -0
  135. package/src/migrations/postgres/0036_vault_issues.sql +91 -0
  136. package/src/migrations/postgres/0037_vault_bindings.sql +271 -0
  137. package/src/migrations/postgres/0040_binding_origin.sql +159 -0
  138. package/src/migrations/postgres/0041_cutover.sql +132 -0
  139. package/src/migrations/postgres/0042_sign_in_index.sql +7 -0
  140. package/src/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  141. package/src/migrations/postgres/0044_use_by_name.sql +705 -0
  142. package/src/migrations/postgres/0045_decide_first.sql +878 -0
  143. package/src/migrations/postgres/0046_way_in_uses.sql +1149 -0
  144. package/src/migrations/postgres/0047_cutover_finish.sql +268 -0
  145. package/src/migrations/postgres/0048_use_batch.sql +59 -0
  146. package/src/migrations/postgres/0049_reads.sql +171 -0
  147. package/src/migrations/postgres/meta/0021_snapshot.json +3334 -0
  148. package/src/migrations/postgres/meta/0022_snapshot.json +3831 -0
  149. package/src/migrations/postgres/meta/0023_snapshot.json +3831 -0
  150. package/src/migrations/postgres/meta/0024_snapshot.json +3831 -0
  151. package/src/migrations/postgres/meta/0025_snapshot.json +3831 -0
  152. package/src/migrations/postgres/meta/0026_snapshot.json +3831 -0
  153. package/src/migrations/postgres/meta/0027_snapshot.json +3853 -0
  154. package/src/migrations/postgres/meta/0028_snapshot.json +3853 -0
  155. package/src/migrations/postgres/meta/0029_snapshot.json +3859 -0
  156. package/src/migrations/postgres/meta/0030_snapshot.json +3859 -0
  157. package/src/migrations/postgres/meta/0031_snapshot.json +3859 -0
  158. package/src/migrations/postgres/meta/0032_snapshot.json +3875 -0
  159. package/src/migrations/postgres/meta/0033_snapshot.json +3875 -0
  160. package/src/migrations/postgres/meta/0034_snapshot.json +3875 -0
  161. package/src/migrations/postgres/meta/0035_snapshot.json +3875 -0
  162. package/src/migrations/postgres/meta/0036_snapshot.json +3875 -0
  163. package/src/migrations/postgres/meta/0037_snapshot.json +3875 -0
  164. package/src/migrations/postgres/meta/0038_snapshot.json +3881 -0
  165. package/src/migrations/postgres/meta/0039_snapshot.json +3881 -0
  166. package/src/migrations/postgres/meta/0040_snapshot.json +3931 -0
  167. package/src/migrations/postgres/meta/0041_snapshot.json +3981 -0
  168. package/src/migrations/postgres/meta/0042_snapshot.json +3981 -0
  169. package/src/migrations/postgres/meta/0043_snapshot.json +3981 -0
  170. package/src/migrations/postgres/meta/0044_snapshot.json +3991 -0
  171. package/src/migrations/postgres/meta/0045_snapshot.json +3997 -0
  172. package/src/migrations/postgres/meta/0046_snapshot.json +3997 -0
  173. package/src/migrations/postgres/meta/0047_snapshot.json +4234 -0
  174. package/src/migrations/postgres/meta/_journal.json +189 -0
  175. package/src/migrations/sqlite/0018_log_015.sql +84 -0
  176. package/src/migrations/sqlite/0019_retention.sql +2 -0
  177. package/src/migrations/sqlite/0020_ended_references.sql +1 -0
  178. package/src/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  179. package/src/migrations/sqlite/0022_binding_origin.sql +1 -0
  180. package/src/migrations/sqlite/0023_sign_in_index.sql +2 -0
  181. package/src/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  182. package/src/migrations/sqlite/0025_way_in_uses.sql +42 -0
  183. package/src/migrations/sqlite/0026_cutover_finish.sql +11 -0
  184. package/src/migrations/sqlite/0027_reads.sql +38 -0
  185. package/src/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  186. package/src/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  187. package/src/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  188. package/src/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  189. package/src/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  190. package/src/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  191. package/src/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  192. package/src/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  193. package/src/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  194. package/src/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  195. package/src/migrations/sqlite/meta/_journal.json +70 -0
  196. package/src/postgres-js/README.md +183 -0
  197. package/src/postgres-js/UNLICENSE +24 -0
  198. package/src/postgres-js/bytes.ts +89 -0
  199. package/src/postgres-js/connection.ts +882 -0
  200. package/src/postgres-js/errors.ts +84 -0
  201. package/src/postgres-js/index.ts +516 -0
  202. package/src/postgres-js/platform.node.ts +29 -0
  203. package/src/postgres-js/platform.ts +60 -0
  204. package/src/postgres-js/platform.workerd.ts +225 -0
  205. package/src/postgres-js/query.ts +123 -0
  206. package/src/postgres-js/queue.ts +42 -0
  207. package/src/postgres-js/result.ts +46 -0
  208. package/src/postgres-js/types.ts +52 -0
  209. package/src/postgres.ts +375 -26
  210. package/src/schema-version.ts +2 -2
  211. package/src/schema.sqlite.ts +200 -9
  212. package/src/schema.ts +294 -8
  213. package/src/verify-runtime.ts +18 -29
  214. package/LICENSE +0 -21
  215. package/dist/database-CFhTnnzM.d.ts +0 -73
  216. package/dist/postgres-Bmar8y0q.js +0 -29
  217. package/dist/relations-BfR3JjT1.js +0 -38
  218. package/src/relations.ts +0 -40
@@ -0,0 +1,3538 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "d0bf125e-7dbb-4e57-bc60-11ffbebf2fe4",
5
+ "prevId": "14afe218-058f-4b29-85c1-c0685ec425ef",
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
+ "log_checkpoints_floor_idx": {
1705
+ "name": "log_checkpoints_floor_idx",
1706
+ "columns": [
1707
+ "at_floor",
1708
+ "upto"
1709
+ ],
1710
+ "isUnique": false
1711
+ }
1712
+ },
1713
+ "foreignKeys": {},
1714
+ "compositePrimaryKeys": {},
1715
+ "uniqueConstraints": {},
1716
+ "checkConstraints": {
1717
+ "log_checkpoints_changes_root_check": {
1718
+ "name": "log_checkpoints_changes_root_check",
1719
+ "value": "octet_length(\"log_checkpoints\".\"changes_root\") = 32"
1720
+ },
1721
+ "log_checkpoints_uses_root_check": {
1722
+ "name": "log_checkpoints_uses_root_check",
1723
+ "value": "octet_length(\"log_checkpoints\".\"uses_root\") = 32"
1724
+ }
1725
+ }
1726
+ },
1727
+ "log_fence": {
1728
+ "name": "log_fence",
1729
+ "columns": {
1730
+ "only_row": {
1731
+ "name": "only_row",
1732
+ "type": "integer",
1733
+ "primaryKey": true,
1734
+ "notNull": true,
1735
+ "autoincrement": false,
1736
+ "default": true
1737
+ },
1738
+ "at_floor": {
1739
+ "name": "at_floor",
1740
+ "type": "integer",
1741
+ "primaryKey": false,
1742
+ "notNull": true,
1743
+ "autoincrement": false
1744
+ }
1745
+ },
1746
+ "indexes": {},
1747
+ "foreignKeys": {},
1748
+ "compositePrimaryKeys": {},
1749
+ "uniqueConstraints": {},
1750
+ "checkConstraints": {
1751
+ "log_fence_only_row_check": {
1752
+ "name": "log_fence_only_row_check",
1753
+ "value": "\"log_fence\".\"only_row\""
1754
+ }
1755
+ }
1756
+ },
1757
+ "log_tiles": {
1758
+ "name": "log_tiles",
1759
+ "columns": {
1760
+ "tree": {
1761
+ "name": "tree",
1762
+ "type": "text",
1763
+ "primaryKey": false,
1764
+ "notNull": true,
1765
+ "autoincrement": false
1766
+ },
1767
+ "level": {
1768
+ "name": "level",
1769
+ "type": "integer",
1770
+ "primaryKey": false,
1771
+ "notNull": true,
1772
+ "autoincrement": false
1773
+ },
1774
+ "leaf": {
1775
+ "name": "leaf",
1776
+ "type": "integer",
1777
+ "primaryKey": false,
1778
+ "notNull": true,
1779
+ "autoincrement": false
1780
+ },
1781
+ "hashes": {
1782
+ "name": "hashes",
1783
+ "type": "blob",
1784
+ "primaryKey": false,
1785
+ "notNull": true,
1786
+ "autoincrement": false
1787
+ }
1788
+ },
1789
+ "indexes": {},
1790
+ "foreignKeys": {},
1791
+ "compositePrimaryKeys": {
1792
+ "log_tiles_pkey": {
1793
+ "columns": [
1794
+ "tree",
1795
+ "level",
1796
+ "leaf"
1797
+ ],
1798
+ "name": "log_tiles_pkey"
1799
+ }
1800
+ },
1801
+ "uniqueConstraints": {},
1802
+ "checkConstraints": {
1803
+ "log_tiles_tree_check": {
1804
+ "name": "log_tiles_tree_check",
1805
+ "value": "\"log_tiles\".\"tree\" IN ('changes', 'uses')"
1806
+ },
1807
+ "log_tiles_level_check": {
1808
+ "name": "log_tiles_level_check",
1809
+ "value": "\"log_tiles\".\"level\" BETWEEN 0 AND 7"
1810
+ },
1811
+ "log_tiles_leaf_check": {
1812
+ "name": "log_tiles_leaf_check",
1813
+ "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))"
1814
+ },
1815
+ "log_tiles_hashes_check": {
1816
+ "name": "log_tiles_hashes_check",
1817
+ "value": "octet_length(\"log_tiles\".\"hashes\") BETWEEN 32 AND 8192 AND octet_length(\"log_tiles\".\"hashes\") % 32 = 0"
1818
+ }
1819
+ }
1820
+ },
1821
+ "log_uses": {
1822
+ "name": "log_uses",
1823
+ "columns": {
1824
+ "number": {
1825
+ "name": "number",
1826
+ "type": "integer",
1827
+ "primaryKey": false,
1828
+ "notNull": true,
1829
+ "autoincrement": false
1830
+ },
1831
+ "at": {
1832
+ "name": "at",
1833
+ "type": "integer",
1834
+ "primaryKey": false,
1835
+ "notNull": true,
1836
+ "autoincrement": false
1837
+ },
1838
+ "request_id": {
1839
+ "name": "request_id",
1840
+ "type": "integer",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "autoincrement": false
1844
+ },
1845
+ "credential": {
1846
+ "name": "credential",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": true,
1850
+ "autoincrement": false
1851
+ },
1852
+ "secret": {
1853
+ "name": "secret",
1854
+ "type": "text",
1855
+ "primaryKey": false,
1856
+ "notNull": true,
1857
+ "autoincrement": false
1858
+ },
1859
+ "purpose": {
1860
+ "name": "purpose",
1861
+ "type": "integer",
1862
+ "primaryKey": false,
1863
+ "notNull": true,
1864
+ "autoincrement": false
1865
+ },
1866
+ "mac": {
1867
+ "name": "mac",
1868
+ "type": "blob",
1869
+ "primaryKey": false,
1870
+ "notNull": true,
1871
+ "autoincrement": false
1872
+ },
1873
+ "place": {
1874
+ "name": "place",
1875
+ "type": "text",
1876
+ "primaryKey": false,
1877
+ "notNull": false,
1878
+ "autoincrement": false
1879
+ }
1880
+ },
1881
+ "indexes": {
1882
+ "log_uses_request_idx": {
1883
+ "name": "log_uses_request_idx",
1884
+ "columns": [
1885
+ "at",
1886
+ "request_id"
1887
+ ],
1888
+ "isUnique": true
1889
+ }
1890
+ },
1891
+ "foreignKeys": {},
1892
+ "compositePrimaryKeys": {},
1893
+ "uniqueConstraints": {},
1894
+ "checkConstraints": {
1895
+ "log_uses_mac_check": {
1896
+ "name": "log_uses_mac_check",
1897
+ "value": "octet_length(\"log_uses\".\"mac\") = 16"
1898
+ }
1899
+ }
1900
+ },
1901
+ "mcp_approvals": {
1902
+ "name": "mcp_approvals",
1903
+ "columns": {
1904
+ "id": {
1905
+ "name": "id",
1906
+ "type": "text",
1907
+ "primaryKey": true,
1908
+ "notNull": true,
1909
+ "autoincrement": false
1910
+ },
1911
+ "connection_id": {
1912
+ "name": "connection_id",
1913
+ "type": "text",
1914
+ "primaryKey": false,
1915
+ "notNull": true,
1916
+ "autoincrement": false
1917
+ },
1918
+ "tool": {
1919
+ "name": "tool",
1920
+ "type": "text",
1921
+ "primaryKey": false,
1922
+ "notNull": true,
1923
+ "autoincrement": false
1924
+ },
1925
+ "arguments": {
1926
+ "name": "arguments",
1927
+ "type": "text",
1928
+ "primaryKey": false,
1929
+ "notNull": true,
1930
+ "autoincrement": false
1931
+ },
1932
+ "digest": {
1933
+ "name": "digest",
1934
+ "type": "blob",
1935
+ "primaryKey": false,
1936
+ "notNull": true,
1937
+ "autoincrement": false
1938
+ },
1939
+ "status": {
1940
+ "name": "status",
1941
+ "type": "text",
1942
+ "primaryKey": false,
1943
+ "notNull": true,
1944
+ "autoincrement": false,
1945
+ "default": "'pending'"
1946
+ },
1947
+ "outcome": {
1948
+ "name": "outcome",
1949
+ "type": "text",
1950
+ "primaryKey": false,
1951
+ "notNull": false,
1952
+ "autoincrement": false
1953
+ },
1954
+ "created_at": {
1955
+ "name": "created_at",
1956
+ "type": "integer",
1957
+ "primaryKey": false,
1958
+ "notNull": true,
1959
+ "autoincrement": false,
1960
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1961
+ },
1962
+ "expires_at": {
1963
+ "name": "expires_at",
1964
+ "type": "integer",
1965
+ "primaryKey": false,
1966
+ "notNull": true,
1967
+ "autoincrement": false
1968
+ },
1969
+ "decided_at": {
1970
+ "name": "decided_at",
1971
+ "type": "integer",
1972
+ "primaryKey": false,
1973
+ "notNull": false,
1974
+ "autoincrement": false
1975
+ },
1976
+ "reported_at": {
1977
+ "name": "reported_at",
1978
+ "type": "integer",
1979
+ "primaryKey": false,
1980
+ "notNull": false,
1981
+ "autoincrement": false
1982
+ }
1983
+ },
1984
+ "indexes": {
1985
+ "mcp_approvals_open_idx": {
1986
+ "name": "mcp_approvals_open_idx",
1987
+ "columns": [
1988
+ "connection_id",
1989
+ "digest"
1990
+ ],
1991
+ "isUnique": false,
1992
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL"
1993
+ }
1994
+ },
1995
+ "foreignKeys": {
1996
+ "mcp_approvals_connection_fkey": {
1997
+ "name": "mcp_approvals_connection_fkey",
1998
+ "tableFrom": "mcp_approvals",
1999
+ "tableTo": "mcp_connections",
2000
+ "columnsFrom": [
2001
+ "connection_id"
2002
+ ],
2003
+ "columnsTo": [
2004
+ "id"
2005
+ ],
2006
+ "onDelete": "restrict",
2007
+ "onUpdate": "no action"
2008
+ }
2009
+ },
2010
+ "compositePrimaryKeys": {},
2011
+ "uniqueConstraints": {},
2012
+ "checkConstraints": {
2013
+ "mcp_approvals_status_check": {
2014
+ "name": "mcp_approvals_status_check",
2015
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
2016
+ },
2017
+ "mcp_approvals_digest_check": {
2018
+ "name": "mcp_approvals_digest_check",
2019
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
2020
+ },
2021
+ "mcp_approvals_arguments_check": {
2022
+ "name": "mcp_approvals_arguments_check",
2023
+ "value": "json_valid(\"mcp_approvals\".\"arguments\")"
2024
+ }
2025
+ }
2026
+ },
2027
+ "mcp_connections": {
2028
+ "name": "mcp_connections",
2029
+ "columns": {
2030
+ "id": {
2031
+ "name": "id",
2032
+ "type": "text",
2033
+ "primaryKey": true,
2034
+ "notNull": true,
2035
+ "autoincrement": false
2036
+ },
2037
+ "auth_mac": {
2038
+ "name": "auth_mac",
2039
+ "type": "blob",
2040
+ "primaryKey": false,
2041
+ "notNull": true,
2042
+ "autoincrement": false
2043
+ },
2044
+ "principal": {
2045
+ "name": "principal",
2046
+ "type": "text",
2047
+ "primaryKey": false,
2048
+ "notNull": true,
2049
+ "autoincrement": false
2050
+ },
2051
+ "generation": {
2052
+ "name": "generation",
2053
+ "type": "integer",
2054
+ "primaryKey": false,
2055
+ "notNull": true,
2056
+ "autoincrement": false
2057
+ },
2058
+ "client_id": {
2059
+ "name": "client_id",
2060
+ "type": "text",
2061
+ "primaryKey": false,
2062
+ "notNull": true,
2063
+ "autoincrement": false
2064
+ },
2065
+ "client_name": {
2066
+ "name": "client_name",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": true,
2070
+ "autoincrement": false
2071
+ },
2072
+ "client_host": {
2073
+ "name": "client_host",
2074
+ "type": "text",
2075
+ "primaryKey": false,
2076
+ "notNull": false,
2077
+ "autoincrement": false
2078
+ },
2079
+ "registration": {
2080
+ "name": "registration",
2081
+ "type": "text",
2082
+ "primaryKey": false,
2083
+ "notNull": true,
2084
+ "autoincrement": false
2085
+ },
2086
+ "scopes": {
2087
+ "name": "scopes",
2088
+ "type": "text",
2089
+ "primaryKey": false,
2090
+ "notNull": true,
2091
+ "autoincrement": false
2092
+ },
2093
+ "redirect_uri": {
2094
+ "name": "redirect_uri",
2095
+ "type": "text",
2096
+ "primaryKey": false,
2097
+ "notNull": true,
2098
+ "autoincrement": false
2099
+ },
2100
+ "code_hash": {
2101
+ "name": "code_hash",
2102
+ "type": "blob",
2103
+ "primaryKey": false,
2104
+ "notNull": false,
2105
+ "autoincrement": false
2106
+ },
2107
+ "code_challenge": {
2108
+ "name": "code_challenge",
2109
+ "type": "text",
2110
+ "primaryKey": false,
2111
+ "notNull": false,
2112
+ "autoincrement": false
2113
+ },
2114
+ "code_expires_at": {
2115
+ "name": "code_expires_at",
2116
+ "type": "integer",
2117
+ "primaryKey": false,
2118
+ "notNull": false,
2119
+ "autoincrement": false
2120
+ },
2121
+ "refresh_hash": {
2122
+ "name": "refresh_hash",
2123
+ "type": "blob",
2124
+ "primaryKey": false,
2125
+ "notNull": false,
2126
+ "autoincrement": false
2127
+ },
2128
+ "refresh_previous_hash": {
2129
+ "name": "refresh_previous_hash",
2130
+ "type": "blob",
2131
+ "primaryKey": false,
2132
+ "notNull": false,
2133
+ "autoincrement": false
2134
+ },
2135
+ "expires_at": {
2136
+ "name": "expires_at",
2137
+ "type": "integer",
2138
+ "primaryKey": false,
2139
+ "notNull": true,
2140
+ "autoincrement": false
2141
+ },
2142
+ "created_at": {
2143
+ "name": "created_at",
2144
+ "type": "integer",
2145
+ "primaryKey": false,
2146
+ "notNull": true,
2147
+ "autoincrement": false,
2148
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2149
+ },
2150
+ "last_used_at": {
2151
+ "name": "last_used_at",
2152
+ "type": "integer",
2153
+ "primaryKey": false,
2154
+ "notNull": false,
2155
+ "autoincrement": false
2156
+ },
2157
+ "last_used_ip": {
2158
+ "name": "last_used_ip",
2159
+ "type": "text",
2160
+ "primaryKey": false,
2161
+ "notNull": false,
2162
+ "autoincrement": false
2163
+ },
2164
+ "revoked_at": {
2165
+ "name": "revoked_at",
2166
+ "type": "integer",
2167
+ "primaryKey": false,
2168
+ "notNull": false,
2169
+ "autoincrement": false
2170
+ },
2171
+ "revoked_by": {
2172
+ "name": "revoked_by",
2173
+ "type": "text",
2174
+ "primaryKey": false,
2175
+ "notNull": false,
2176
+ "autoincrement": false
2177
+ }
2178
+ },
2179
+ "indexes": {
2180
+ "mcp_connections_refresh_previous_idx": {
2181
+ "name": "mcp_connections_refresh_previous_idx",
2182
+ "columns": [
2183
+ "refresh_previous_hash"
2184
+ ],
2185
+ "isUnique": false
2186
+ },
2187
+ "mcp_connections_live_idx": {
2188
+ "name": "mcp_connections_live_idx",
2189
+ "columns": [
2190
+ "principal",
2191
+ "expires_at"
2192
+ ],
2193
+ "isUnique": false,
2194
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL"
2195
+ },
2196
+ "mcp_connections_code_hash_key": {
2197
+ "name": "mcp_connections_code_hash_key",
2198
+ "columns": [
2199
+ "code_hash"
2200
+ ],
2201
+ "isUnique": true
2202
+ },
2203
+ "mcp_connections_refresh_hash_key": {
2204
+ "name": "mcp_connections_refresh_hash_key",
2205
+ "columns": [
2206
+ "refresh_hash"
2207
+ ],
2208
+ "isUnique": true
2209
+ }
2210
+ },
2211
+ "foreignKeys": {
2212
+ "mcp_connections_principal_fkey": {
2213
+ "name": "mcp_connections_principal_fkey",
2214
+ "tableFrom": "mcp_connections",
2215
+ "tableTo": "vault_members",
2216
+ "columnsFrom": [
2217
+ "principal"
2218
+ ],
2219
+ "columnsTo": [
2220
+ "principal"
2221
+ ],
2222
+ "onDelete": "restrict",
2223
+ "onUpdate": "no action"
2224
+ }
2225
+ },
2226
+ "compositePrimaryKeys": {},
2227
+ "uniqueConstraints": {},
2228
+ "checkConstraints": {
2229
+ "mcp_connections_principal_check": {
2230
+ "name": "mcp_connections_principal_check",
2231
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
2232
+ },
2233
+ "mcp_connections_registration_check": {
2234
+ "name": "mcp_connections_registration_check",
2235
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
2236
+ },
2237
+ "mcp_connections_auth_mac_check": {
2238
+ "name": "mcp_connections_auth_mac_check",
2239
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
2240
+ },
2241
+ "mcp_connections_code_hash_check": {
2242
+ "name": "mcp_connections_code_hash_check",
2243
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
2244
+ },
2245
+ "mcp_connections_refresh_hash_check": {
2246
+ "name": "mcp_connections_refresh_hash_check",
2247
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
2248
+ }
2249
+ }
2250
+ },
2251
+ "oauth_clients": {
2252
+ "name": "oauth_clients",
2253
+ "columns": {
2254
+ "id": {
2255
+ "name": "id",
2256
+ "type": "text",
2257
+ "primaryKey": true,
2258
+ "notNull": true,
2259
+ "autoincrement": false
2260
+ },
2261
+ "auth_mac": {
2262
+ "name": "auth_mac",
2263
+ "type": "blob",
2264
+ "primaryKey": false,
2265
+ "notNull": true,
2266
+ "autoincrement": false
2267
+ },
2268
+ "name": {
2269
+ "name": "name",
2270
+ "type": "text",
2271
+ "primaryKey": false,
2272
+ "notNull": true,
2273
+ "autoincrement": false
2274
+ },
2275
+ "redirect_uris": {
2276
+ "name": "redirect_uris",
2277
+ "type": "text",
2278
+ "primaryKey": false,
2279
+ "notNull": true,
2280
+ "autoincrement": false
2281
+ },
2282
+ "created_at": {
2283
+ "name": "created_at",
2284
+ "type": "integer",
2285
+ "primaryKey": false,
2286
+ "notNull": true,
2287
+ "autoincrement": false,
2288
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2289
+ },
2290
+ "created_ip": {
2291
+ "name": "created_ip",
2292
+ "type": "text",
2293
+ "primaryKey": false,
2294
+ "notNull": false,
2295
+ "autoincrement": false
2296
+ },
2297
+ "revoked_at": {
2298
+ "name": "revoked_at",
2299
+ "type": "integer",
2300
+ "primaryKey": false,
2301
+ "notNull": false,
2302
+ "autoincrement": false
2303
+ }
2304
+ },
2305
+ "indexes": {},
2306
+ "foreignKeys": {},
2307
+ "compositePrimaryKeys": {},
2308
+ "uniqueConstraints": {},
2309
+ "checkConstraints": {
2310
+ "oauth_clients_auth_mac_check": {
2311
+ "name": "oauth_clients_auth_mac_check",
2312
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
2313
+ },
2314
+ "oauth_clients_redirect_uris_check": {
2315
+ "name": "oauth_clients_redirect_uris_check",
2316
+ "value": "json_valid(\"oauth_clients\".\"redirect_uris\")"
2317
+ }
2318
+ }
2319
+ },
2320
+ "projects": {
2321
+ "name": "projects",
2322
+ "columns": {
2323
+ "id": {
2324
+ "name": "id",
2325
+ "type": "text",
2326
+ "primaryKey": true,
2327
+ "notNull": true,
2328
+ "autoincrement": false
2329
+ },
2330
+ "slug": {
2331
+ "name": "slug",
2332
+ "type": "text",
2333
+ "primaryKey": false,
2334
+ "notNull": true,
2335
+ "autoincrement": false
2336
+ },
2337
+ "name": {
2338
+ "name": "name",
2339
+ "type": "text",
2340
+ "primaryKey": false,
2341
+ "notNull": true,
2342
+ "autoincrement": false
2343
+ },
2344
+ "created_at": {
2345
+ "name": "created_at",
2346
+ "type": "integer",
2347
+ "primaryKey": false,
2348
+ "notNull": true,
2349
+ "autoincrement": false,
2350
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2351
+ },
2352
+ "archived_at": {
2353
+ "name": "archived_at",
2354
+ "type": "integer",
2355
+ "primaryKey": false,
2356
+ "notNull": false,
2357
+ "autoincrement": false
2358
+ },
2359
+ "folder": {
2360
+ "name": "folder",
2361
+ "type": "text",
2362
+ "primaryKey": false,
2363
+ "notNull": false,
2364
+ "autoincrement": false
2365
+ }
2366
+ },
2367
+ "indexes": {
2368
+ "projects_slug_key": {
2369
+ "name": "projects_slug_key",
2370
+ "columns": [
2371
+ "slug"
2372
+ ],
2373
+ "isUnique": true
2374
+ }
2375
+ },
2376
+ "foreignKeys": {},
2377
+ "compositePrimaryKeys": {},
2378
+ "uniqueConstraints": {},
2379
+ "checkConstraints": {
2380
+ "projects_slug_check": {
2381
+ "name": "projects_slug_check",
2382
+ "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-]*')"
2383
+ },
2384
+ "projects_folder_check": {
2385
+ "name": "projects_folder_check",
2386
+ "value": "\"projects\".\"folder\" IS NULL OR (length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" NOT GLOB '*/*' AND \"projects\".\"folder\" = trim(\"projects\".\"folder\"))"
2387
+ }
2388
+ }
2389
+ },
2390
+ "secret_references": {
2391
+ "name": "secret_references",
2392
+ "columns": {
2393
+ "id": {
2394
+ "name": "id",
2395
+ "type": "text",
2396
+ "primaryKey": true,
2397
+ "notNull": true,
2398
+ "autoincrement": false
2399
+ },
2400
+ "project_id": {
2401
+ "name": "project_id",
2402
+ "type": "text",
2403
+ "primaryKey": false,
2404
+ "notNull": true,
2405
+ "autoincrement": false
2406
+ },
2407
+ "environment_id": {
2408
+ "name": "environment_id",
2409
+ "type": "text",
2410
+ "primaryKey": false,
2411
+ "notNull": true,
2412
+ "autoincrement": false
2413
+ },
2414
+ "secret_id": {
2415
+ "name": "secret_id",
2416
+ "type": "text",
2417
+ "primaryKey": false,
2418
+ "notNull": true,
2419
+ "autoincrement": false
2420
+ },
2421
+ "source_project_id": {
2422
+ "name": "source_project_id",
2423
+ "type": "text",
2424
+ "primaryKey": false,
2425
+ "notNull": true,
2426
+ "autoincrement": false
2427
+ },
2428
+ "source_environment_id": {
2429
+ "name": "source_environment_id",
2430
+ "type": "text",
2431
+ "primaryKey": false,
2432
+ "notNull": true,
2433
+ "autoincrement": false
2434
+ },
2435
+ "source_secret_id": {
2436
+ "name": "source_secret_id",
2437
+ "type": "text",
2438
+ "primaryKey": false,
2439
+ "notNull": true,
2440
+ "autoincrement": false
2441
+ },
2442
+ "created_seq": {
2443
+ "name": "created_seq",
2444
+ "type": "integer",
2445
+ "primaryKey": false,
2446
+ "notNull": true,
2447
+ "autoincrement": false
2448
+ },
2449
+ "created_at": {
2450
+ "name": "created_at",
2451
+ "type": "integer",
2452
+ "primaryKey": false,
2453
+ "notNull": true,
2454
+ "autoincrement": false,
2455
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2456
+ },
2457
+ "created_by": {
2458
+ "name": "created_by",
2459
+ "type": "text",
2460
+ "primaryKey": false,
2461
+ "notNull": true,
2462
+ "autoincrement": false
2463
+ }
2464
+ },
2465
+ "indexes": {
2466
+ "secret_references_holder_idx": {
2467
+ "name": "secret_references_holder_idx",
2468
+ "columns": [
2469
+ "secret_id",
2470
+ "created_seq"
2471
+ ],
2472
+ "isUnique": false
2473
+ },
2474
+ "secret_references_source_idx": {
2475
+ "name": "secret_references_source_idx",
2476
+ "columns": [
2477
+ "source_secret_id"
2478
+ ],
2479
+ "isUnique": false
2480
+ },
2481
+ "secret_references_project_idx": {
2482
+ "name": "secret_references_project_idx",
2483
+ "columns": [
2484
+ "project_id"
2485
+ ],
2486
+ "isUnique": false
2487
+ },
2488
+ "secret_references_source_project_idx": {
2489
+ "name": "secret_references_source_project_idx",
2490
+ "columns": [
2491
+ "source_project_id"
2492
+ ],
2493
+ "isUnique": false
2494
+ },
2495
+ "secret_references_created_by_idx": {
2496
+ "name": "secret_references_created_by_idx",
2497
+ "columns": [
2498
+ "created_by"
2499
+ ],
2500
+ "isUnique": false
2501
+ },
2502
+ "secret_references_created_seq_key": {
2503
+ "name": "secret_references_created_seq_key",
2504
+ "columns": [
2505
+ "created_seq"
2506
+ ],
2507
+ "isUnique": true
2508
+ }
2509
+ },
2510
+ "foreignKeys": {
2511
+ "secret_references_secret_id_fkey": {
2512
+ "name": "secret_references_secret_id_fkey",
2513
+ "tableFrom": "secret_references",
2514
+ "tableTo": "secrets",
2515
+ "columnsFrom": [
2516
+ "secret_id"
2517
+ ],
2518
+ "columnsTo": [
2519
+ "id"
2520
+ ],
2521
+ "onDelete": "restrict",
2522
+ "onUpdate": "no action"
2523
+ },
2524
+ "secret_references_source_secret_id_fkey": {
2525
+ "name": "secret_references_source_secret_id_fkey",
2526
+ "tableFrom": "secret_references",
2527
+ "tableTo": "secrets",
2528
+ "columnsFrom": [
2529
+ "source_secret_id"
2530
+ ],
2531
+ "columnsTo": [
2532
+ "id"
2533
+ ],
2534
+ "onDelete": "restrict",
2535
+ "onUpdate": "no action"
2536
+ },
2537
+ "secret_references_created_seq_fkey": {
2538
+ "name": "secret_references_created_seq_fkey",
2539
+ "tableFrom": "secret_references",
2540
+ "tableTo": "audit_log",
2541
+ "columnsFrom": [
2542
+ "created_seq"
2543
+ ],
2544
+ "columnsTo": [
2545
+ "seq"
2546
+ ],
2547
+ "onDelete": "restrict",
2548
+ "onUpdate": "no action"
2549
+ }
2550
+ },
2551
+ "compositePrimaryKeys": {},
2552
+ "uniqueConstraints": {},
2553
+ "checkConstraints": {}
2554
+ },
2555
+ "secret_versions": {
2556
+ "name": "secret_versions",
2557
+ "columns": {
2558
+ "id": {
2559
+ "name": "id",
2560
+ "type": "text",
2561
+ "primaryKey": true,
2562
+ "notNull": true,
2563
+ "autoincrement": false
2564
+ },
2565
+ "secret_id": {
2566
+ "name": "secret_id",
2567
+ "type": "text",
2568
+ "primaryKey": false,
2569
+ "notNull": true,
2570
+ "autoincrement": false
2571
+ },
2572
+ "version": {
2573
+ "name": "version",
2574
+ "type": "integer",
2575
+ "primaryKey": false,
2576
+ "notNull": true,
2577
+ "autoincrement": false
2578
+ },
2579
+ "envelope_version": {
2580
+ "name": "envelope_version",
2581
+ "type": "integer",
2582
+ "primaryKey": false,
2583
+ "notNull": true,
2584
+ "autoincrement": false
2585
+ },
2586
+ "ciphertext": {
2587
+ "name": "ciphertext",
2588
+ "type": "blob",
2589
+ "primaryKey": false,
2590
+ "notNull": true,
2591
+ "autoincrement": false
2592
+ },
2593
+ "iv": {
2594
+ "name": "iv",
2595
+ "type": "blob",
2596
+ "primaryKey": false,
2597
+ "notNull": true,
2598
+ "autoincrement": false
2599
+ },
2600
+ "auth_tag": {
2601
+ "name": "auth_tag",
2602
+ "type": "blob",
2603
+ "primaryKey": false,
2604
+ "notNull": true,
2605
+ "autoincrement": false
2606
+ },
2607
+ "wrapped_dek": {
2608
+ "name": "wrapped_dek",
2609
+ "type": "blob",
2610
+ "primaryKey": false,
2611
+ "notNull": true,
2612
+ "autoincrement": false
2613
+ },
2614
+ "kek_provider": {
2615
+ "name": "kek_provider",
2616
+ "type": "text",
2617
+ "primaryKey": false,
2618
+ "notNull": true,
2619
+ "autoincrement": false
2620
+ },
2621
+ "kek_id": {
2622
+ "name": "kek_id",
2623
+ "type": "text",
2624
+ "primaryKey": false,
2625
+ "notNull": true,
2626
+ "autoincrement": false
2627
+ },
2628
+ "kek_version": {
2629
+ "name": "kek_version",
2630
+ "type": "text",
2631
+ "primaryKey": false,
2632
+ "notNull": true,
2633
+ "autoincrement": false
2634
+ },
2635
+ "created_at": {
2636
+ "name": "created_at",
2637
+ "type": "integer",
2638
+ "primaryKey": false,
2639
+ "notNull": true,
2640
+ "autoincrement": false,
2641
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2642
+ },
2643
+ "created_by": {
2644
+ "name": "created_by",
2645
+ "type": "text",
2646
+ "primaryKey": false,
2647
+ "notNull": true,
2648
+ "autoincrement": false
2649
+ },
2650
+ "recipe": {
2651
+ "name": "recipe",
2652
+ "type": "text",
2653
+ "primaryKey": false,
2654
+ "notNull": false,
2655
+ "autoincrement": false
2656
+ },
2657
+ "pair_id": {
2658
+ "name": "pair_id",
2659
+ "type": "text",
2660
+ "primaryKey": false,
2661
+ "notNull": false,
2662
+ "autoincrement": false
2663
+ },
2664
+ "pair_half": {
2665
+ "name": "pair_half",
2666
+ "type": "text",
2667
+ "primaryKey": false,
2668
+ "notNull": false,
2669
+ "autoincrement": false
2670
+ },
2671
+ "plaintext": {
2672
+ "name": "plaintext",
2673
+ "type": "text",
2674
+ "primaryKey": false,
2675
+ "notNull": false,
2676
+ "autoincrement": false
2677
+ },
2678
+ "sensitive": {
2679
+ "name": "sensitive",
2680
+ "type": "integer",
2681
+ "primaryKey": false,
2682
+ "notNull": true,
2683
+ "autoincrement": false,
2684
+ "default": false
2685
+ }
2686
+ },
2687
+ "indexes": {
2688
+ "secret_versions_secret_idx": {
2689
+ "name": "secret_versions_secret_idx",
2690
+ "columns": [
2691
+ "secret_id",
2692
+ "version"
2693
+ ],
2694
+ "isUnique": false
2695
+ },
2696
+ "secret_versions_secret_id_version_key": {
2697
+ "name": "secret_versions_secret_id_version_key",
2698
+ "columns": [
2699
+ "secret_id",
2700
+ "version"
2701
+ ],
2702
+ "isUnique": true
2703
+ }
2704
+ },
2705
+ "foreignKeys": {
2706
+ "secret_versions_secret_id_fkey": {
2707
+ "name": "secret_versions_secret_id_fkey",
2708
+ "tableFrom": "secret_versions",
2709
+ "tableTo": "secrets",
2710
+ "columnsFrom": [
2711
+ "secret_id"
2712
+ ],
2713
+ "columnsTo": [
2714
+ "id"
2715
+ ],
2716
+ "onDelete": "restrict",
2717
+ "onUpdate": "no action"
2718
+ }
2719
+ },
2720
+ "compositePrimaryKeys": {},
2721
+ "uniqueConstraints": {},
2722
+ "checkConstraints": {
2723
+ "secret_versions_version_check": {
2724
+ "name": "secret_versions_version_check",
2725
+ "value": "\"secret_versions\".\"version\" > 0"
2726
+ },
2727
+ "secret_versions_iv_check": {
2728
+ "name": "secret_versions_iv_check",
2729
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
2730
+ },
2731
+ "secret_versions_auth_tag_check": {
2732
+ "name": "secret_versions_auth_tag_check",
2733
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
2734
+ }
2735
+ }
2736
+ },
2737
+ "secrets": {
2738
+ "name": "secrets",
2739
+ "columns": {
2740
+ "id": {
2741
+ "name": "id",
2742
+ "type": "text",
2743
+ "primaryKey": true,
2744
+ "notNull": true,
2745
+ "autoincrement": false
2746
+ },
2747
+ "project_id": {
2748
+ "name": "project_id",
2749
+ "type": "text",
2750
+ "primaryKey": false,
2751
+ "notNull": true,
2752
+ "autoincrement": false
2753
+ },
2754
+ "environment_id": {
2755
+ "name": "environment_id",
2756
+ "type": "text",
2757
+ "primaryKey": false,
2758
+ "notNull": true,
2759
+ "autoincrement": false
2760
+ },
2761
+ "key": {
2762
+ "name": "key",
2763
+ "type": "text",
2764
+ "primaryKey": false,
2765
+ "notNull": true,
2766
+ "autoincrement": false
2767
+ },
2768
+ "created_at": {
2769
+ "name": "created_at",
2770
+ "type": "integer",
2771
+ "primaryKey": false,
2772
+ "notNull": true,
2773
+ "autoincrement": false,
2774
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2775
+ },
2776
+ "updated_at": {
2777
+ "name": "updated_at",
2778
+ "type": "integer",
2779
+ "primaryKey": false,
2780
+ "notNull": true,
2781
+ "autoincrement": false,
2782
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2783
+ },
2784
+ "current_version_id": {
2785
+ "name": "current_version_id",
2786
+ "type": "text",
2787
+ "primaryKey": false,
2788
+ "notNull": false,
2789
+ "autoincrement": false
2790
+ },
2791
+ "current_version": {
2792
+ "name": "current_version",
2793
+ "type": "integer",
2794
+ "primaryKey": false,
2795
+ "notNull": true,
2796
+ "autoincrement": false,
2797
+ "default": 0
2798
+ },
2799
+ "archived_at": {
2800
+ "name": "archived_at",
2801
+ "type": "integer",
2802
+ "primaryKey": false,
2803
+ "notNull": false,
2804
+ "autoincrement": false
2805
+ },
2806
+ "folder": {
2807
+ "name": "folder",
2808
+ "type": "text",
2809
+ "primaryKey": false,
2810
+ "notNull": false,
2811
+ "autoincrement": false
2812
+ },
2813
+ "seal": {
2814
+ "name": "seal",
2815
+ "type": "blob",
2816
+ "primaryKey": false,
2817
+ "notNull": false,
2818
+ "autoincrement": false
2819
+ }
2820
+ },
2821
+ "indexes": {
2822
+ "secrets_lookup_idx": {
2823
+ "name": "secrets_lookup_idx",
2824
+ "columns": [
2825
+ "project_id",
2826
+ "environment_id",
2827
+ "key"
2828
+ ],
2829
+ "isUnique": false
2830
+ },
2831
+ "secrets_project_id_environment_id_key_key": {
2832
+ "name": "secrets_project_id_environment_id_key_key",
2833
+ "columns": [
2834
+ "project_id",
2835
+ "environment_id",
2836
+ "key"
2837
+ ],
2838
+ "isUnique": true
2839
+ }
2840
+ },
2841
+ "foreignKeys": {
2842
+ "secrets_current_version_id_secret_versions_id_fk": {
2843
+ "name": "secrets_current_version_id_secret_versions_id_fk",
2844
+ "tableFrom": "secrets",
2845
+ "tableTo": "secret_versions",
2846
+ "columnsFrom": [
2847
+ "current_version_id"
2848
+ ],
2849
+ "columnsTo": [
2850
+ "id"
2851
+ ],
2852
+ "onDelete": "no action",
2853
+ "onUpdate": "no action"
2854
+ },
2855
+ "secrets_project_id_fkey": {
2856
+ "name": "secrets_project_id_fkey",
2857
+ "tableFrom": "secrets",
2858
+ "tableTo": "projects",
2859
+ "columnsFrom": [
2860
+ "project_id"
2861
+ ],
2862
+ "columnsTo": [
2863
+ "id"
2864
+ ],
2865
+ "onDelete": "restrict",
2866
+ "onUpdate": "no action"
2867
+ },
2868
+ "secrets_environment_id_fkey": {
2869
+ "name": "secrets_environment_id_fkey",
2870
+ "tableFrom": "secrets",
2871
+ "tableTo": "environments",
2872
+ "columnsFrom": [
2873
+ "environment_id"
2874
+ ],
2875
+ "columnsTo": [
2876
+ "id"
2877
+ ],
2878
+ "onDelete": "restrict",
2879
+ "onUpdate": "no action"
2880
+ },
2881
+ "secrets_environment_in_project": {
2882
+ "name": "secrets_environment_in_project",
2883
+ "tableFrom": "secrets",
2884
+ "tableTo": "environments",
2885
+ "columnsFrom": [
2886
+ "environment_id",
2887
+ "project_id"
2888
+ ],
2889
+ "columnsTo": [
2890
+ "id",
2891
+ "project_id"
2892
+ ],
2893
+ "onDelete": "no action",
2894
+ "onUpdate": "no action"
2895
+ }
2896
+ },
2897
+ "compositePrimaryKeys": {},
2898
+ "uniqueConstraints": {},
2899
+ "checkConstraints": {
2900
+ "secrets_seal_check": {
2901
+ "name": "secrets_seal_check",
2902
+ "value": "\"secrets\".\"seal\" IS NULL OR octet_length(\"secrets\".\"seal\") = 16"
2903
+ },
2904
+ "secrets_key_check": {
2905
+ "name": "secrets_key_check",
2906
+ "value": "length(\"secrets\".\"key\") BETWEEN 1 AND 128 AND \"secrets\".\"key\" GLOB '[A-Za-z_]*' AND \"secrets\".\"key\" NOT GLOB '*[^A-Za-z0-9_]*'"
2907
+ },
2908
+ "secrets_folder_check": {
2909
+ "name": "secrets_folder_check",
2910
+ "value": "\"secrets\".\"folder\" IS NULL OR (length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" NOT GLOB '*/*' AND \"secrets\".\"folder\" = trim(\"secrets\".\"folder\"))"
2911
+ }
2912
+ }
2913
+ },
2914
+ "service_bindings": {
2915
+ "name": "service_bindings",
2916
+ "columns": {
2917
+ "id": {
2918
+ "name": "id",
2919
+ "type": "text",
2920
+ "primaryKey": true,
2921
+ "notNull": true,
2922
+ "autoincrement": false
2923
+ },
2924
+ "auth_mac": {
2925
+ "name": "auth_mac",
2926
+ "type": "blob",
2927
+ "primaryKey": false,
2928
+ "notNull": true,
2929
+ "autoincrement": false
2930
+ },
2931
+ "principal": {
2932
+ "name": "principal",
2933
+ "type": "text",
2934
+ "primaryKey": false,
2935
+ "notNull": true,
2936
+ "autoincrement": false
2937
+ },
2938
+ "generation": {
2939
+ "name": "generation",
2940
+ "type": "integer",
2941
+ "primaryKey": false,
2942
+ "notNull": true,
2943
+ "autoincrement": false
2944
+ },
2945
+ "profile": {
2946
+ "name": "profile",
2947
+ "type": "text",
2948
+ "primaryKey": false,
2949
+ "notNull": true,
2950
+ "autoincrement": false
2951
+ },
2952
+ "issuer": {
2953
+ "name": "issuer",
2954
+ "type": "text",
2955
+ "primaryKey": false,
2956
+ "notNull": true,
2957
+ "autoincrement": false
2958
+ },
2959
+ "jwks_uri": {
2960
+ "name": "jwks_uri",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true,
2964
+ "autoincrement": false
2965
+ },
2966
+ "jwks": {
2967
+ "name": "jwks",
2968
+ "type": "text",
2969
+ "primaryKey": false,
2970
+ "notNull": false,
2971
+ "autoincrement": false
2972
+ },
2973
+ "claims": {
2974
+ "name": "claims",
2975
+ "type": "text",
2976
+ "primaryKey": false,
2977
+ "notNull": true,
2978
+ "autoincrement": false
2979
+ },
2980
+ "scope": {
2981
+ "name": "scope",
2982
+ "type": "text",
2983
+ "primaryKey": false,
2984
+ "notNull": false,
2985
+ "autoincrement": false
2986
+ },
2987
+ "policy": {
2988
+ "name": "policy",
2989
+ "type": "text",
2990
+ "primaryKey": false,
2991
+ "notNull": false,
2992
+ "autoincrement": false
2993
+ },
2994
+ "label": {
2995
+ "name": "label",
2996
+ "type": "text",
2997
+ "primaryKey": false,
2998
+ "notNull": false,
2999
+ "autoincrement": false
3000
+ },
3001
+ "created_at": {
3002
+ "name": "created_at",
3003
+ "type": "integer",
3004
+ "primaryKey": false,
3005
+ "notNull": true,
3006
+ "autoincrement": false,
3007
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
3008
+ },
3009
+ "created_by": {
3010
+ "name": "created_by",
3011
+ "type": "text",
3012
+ "primaryKey": false,
3013
+ "notNull": true,
3014
+ "autoincrement": false
3015
+ },
3016
+ "last_used_at": {
3017
+ "name": "last_used_at",
3018
+ "type": "integer",
3019
+ "primaryKey": false,
3020
+ "notNull": false,
3021
+ "autoincrement": false
3022
+ },
3023
+ "revoked_at": {
3024
+ "name": "revoked_at",
3025
+ "type": "integer",
3026
+ "primaryKey": false,
3027
+ "notNull": false,
3028
+ "autoincrement": false
3029
+ },
3030
+ "revoked_by": {
3031
+ "name": "revoked_by",
3032
+ "type": "text",
3033
+ "primaryKey": false,
3034
+ "notNull": false,
3035
+ "autoincrement": false
3036
+ },
3037
+ "seal": {
3038
+ "name": "seal",
3039
+ "type": "blob",
3040
+ "primaryKey": false,
3041
+ "notNull": false,
3042
+ "autoincrement": false
3043
+ }
3044
+ },
3045
+ "indexes": {
3046
+ "service_bindings_principal_idx": {
3047
+ "name": "service_bindings_principal_idx",
3048
+ "columns": [
3049
+ "principal",
3050
+ "issuer"
3051
+ ],
3052
+ "isUnique": false
3053
+ },
3054
+ "service_bindings_live_idx": {
3055
+ "name": "service_bindings_live_idx",
3056
+ "columns": [
3057
+ "principal",
3058
+ "issuer",
3059
+ "generation",
3060
+ "created_at",
3061
+ "id"
3062
+ ],
3063
+ "isUnique": false,
3064
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL"
3065
+ }
3066
+ },
3067
+ "foreignKeys": {
3068
+ "service_bindings_principal_fkey": {
3069
+ "name": "service_bindings_principal_fkey",
3070
+ "tableFrom": "service_bindings",
3071
+ "tableTo": "vault_members",
3072
+ "columnsFrom": [
3073
+ "principal"
3074
+ ],
3075
+ "columnsTo": [
3076
+ "principal"
3077
+ ],
3078
+ "onDelete": "restrict",
3079
+ "onUpdate": "no action"
3080
+ }
3081
+ },
3082
+ "compositePrimaryKeys": {},
3083
+ "uniqueConstraints": {},
3084
+ "checkConstraints": {
3085
+ "service_bindings_seal_check": {
3086
+ "name": "service_bindings_seal_check",
3087
+ "value": "\"service_bindings\".\"seal\" IS NULL OR octet_length(\"service_bindings\".\"seal\") = 16"
3088
+ },
3089
+ "service_bindings_principal_check": {
3090
+ "name": "service_bindings_principal_check",
3091
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
3092
+ },
3093
+ "service_bindings_auth_mac_check": {
3094
+ "name": "service_bindings_auth_mac_check",
3095
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
3096
+ },
3097
+ "service_bindings_claims_check": {
3098
+ "name": "service_bindings_claims_check",
3099
+ "value": "json_valid(\"service_bindings\".\"claims\")"
3100
+ }
3101
+ }
3102
+ },
3103
+ "log_config": {
3104
+ "name": "log_config",
3105
+ "columns": {
3106
+ "name": {
3107
+ "name": "name",
3108
+ "type": "text",
3109
+ "primaryKey": true,
3110
+ "notNull": true,
3111
+ "autoincrement": false
3112
+ },
3113
+ "value": {
3114
+ "name": "value",
3115
+ "type": "text",
3116
+ "primaryKey": false,
3117
+ "notNull": true,
3118
+ "autoincrement": false
3119
+ },
3120
+ "seal": {
3121
+ "name": "seal",
3122
+ "type": "blob",
3123
+ "primaryKey": false,
3124
+ "notNull": false,
3125
+ "autoincrement": false
3126
+ }
3127
+ },
3128
+ "indexes": {},
3129
+ "foreignKeys": {},
3130
+ "compositePrimaryKeys": {},
3131
+ "uniqueConstraints": {},
3132
+ "checkConstraints": {
3133
+ "log_config_name_check": {
3134
+ "name": "log_config_name_check",
3135
+ "value": "\"log_config\".\"name\" IN ('policy', 'roles')"
3136
+ },
3137
+ "log_config_value_check": {
3138
+ "name": "log_config_value_check",
3139
+ "value": "json_valid(\"log_config\".\"value\")"
3140
+ },
3141
+ "log_config_seal_check": {
3142
+ "name": "log_config_seal_check",
3143
+ "value": "\"log_config\".\"seal\" IS NULL OR octet_length(\"log_config\".\"seal\") = 16"
3144
+ }
3145
+ }
3146
+ },
3147
+ "vault_grants": {
3148
+ "name": "vault_grants",
3149
+ "columns": {
3150
+ "principal": {
3151
+ "name": "principal",
3152
+ "type": "text",
3153
+ "primaryKey": false,
3154
+ "notNull": true,
3155
+ "autoincrement": false
3156
+ },
3157
+ "project_id": {
3158
+ "name": "project_id",
3159
+ "type": "text",
3160
+ "primaryKey": false,
3161
+ "notNull": false,
3162
+ "autoincrement": false
3163
+ },
3164
+ "environment_id": {
3165
+ "name": "environment_id",
3166
+ "type": "text",
3167
+ "primaryKey": false,
3168
+ "notNull": false,
3169
+ "autoincrement": false
3170
+ },
3171
+ "environment_slug": {
3172
+ "name": "environment_slug",
3173
+ "type": "text",
3174
+ "primaryKey": false,
3175
+ "notNull": false,
3176
+ "autoincrement": false
3177
+ },
3178
+ "role": {
3179
+ "name": "role",
3180
+ "type": "text",
3181
+ "primaryKey": false,
3182
+ "notNull": true,
3183
+ "autoincrement": false
3184
+ },
3185
+ "expires_at": {
3186
+ "name": "expires_at",
3187
+ "type": "integer",
3188
+ "primaryKey": false,
3189
+ "notNull": false,
3190
+ "autoincrement": false
3191
+ },
3192
+ "granted_at": {
3193
+ "name": "granted_at",
3194
+ "type": "integer",
3195
+ "primaryKey": false,
3196
+ "notNull": true,
3197
+ "autoincrement": false
3198
+ },
3199
+ "granted_by": {
3200
+ "name": "granted_by",
3201
+ "type": "text",
3202
+ "primaryKey": false,
3203
+ "notNull": true,
3204
+ "autoincrement": false
3205
+ }
3206
+ },
3207
+ "indexes": {
3208
+ "vault_grants_on_every_project": {
3209
+ "name": "vault_grants_on_every_project",
3210
+ "columns": [
3211
+ "principal"
3212
+ ],
3213
+ "isUnique": true,
3214
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL"
3215
+ },
3216
+ "vault_grants_on_project": {
3217
+ "name": "vault_grants_on_project",
3218
+ "columns": [
3219
+ "principal",
3220
+ "project_id"
3221
+ ],
3222
+ "isUnique": true
3223
+ },
3224
+ "vault_grants_on_environment": {
3225
+ "name": "vault_grants_on_environment",
3226
+ "columns": [
3227
+ "principal",
3228
+ "environment_id"
3229
+ ],
3230
+ "isUnique": true
3231
+ },
3232
+ "vault_grants_on_environment_slug": {
3233
+ "name": "vault_grants_on_environment_slug",
3234
+ "columns": [
3235
+ "principal",
3236
+ "environment_slug"
3237
+ ],
3238
+ "isUnique": true
3239
+ }
3240
+ },
3241
+ "foreignKeys": {
3242
+ "vault_grants_principal_fkey": {
3243
+ "name": "vault_grants_principal_fkey",
3244
+ "tableFrom": "vault_grants",
3245
+ "tableTo": "vault_members",
3246
+ "columnsFrom": [
3247
+ "principal"
3248
+ ],
3249
+ "columnsTo": [
3250
+ "principal"
3251
+ ],
3252
+ "onDelete": "restrict",
3253
+ "onUpdate": "no action"
3254
+ },
3255
+ "vault_grants_project_id_fkey": {
3256
+ "name": "vault_grants_project_id_fkey",
3257
+ "tableFrom": "vault_grants",
3258
+ "tableTo": "projects",
3259
+ "columnsFrom": [
3260
+ "project_id"
3261
+ ],
3262
+ "columnsTo": [
3263
+ "id"
3264
+ ],
3265
+ "onDelete": "restrict",
3266
+ "onUpdate": "no action"
3267
+ },
3268
+ "vault_grants_environment_id_fkey": {
3269
+ "name": "vault_grants_environment_id_fkey",
3270
+ "tableFrom": "vault_grants",
3271
+ "tableTo": "environments",
3272
+ "columnsFrom": [
3273
+ "environment_id"
3274
+ ],
3275
+ "columnsTo": [
3276
+ "id"
3277
+ ],
3278
+ "onDelete": "restrict",
3279
+ "onUpdate": "no action"
3280
+ }
3281
+ },
3282
+ "compositePrimaryKeys": {},
3283
+ "uniqueConstraints": {},
3284
+ "checkConstraints": {
3285
+ "vault_grants_one_place": {
3286
+ "name": "vault_grants_one_place",
3287
+ "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)"
3288
+ },
3289
+ "vault_grants_environment_slug_check": {
3290
+ "name": "vault_grants_environment_slug_check",
3291
+ "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-]*')"
3292
+ },
3293
+ "vault_grants_role_check": {
3294
+ "name": "vault_grants_role_check",
3295
+ "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-]*'"
3296
+ }
3297
+ }
3298
+ },
3299
+ "vault_members": {
3300
+ "name": "vault_members",
3301
+ "columns": {
3302
+ "principal": {
3303
+ "name": "principal",
3304
+ "type": "text",
3305
+ "primaryKey": true,
3306
+ "notNull": true,
3307
+ "autoincrement": false
3308
+ },
3309
+ "status": {
3310
+ "name": "status",
3311
+ "type": "text",
3312
+ "primaryKey": false,
3313
+ "notNull": true,
3314
+ "autoincrement": false
3315
+ },
3316
+ "owner": {
3317
+ "name": "owner",
3318
+ "type": "integer",
3319
+ "primaryKey": false,
3320
+ "notNull": true,
3321
+ "autoincrement": false,
3322
+ "default": false
3323
+ },
3324
+ "role": {
3325
+ "name": "role",
3326
+ "type": "text",
3327
+ "primaryKey": false,
3328
+ "notNull": false,
3329
+ "autoincrement": false
3330
+ },
3331
+ "scope": {
3332
+ "name": "scope",
3333
+ "type": "text",
3334
+ "primaryKey": false,
3335
+ "notNull": false,
3336
+ "autoincrement": false
3337
+ },
3338
+ "generation": {
3339
+ "name": "generation",
3340
+ "type": "integer",
3341
+ "primaryKey": false,
3342
+ "notNull": true,
3343
+ "autoincrement": false,
3344
+ "default": 0
3345
+ },
3346
+ "created_at": {
3347
+ "name": "created_at",
3348
+ "type": "integer",
3349
+ "primaryKey": false,
3350
+ "notNull": true,
3351
+ "autoincrement": false
3352
+ },
3353
+ "created_by": {
3354
+ "name": "created_by",
3355
+ "type": "text",
3356
+ "primaryKey": false,
3357
+ "notNull": true,
3358
+ "autoincrement": false
3359
+ },
3360
+ "status_changed_at": {
3361
+ "name": "status_changed_at",
3362
+ "type": "integer",
3363
+ "primaryKey": false,
3364
+ "notNull": true,
3365
+ "autoincrement": false
3366
+ },
3367
+ "status_changed_by": {
3368
+ "name": "status_changed_by",
3369
+ "type": "text",
3370
+ "primaryKey": false,
3371
+ "notNull": true,
3372
+ "autoincrement": false
3373
+ },
3374
+ "access_seq": {
3375
+ "name": "access_seq",
3376
+ "type": "integer",
3377
+ "primaryKey": false,
3378
+ "notNull": true,
3379
+ "autoincrement": false
3380
+ },
3381
+ "mac": {
3382
+ "name": "mac",
3383
+ "type": "blob",
3384
+ "primaryKey": false,
3385
+ "notNull": true,
3386
+ "autoincrement": false
3387
+ },
3388
+ "seal": {
3389
+ "name": "seal",
3390
+ "type": "blob",
3391
+ "primaryKey": false,
3392
+ "notNull": false,
3393
+ "autoincrement": false
3394
+ }
3395
+ },
3396
+ "indexes": {},
3397
+ "foreignKeys": {},
3398
+ "compositePrimaryKeys": {},
3399
+ "uniqueConstraints": {},
3400
+ "checkConstraints": {
3401
+ "vault_members_seal_check": {
3402
+ "name": "vault_members_seal_check",
3403
+ "value": "\"vault_members\".\"seal\" IS NULL OR octet_length(\"vault_members\".\"seal\") = 16"
3404
+ },
3405
+ "vault_members_mac_check": {
3406
+ "name": "vault_members_mac_check",
3407
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
3408
+ },
3409
+ "vault_members_principal_check": {
3410
+ "name": "vault_members_principal_check",
3411
+ "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"
3412
+ },
3413
+ "vault_members_user_lowercase": {
3414
+ "name": "vault_members_user_lowercase",
3415
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
3416
+ },
3417
+ "vault_members_status_check": {
3418
+ "name": "vault_members_status_check",
3419
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
3420
+ },
3421
+ "vault_members_owner_check": {
3422
+ "name": "vault_members_owner_check",
3423
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
3424
+ },
3425
+ "vault_members_generation_check": {
3426
+ "name": "vault_members_generation_check",
3427
+ "value": "\"vault_members\".\"generation\" >= 0"
3428
+ }
3429
+ }
3430
+ },
3431
+ "vault_releases": {
3432
+ "name": "vault_releases",
3433
+ "columns": {
3434
+ "principal": {
3435
+ "name": "principal",
3436
+ "type": "text",
3437
+ "primaryKey": false,
3438
+ "notNull": true,
3439
+ "autoincrement": false
3440
+ },
3441
+ "key": {
3442
+ "name": "key",
3443
+ "type": "text",
3444
+ "primaryKey": false,
3445
+ "notNull": true,
3446
+ "autoincrement": false
3447
+ },
3448
+ "released_at": {
3449
+ "name": "released_at",
3450
+ "type": "integer",
3451
+ "primaryKey": false,
3452
+ "notNull": true,
3453
+ "autoincrement": false
3454
+ }
3455
+ },
3456
+ "indexes": {},
3457
+ "foreignKeys": {},
3458
+ "compositePrimaryKeys": {
3459
+ "vault_releases_pkey": {
3460
+ "columns": [
3461
+ "principal",
3462
+ "key"
3463
+ ],
3464
+ "name": "vault_releases_pkey"
3465
+ }
3466
+ },
3467
+ "uniqueConstraints": {},
3468
+ "checkConstraints": {}
3469
+ }
3470
+ },
3471
+ "views": {},
3472
+ "enums": {},
3473
+ "_meta": {
3474
+ "schemas": {},
3475
+ "tables": {},
3476
+ "columns": {}
3477
+ },
3478
+ "internal": {
3479
+ "indexes": {
3480
+ "audit_log_unbind_idx": {
3481
+ "columns": {
3482
+ "json_extract(\"metadata\", '$.bindingId')": {
3483
+ "isExpression": true
3484
+ }
3485
+ }
3486
+ },
3487
+ "audit_log_freeze_idx": {
3488
+ "columns": {
3489
+ "json_extract(\"metadata\", '$.target')": {
3490
+ "isExpression": true
3491
+ }
3492
+ }
3493
+ },
3494
+ "audit_log_supersede_idx": {
3495
+ "columns": {
3496
+ "json_extract(\"metadata\", '$.enrollmentId')": {
3497
+ "isExpression": true
3498
+ }
3499
+ }
3500
+ },
3501
+ "audit_log_exchange_idx": {
3502
+ "columns": {
3503
+ "json_extract(\"metadata\", '$.credentialId')": {
3504
+ "isExpression": true
3505
+ }
3506
+ }
3507
+ },
3508
+ "audit_log_token_create_idx": {
3509
+ "columns": {
3510
+ "json_extract(\"metadata\", '$.targetCredentialId')": {
3511
+ "isExpression": true
3512
+ }
3513
+ }
3514
+ },
3515
+ "audit_log_also_project_idx": {
3516
+ "columns": {
3517
+ "json_extract(\"metadata\", '$.also.projectId')": {
3518
+ "isExpression": true
3519
+ }
3520
+ }
3521
+ },
3522
+ "audit_log_also_environment_idx": {
3523
+ "columns": {
3524
+ "json_extract(\"metadata\", '$.also.environmentId')": {
3525
+ "isExpression": true
3526
+ }
3527
+ }
3528
+ },
3529
+ "audit_log_also_secret_idx": {
3530
+ "columns": {
3531
+ "json_extract(\"metadata\", '$.also.secretId')": {
3532
+ "isExpression": true
3533
+ }
3534
+ }
3535
+ }
3536
+ }
3537
+ }
3538
+ }