@coffre/db 0.14.5 → 0.15.0

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