@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,3609 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "f53d139f-8140-455a-bbd3-8343fadc7cdf",
5
+ "prevId": "6b6277ca-7a43-4965-a479-62313244645c",
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_sign_in_idx": {
1615
+ "name": "log_changes_sign_in_idx",
1616
+ "columns": [
1617
+ "at",
1618
+ "number"
1619
+ ],
1620
+ "isUnique": false,
1621
+ "where": "instr(\"log_changes\".\"payload\", '\"signIn\":{') > 0"
1622
+ },
1623
+ "log_changes_sign_in_actor_idx": {
1624
+ "name": "log_changes_sign_in_actor_idx",
1625
+ "columns": [
1626
+ "actor",
1627
+ "at",
1628
+ "number"
1629
+ ],
1630
+ "isUnique": false,
1631
+ "where": "instr(\"log_changes\".\"payload\", '\"signIn\":{') > 0"
1632
+ },
1633
+ "log_changes_issue_revoke_idx": {
1634
+ "name": "log_changes_issue_revoke_idx",
1635
+ "columns": [
1636
+ "at",
1637
+ "number"
1638
+ ],
1639
+ "isUnique": false,
1640
+ "where": "((instr(\"log_changes\".\"payload\", '{\"caller\":\"') = 1 AND instr(\"log_changes\".\"payload\", '\"issue\":{\"by\":\"') > 0) OR (instr(\"log_changes\".\"payload\", '{\"op\":\"credential.revoke\",') = 1 AND instr(\"log_changes\".\"payload\", '\"reason\":\"revoke\"') > 0) OR (instr(\"log_changes\".\"payload\", '{\"op\":\"credential.revoke\",') = 1 AND instr(\"log_changes\".\"payload\", '\"reason\":\"sign_out\"') > 0))"
1641
+ },
1642
+ "log_changes_issue_revoke_actor_idx": {
1643
+ "name": "log_changes_issue_revoke_actor_idx",
1644
+ "columns": [
1645
+ "actor",
1646
+ "at",
1647
+ "number"
1648
+ ],
1649
+ "isUnique": false,
1650
+ "where": "((instr(\"log_changes\".\"payload\", '{\"caller\":\"') = 1 AND instr(\"log_changes\".\"payload\", '\"issue\":{\"by\":\"') > 0) OR (instr(\"log_changes\".\"payload\", '{\"op\":\"credential.revoke\",') = 1 AND instr(\"log_changes\".\"payload\", '\"reason\":\"revoke\"') > 0) OR (instr(\"log_changes\".\"payload\", '{\"op\":\"credential.revoke\",') = 1 AND instr(\"log_changes\".\"payload\", '\"reason\":\"sign_out\"') > 0))"
1651
+ },
1652
+ "log_changes_request_id_key": {
1653
+ "name": "log_changes_request_id_key",
1654
+ "columns": [
1655
+ "request_id"
1656
+ ],
1657
+ "isUnique": true
1658
+ }
1659
+ },
1660
+ "foreignKeys": {},
1661
+ "compositePrimaryKeys": {},
1662
+ "uniqueConstraints": {},
1663
+ "checkConstraints": {
1664
+ "log_changes_seal_check": {
1665
+ "name": "log_changes_seal_check",
1666
+ "value": "\"log_changes\".\"seal\" IS NULL OR octet_length(\"log_changes\".\"seal\") = 16"
1667
+ },
1668
+ "log_changes_mac_check": {
1669
+ "name": "log_changes_mac_check",
1670
+ "value": "octet_length(\"log_changes\".\"mac\") = 16"
1671
+ }
1672
+ }
1673
+ },
1674
+ "log_checkpoints": {
1675
+ "name": "log_checkpoints",
1676
+ "columns": {
1677
+ "upto": {
1678
+ "name": "upto",
1679
+ "type": "integer",
1680
+ "primaryKey": true,
1681
+ "notNull": true,
1682
+ "autoincrement": false
1683
+ },
1684
+ "at": {
1685
+ "name": "at",
1686
+ "type": "integer",
1687
+ "primaryKey": false,
1688
+ "notNull": true,
1689
+ "autoincrement": false
1690
+ },
1691
+ "at_floor": {
1692
+ "name": "at_floor",
1693
+ "type": "integer",
1694
+ "primaryKey": false,
1695
+ "notNull": true,
1696
+ "autoincrement": false
1697
+ },
1698
+ "changes_size": {
1699
+ "name": "changes_size",
1700
+ "type": "integer",
1701
+ "primaryKey": false,
1702
+ "notNull": true,
1703
+ "autoincrement": false
1704
+ },
1705
+ "changes_root": {
1706
+ "name": "changes_root",
1707
+ "type": "blob",
1708
+ "primaryKey": false,
1709
+ "notNull": true,
1710
+ "autoincrement": false
1711
+ },
1712
+ "changes_note": {
1713
+ "name": "changes_note",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true,
1717
+ "autoincrement": false
1718
+ },
1719
+ "uses_size": {
1720
+ "name": "uses_size",
1721
+ "type": "integer",
1722
+ "primaryKey": false,
1723
+ "notNull": true,
1724
+ "autoincrement": false
1725
+ },
1726
+ "uses_root": {
1727
+ "name": "uses_root",
1728
+ "type": "blob",
1729
+ "primaryKey": false,
1730
+ "notNull": true,
1731
+ "autoincrement": false
1732
+ },
1733
+ "uses_note": {
1734
+ "name": "uses_note",
1735
+ "type": "text",
1736
+ "primaryKey": false,
1737
+ "notNull": true,
1738
+ "autoincrement": false
1739
+ }
1740
+ },
1741
+ "indexes": {
1742
+ "log_checkpoints_floor_idx": {
1743
+ "name": "log_checkpoints_floor_idx",
1744
+ "columns": [
1745
+ "at_floor",
1746
+ "upto"
1747
+ ],
1748
+ "isUnique": false
1749
+ }
1750
+ },
1751
+ "foreignKeys": {},
1752
+ "compositePrimaryKeys": {},
1753
+ "uniqueConstraints": {},
1754
+ "checkConstraints": {
1755
+ "log_checkpoints_changes_root_check": {
1756
+ "name": "log_checkpoints_changes_root_check",
1757
+ "value": "octet_length(\"log_checkpoints\".\"changes_root\") = 32"
1758
+ },
1759
+ "log_checkpoints_uses_root_check": {
1760
+ "name": "log_checkpoints_uses_root_check",
1761
+ "value": "octet_length(\"log_checkpoints\".\"uses_root\") = 32"
1762
+ }
1763
+ }
1764
+ },
1765
+ "log_config": {
1766
+ "name": "log_config",
1767
+ "columns": {
1768
+ "name": {
1769
+ "name": "name",
1770
+ "type": "text",
1771
+ "primaryKey": true,
1772
+ "notNull": true,
1773
+ "autoincrement": false
1774
+ },
1775
+ "value": {
1776
+ "name": "value",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": true,
1780
+ "autoincrement": false
1781
+ },
1782
+ "seal": {
1783
+ "name": "seal",
1784
+ "type": "blob",
1785
+ "primaryKey": false,
1786
+ "notNull": false,
1787
+ "autoincrement": false
1788
+ }
1789
+ },
1790
+ "indexes": {},
1791
+ "foreignKeys": {},
1792
+ "compositePrimaryKeys": {},
1793
+ "uniqueConstraints": {},
1794
+ "checkConstraints": {
1795
+ "log_config_name_check": {
1796
+ "name": "log_config_name_check",
1797
+ "value": "\"log_config\".\"name\" IN ('policy', 'roles')"
1798
+ },
1799
+ "log_config_value_check": {
1800
+ "name": "log_config_value_check",
1801
+ "value": "json_valid(\"log_config\".\"value\")"
1802
+ },
1803
+ "log_config_seal_check": {
1804
+ "name": "log_config_seal_check",
1805
+ "value": "\"log_config\".\"seal\" IS NULL OR octet_length(\"log_config\".\"seal\") = 16"
1806
+ }
1807
+ }
1808
+ },
1809
+ "log_fence": {
1810
+ "name": "log_fence",
1811
+ "columns": {
1812
+ "only_row": {
1813
+ "name": "only_row",
1814
+ "type": "integer",
1815
+ "primaryKey": true,
1816
+ "notNull": true,
1817
+ "autoincrement": false,
1818
+ "default": true
1819
+ },
1820
+ "at_floor": {
1821
+ "name": "at_floor",
1822
+ "type": "integer",
1823
+ "primaryKey": false,
1824
+ "notNull": true,
1825
+ "autoincrement": false
1826
+ }
1827
+ },
1828
+ "indexes": {},
1829
+ "foreignKeys": {},
1830
+ "compositePrimaryKeys": {},
1831
+ "uniqueConstraints": {},
1832
+ "checkConstraints": {
1833
+ "log_fence_only_row_check": {
1834
+ "name": "log_fence_only_row_check",
1835
+ "value": "\"log_fence\".\"only_row\""
1836
+ }
1837
+ }
1838
+ },
1839
+ "log_tiles": {
1840
+ "name": "log_tiles",
1841
+ "columns": {
1842
+ "tree": {
1843
+ "name": "tree",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": true,
1847
+ "autoincrement": false
1848
+ },
1849
+ "level": {
1850
+ "name": "level",
1851
+ "type": "integer",
1852
+ "primaryKey": false,
1853
+ "notNull": true,
1854
+ "autoincrement": false
1855
+ },
1856
+ "leaf": {
1857
+ "name": "leaf",
1858
+ "type": "integer",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "autoincrement": false
1862
+ },
1863
+ "hashes": {
1864
+ "name": "hashes",
1865
+ "type": "blob",
1866
+ "primaryKey": false,
1867
+ "notNull": true,
1868
+ "autoincrement": false
1869
+ }
1870
+ },
1871
+ "indexes": {},
1872
+ "foreignKeys": {},
1873
+ "compositePrimaryKeys": {
1874
+ "log_tiles_pkey": {
1875
+ "columns": [
1876
+ "tree",
1877
+ "level",
1878
+ "leaf"
1879
+ ],
1880
+ "name": "log_tiles_pkey"
1881
+ }
1882
+ },
1883
+ "uniqueConstraints": {},
1884
+ "checkConstraints": {
1885
+ "log_tiles_tree_check": {
1886
+ "name": "log_tiles_tree_check",
1887
+ "value": "\"log_tiles\".\"tree\" IN ('changes', 'uses')"
1888
+ },
1889
+ "log_tiles_level_check": {
1890
+ "name": "log_tiles_level_check",
1891
+ "value": "\"log_tiles\".\"level\" BETWEEN 0 AND 7"
1892
+ },
1893
+ "log_tiles_leaf_check": {
1894
+ "name": "log_tiles_leaf_check",
1895
+ "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))"
1896
+ },
1897
+ "log_tiles_hashes_check": {
1898
+ "name": "log_tiles_hashes_check",
1899
+ "value": "octet_length(\"log_tiles\".\"hashes\") BETWEEN 32 AND 8192 AND octet_length(\"log_tiles\".\"hashes\") % 32 = 0"
1900
+ }
1901
+ }
1902
+ },
1903
+ "log_uses": {
1904
+ "name": "log_uses",
1905
+ "columns": {
1906
+ "number": {
1907
+ "name": "number",
1908
+ "type": "integer",
1909
+ "primaryKey": false,
1910
+ "notNull": true,
1911
+ "autoincrement": false
1912
+ },
1913
+ "at": {
1914
+ "name": "at",
1915
+ "type": "integer",
1916
+ "primaryKey": false,
1917
+ "notNull": true,
1918
+ "autoincrement": false
1919
+ },
1920
+ "request_id": {
1921
+ "name": "request_id",
1922
+ "type": "integer",
1923
+ "primaryKey": false,
1924
+ "notNull": true,
1925
+ "autoincrement": false
1926
+ },
1927
+ "credential": {
1928
+ "name": "credential",
1929
+ "type": "text",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "autoincrement": false
1933
+ },
1934
+ "secret": {
1935
+ "name": "secret",
1936
+ "type": "text",
1937
+ "primaryKey": false,
1938
+ "notNull": true,
1939
+ "autoincrement": false
1940
+ },
1941
+ "purpose": {
1942
+ "name": "purpose",
1943
+ "type": "integer",
1944
+ "primaryKey": false,
1945
+ "notNull": true,
1946
+ "autoincrement": false
1947
+ },
1948
+ "mac": {
1949
+ "name": "mac",
1950
+ "type": "blob",
1951
+ "primaryKey": false,
1952
+ "notNull": true,
1953
+ "autoincrement": false
1954
+ },
1955
+ "place": {
1956
+ "name": "place",
1957
+ "type": "text",
1958
+ "primaryKey": false,
1959
+ "notNull": false,
1960
+ "autoincrement": false
1961
+ }
1962
+ },
1963
+ "indexes": {
1964
+ "log_uses_request_idx": {
1965
+ "name": "log_uses_request_idx",
1966
+ "columns": [
1967
+ "at",
1968
+ "request_id"
1969
+ ],
1970
+ "isUnique": true
1971
+ }
1972
+ },
1973
+ "foreignKeys": {},
1974
+ "compositePrimaryKeys": {},
1975
+ "uniqueConstraints": {},
1976
+ "checkConstraints": {
1977
+ "log_uses_mac_check": {
1978
+ "name": "log_uses_mac_check",
1979
+ "value": "octet_length(\"log_uses\".\"mac\") = 16"
1980
+ }
1981
+ }
1982
+ },
1983
+ "mcp_approvals": {
1984
+ "name": "mcp_approvals",
1985
+ "columns": {
1986
+ "id": {
1987
+ "name": "id",
1988
+ "type": "text",
1989
+ "primaryKey": true,
1990
+ "notNull": true,
1991
+ "autoincrement": false
1992
+ },
1993
+ "connection_id": {
1994
+ "name": "connection_id",
1995
+ "type": "text",
1996
+ "primaryKey": false,
1997
+ "notNull": true,
1998
+ "autoincrement": false
1999
+ },
2000
+ "tool": {
2001
+ "name": "tool",
2002
+ "type": "text",
2003
+ "primaryKey": false,
2004
+ "notNull": true,
2005
+ "autoincrement": false
2006
+ },
2007
+ "arguments": {
2008
+ "name": "arguments",
2009
+ "type": "text",
2010
+ "primaryKey": false,
2011
+ "notNull": true,
2012
+ "autoincrement": false
2013
+ },
2014
+ "digest": {
2015
+ "name": "digest",
2016
+ "type": "blob",
2017
+ "primaryKey": false,
2018
+ "notNull": true,
2019
+ "autoincrement": false
2020
+ },
2021
+ "status": {
2022
+ "name": "status",
2023
+ "type": "text",
2024
+ "primaryKey": false,
2025
+ "notNull": true,
2026
+ "autoincrement": false,
2027
+ "default": "'pending'"
2028
+ },
2029
+ "outcome": {
2030
+ "name": "outcome",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": false,
2034
+ "autoincrement": false
2035
+ },
2036
+ "created_at": {
2037
+ "name": "created_at",
2038
+ "type": "integer",
2039
+ "primaryKey": false,
2040
+ "notNull": true,
2041
+ "autoincrement": false,
2042
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2043
+ },
2044
+ "expires_at": {
2045
+ "name": "expires_at",
2046
+ "type": "integer",
2047
+ "primaryKey": false,
2048
+ "notNull": true,
2049
+ "autoincrement": false
2050
+ },
2051
+ "decided_at": {
2052
+ "name": "decided_at",
2053
+ "type": "integer",
2054
+ "primaryKey": false,
2055
+ "notNull": false,
2056
+ "autoincrement": false
2057
+ },
2058
+ "reported_at": {
2059
+ "name": "reported_at",
2060
+ "type": "integer",
2061
+ "primaryKey": false,
2062
+ "notNull": false,
2063
+ "autoincrement": false
2064
+ }
2065
+ },
2066
+ "indexes": {
2067
+ "mcp_approvals_open_idx": {
2068
+ "name": "mcp_approvals_open_idx",
2069
+ "columns": [
2070
+ "connection_id",
2071
+ "digest"
2072
+ ],
2073
+ "isUnique": false,
2074
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL"
2075
+ }
2076
+ },
2077
+ "foreignKeys": {
2078
+ "mcp_approvals_connection_fkey": {
2079
+ "name": "mcp_approvals_connection_fkey",
2080
+ "tableFrom": "mcp_approvals",
2081
+ "tableTo": "mcp_connections",
2082
+ "columnsFrom": [
2083
+ "connection_id"
2084
+ ],
2085
+ "columnsTo": [
2086
+ "id"
2087
+ ],
2088
+ "onDelete": "restrict",
2089
+ "onUpdate": "no action"
2090
+ }
2091
+ },
2092
+ "compositePrimaryKeys": {},
2093
+ "uniqueConstraints": {},
2094
+ "checkConstraints": {
2095
+ "mcp_approvals_status_check": {
2096
+ "name": "mcp_approvals_status_check",
2097
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
2098
+ },
2099
+ "mcp_approvals_digest_check": {
2100
+ "name": "mcp_approvals_digest_check",
2101
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
2102
+ },
2103
+ "mcp_approvals_arguments_check": {
2104
+ "name": "mcp_approvals_arguments_check",
2105
+ "value": "json_valid(\"mcp_approvals\".\"arguments\")"
2106
+ }
2107
+ }
2108
+ },
2109
+ "mcp_connections": {
2110
+ "name": "mcp_connections",
2111
+ "columns": {
2112
+ "id": {
2113
+ "name": "id",
2114
+ "type": "text",
2115
+ "primaryKey": true,
2116
+ "notNull": true,
2117
+ "autoincrement": false
2118
+ },
2119
+ "auth_mac": {
2120
+ "name": "auth_mac",
2121
+ "type": "blob",
2122
+ "primaryKey": false,
2123
+ "notNull": true,
2124
+ "autoincrement": false
2125
+ },
2126
+ "principal": {
2127
+ "name": "principal",
2128
+ "type": "text",
2129
+ "primaryKey": false,
2130
+ "notNull": true,
2131
+ "autoincrement": false
2132
+ },
2133
+ "generation": {
2134
+ "name": "generation",
2135
+ "type": "integer",
2136
+ "primaryKey": false,
2137
+ "notNull": true,
2138
+ "autoincrement": false
2139
+ },
2140
+ "client_id": {
2141
+ "name": "client_id",
2142
+ "type": "text",
2143
+ "primaryKey": false,
2144
+ "notNull": true,
2145
+ "autoincrement": false
2146
+ },
2147
+ "client_name": {
2148
+ "name": "client_name",
2149
+ "type": "text",
2150
+ "primaryKey": false,
2151
+ "notNull": true,
2152
+ "autoincrement": false
2153
+ },
2154
+ "client_host": {
2155
+ "name": "client_host",
2156
+ "type": "text",
2157
+ "primaryKey": false,
2158
+ "notNull": false,
2159
+ "autoincrement": false
2160
+ },
2161
+ "registration": {
2162
+ "name": "registration",
2163
+ "type": "text",
2164
+ "primaryKey": false,
2165
+ "notNull": true,
2166
+ "autoincrement": false
2167
+ },
2168
+ "scopes": {
2169
+ "name": "scopes",
2170
+ "type": "text",
2171
+ "primaryKey": false,
2172
+ "notNull": true,
2173
+ "autoincrement": false
2174
+ },
2175
+ "redirect_uri": {
2176
+ "name": "redirect_uri",
2177
+ "type": "text",
2178
+ "primaryKey": false,
2179
+ "notNull": true,
2180
+ "autoincrement": false
2181
+ },
2182
+ "code_hash": {
2183
+ "name": "code_hash",
2184
+ "type": "blob",
2185
+ "primaryKey": false,
2186
+ "notNull": false,
2187
+ "autoincrement": false
2188
+ },
2189
+ "code_challenge": {
2190
+ "name": "code_challenge",
2191
+ "type": "text",
2192
+ "primaryKey": false,
2193
+ "notNull": false,
2194
+ "autoincrement": false
2195
+ },
2196
+ "code_expires_at": {
2197
+ "name": "code_expires_at",
2198
+ "type": "integer",
2199
+ "primaryKey": false,
2200
+ "notNull": false,
2201
+ "autoincrement": false
2202
+ },
2203
+ "refresh_hash": {
2204
+ "name": "refresh_hash",
2205
+ "type": "blob",
2206
+ "primaryKey": false,
2207
+ "notNull": false,
2208
+ "autoincrement": false
2209
+ },
2210
+ "refresh_previous_hash": {
2211
+ "name": "refresh_previous_hash",
2212
+ "type": "blob",
2213
+ "primaryKey": false,
2214
+ "notNull": false,
2215
+ "autoincrement": false
2216
+ },
2217
+ "expires_at": {
2218
+ "name": "expires_at",
2219
+ "type": "integer",
2220
+ "primaryKey": false,
2221
+ "notNull": true,
2222
+ "autoincrement": false
2223
+ },
2224
+ "created_at": {
2225
+ "name": "created_at",
2226
+ "type": "integer",
2227
+ "primaryKey": false,
2228
+ "notNull": true,
2229
+ "autoincrement": false,
2230
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2231
+ },
2232
+ "last_used_at": {
2233
+ "name": "last_used_at",
2234
+ "type": "integer",
2235
+ "primaryKey": false,
2236
+ "notNull": false,
2237
+ "autoincrement": false
2238
+ },
2239
+ "last_used_ip": {
2240
+ "name": "last_used_ip",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": false,
2244
+ "autoincrement": false
2245
+ },
2246
+ "revoked_at": {
2247
+ "name": "revoked_at",
2248
+ "type": "integer",
2249
+ "primaryKey": false,
2250
+ "notNull": false,
2251
+ "autoincrement": false
2252
+ },
2253
+ "revoked_by": {
2254
+ "name": "revoked_by",
2255
+ "type": "text",
2256
+ "primaryKey": false,
2257
+ "notNull": false,
2258
+ "autoincrement": false
2259
+ },
2260
+ "seal": {
2261
+ "name": "seal",
2262
+ "type": "blob",
2263
+ "primaryKey": false,
2264
+ "notNull": false,
2265
+ "autoincrement": false
2266
+ }
2267
+ },
2268
+ "indexes": {
2269
+ "mcp_connections_refresh_previous_idx": {
2270
+ "name": "mcp_connections_refresh_previous_idx",
2271
+ "columns": [
2272
+ "refresh_previous_hash"
2273
+ ],
2274
+ "isUnique": false
2275
+ },
2276
+ "mcp_connections_live_idx": {
2277
+ "name": "mcp_connections_live_idx",
2278
+ "columns": [
2279
+ "principal",
2280
+ "expires_at"
2281
+ ],
2282
+ "isUnique": false,
2283
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL"
2284
+ },
2285
+ "mcp_connections_code_hash_key": {
2286
+ "name": "mcp_connections_code_hash_key",
2287
+ "columns": [
2288
+ "code_hash"
2289
+ ],
2290
+ "isUnique": true
2291
+ },
2292
+ "mcp_connections_refresh_hash_key": {
2293
+ "name": "mcp_connections_refresh_hash_key",
2294
+ "columns": [
2295
+ "refresh_hash"
2296
+ ],
2297
+ "isUnique": true
2298
+ }
2299
+ },
2300
+ "foreignKeys": {
2301
+ "mcp_connections_principal_fkey": {
2302
+ "name": "mcp_connections_principal_fkey",
2303
+ "tableFrom": "mcp_connections",
2304
+ "tableTo": "vault_members",
2305
+ "columnsFrom": [
2306
+ "principal"
2307
+ ],
2308
+ "columnsTo": [
2309
+ "principal"
2310
+ ],
2311
+ "onDelete": "restrict",
2312
+ "onUpdate": "no action"
2313
+ }
2314
+ },
2315
+ "compositePrimaryKeys": {},
2316
+ "uniqueConstraints": {},
2317
+ "checkConstraints": {
2318
+ "mcp_connections_seal_check": {
2319
+ "name": "mcp_connections_seal_check",
2320
+ "value": "\"mcp_connections\".\"seal\" IS NULL OR octet_length(\"mcp_connections\".\"seal\") = 16"
2321
+ },
2322
+ "mcp_connections_principal_check": {
2323
+ "name": "mcp_connections_principal_check",
2324
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
2325
+ },
2326
+ "mcp_connections_registration_check": {
2327
+ "name": "mcp_connections_registration_check",
2328
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
2329
+ },
2330
+ "mcp_connections_auth_mac_check": {
2331
+ "name": "mcp_connections_auth_mac_check",
2332
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
2333
+ },
2334
+ "mcp_connections_code_hash_check": {
2335
+ "name": "mcp_connections_code_hash_check",
2336
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
2337
+ },
2338
+ "mcp_connections_refresh_hash_check": {
2339
+ "name": "mcp_connections_refresh_hash_check",
2340
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
2341
+ }
2342
+ }
2343
+ },
2344
+ "oauth_clients": {
2345
+ "name": "oauth_clients",
2346
+ "columns": {
2347
+ "id": {
2348
+ "name": "id",
2349
+ "type": "text",
2350
+ "primaryKey": true,
2351
+ "notNull": true,
2352
+ "autoincrement": false
2353
+ },
2354
+ "auth_mac": {
2355
+ "name": "auth_mac",
2356
+ "type": "blob",
2357
+ "primaryKey": false,
2358
+ "notNull": true,
2359
+ "autoincrement": false
2360
+ },
2361
+ "name": {
2362
+ "name": "name",
2363
+ "type": "text",
2364
+ "primaryKey": false,
2365
+ "notNull": true,
2366
+ "autoincrement": false
2367
+ },
2368
+ "redirect_uris": {
2369
+ "name": "redirect_uris",
2370
+ "type": "text",
2371
+ "primaryKey": false,
2372
+ "notNull": true,
2373
+ "autoincrement": false
2374
+ },
2375
+ "created_at": {
2376
+ "name": "created_at",
2377
+ "type": "integer",
2378
+ "primaryKey": false,
2379
+ "notNull": true,
2380
+ "autoincrement": false,
2381
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2382
+ },
2383
+ "created_ip": {
2384
+ "name": "created_ip",
2385
+ "type": "text",
2386
+ "primaryKey": false,
2387
+ "notNull": false,
2388
+ "autoincrement": false
2389
+ },
2390
+ "revoked_at": {
2391
+ "name": "revoked_at",
2392
+ "type": "integer",
2393
+ "primaryKey": false,
2394
+ "notNull": false,
2395
+ "autoincrement": false
2396
+ }
2397
+ },
2398
+ "indexes": {},
2399
+ "foreignKeys": {},
2400
+ "compositePrimaryKeys": {},
2401
+ "uniqueConstraints": {},
2402
+ "checkConstraints": {
2403
+ "oauth_clients_auth_mac_check": {
2404
+ "name": "oauth_clients_auth_mac_check",
2405
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
2406
+ },
2407
+ "oauth_clients_redirect_uris_check": {
2408
+ "name": "oauth_clients_redirect_uris_check",
2409
+ "value": "json_valid(\"oauth_clients\".\"redirect_uris\")"
2410
+ }
2411
+ }
2412
+ },
2413
+ "projects": {
2414
+ "name": "projects",
2415
+ "columns": {
2416
+ "id": {
2417
+ "name": "id",
2418
+ "type": "text",
2419
+ "primaryKey": true,
2420
+ "notNull": true,
2421
+ "autoincrement": false
2422
+ },
2423
+ "slug": {
2424
+ "name": "slug",
2425
+ "type": "text",
2426
+ "primaryKey": false,
2427
+ "notNull": true,
2428
+ "autoincrement": false
2429
+ },
2430
+ "name": {
2431
+ "name": "name",
2432
+ "type": "text",
2433
+ "primaryKey": false,
2434
+ "notNull": true,
2435
+ "autoincrement": false
2436
+ },
2437
+ "created_at": {
2438
+ "name": "created_at",
2439
+ "type": "integer",
2440
+ "primaryKey": false,
2441
+ "notNull": true,
2442
+ "autoincrement": false,
2443
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2444
+ },
2445
+ "archived_at": {
2446
+ "name": "archived_at",
2447
+ "type": "integer",
2448
+ "primaryKey": false,
2449
+ "notNull": false,
2450
+ "autoincrement": false
2451
+ },
2452
+ "folder": {
2453
+ "name": "folder",
2454
+ "type": "text",
2455
+ "primaryKey": false,
2456
+ "notNull": false,
2457
+ "autoincrement": false
2458
+ }
2459
+ },
2460
+ "indexes": {
2461
+ "projects_slug_key": {
2462
+ "name": "projects_slug_key",
2463
+ "columns": [
2464
+ "slug"
2465
+ ],
2466
+ "isUnique": true
2467
+ }
2468
+ },
2469
+ "foreignKeys": {},
2470
+ "compositePrimaryKeys": {},
2471
+ "uniqueConstraints": {},
2472
+ "checkConstraints": {
2473
+ "projects_slug_check": {
2474
+ "name": "projects_slug_check",
2475
+ "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-]*')"
2476
+ },
2477
+ "projects_folder_check": {
2478
+ "name": "projects_folder_check",
2479
+ "value": "\"projects\".\"folder\" IS NULL OR (length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" NOT GLOB '*/*' AND \"projects\".\"folder\" = trim(\"projects\".\"folder\"))"
2480
+ }
2481
+ }
2482
+ },
2483
+ "secret_references": {
2484
+ "name": "secret_references",
2485
+ "columns": {
2486
+ "id": {
2487
+ "name": "id",
2488
+ "type": "text",
2489
+ "primaryKey": true,
2490
+ "notNull": true,
2491
+ "autoincrement": false
2492
+ },
2493
+ "project_id": {
2494
+ "name": "project_id",
2495
+ "type": "text",
2496
+ "primaryKey": false,
2497
+ "notNull": true,
2498
+ "autoincrement": false
2499
+ },
2500
+ "environment_id": {
2501
+ "name": "environment_id",
2502
+ "type": "text",
2503
+ "primaryKey": false,
2504
+ "notNull": true,
2505
+ "autoincrement": false
2506
+ },
2507
+ "secret_id": {
2508
+ "name": "secret_id",
2509
+ "type": "text",
2510
+ "primaryKey": false,
2511
+ "notNull": true,
2512
+ "autoincrement": false
2513
+ },
2514
+ "source_project_id": {
2515
+ "name": "source_project_id",
2516
+ "type": "text",
2517
+ "primaryKey": false,
2518
+ "notNull": true,
2519
+ "autoincrement": false
2520
+ },
2521
+ "source_environment_id": {
2522
+ "name": "source_environment_id",
2523
+ "type": "text",
2524
+ "primaryKey": false,
2525
+ "notNull": true,
2526
+ "autoincrement": false
2527
+ },
2528
+ "source_secret_id": {
2529
+ "name": "source_secret_id",
2530
+ "type": "text",
2531
+ "primaryKey": false,
2532
+ "notNull": true,
2533
+ "autoincrement": false
2534
+ },
2535
+ "created_seq": {
2536
+ "name": "created_seq",
2537
+ "type": "integer",
2538
+ "primaryKey": false,
2539
+ "notNull": true,
2540
+ "autoincrement": false
2541
+ },
2542
+ "created_at": {
2543
+ "name": "created_at",
2544
+ "type": "integer",
2545
+ "primaryKey": false,
2546
+ "notNull": true,
2547
+ "autoincrement": false,
2548
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2549
+ },
2550
+ "created_by": {
2551
+ "name": "created_by",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": true,
2555
+ "autoincrement": false
2556
+ },
2557
+ "ended_at": {
2558
+ "name": "ended_at",
2559
+ "type": "integer",
2560
+ "primaryKey": false,
2561
+ "notNull": false,
2562
+ "autoincrement": false
2563
+ }
2564
+ },
2565
+ "indexes": {
2566
+ "secret_references_holder_idx": {
2567
+ "name": "secret_references_holder_idx",
2568
+ "columns": [
2569
+ "secret_id",
2570
+ "created_seq"
2571
+ ],
2572
+ "isUnique": false
2573
+ },
2574
+ "secret_references_source_idx": {
2575
+ "name": "secret_references_source_idx",
2576
+ "columns": [
2577
+ "source_secret_id"
2578
+ ],
2579
+ "isUnique": false
2580
+ },
2581
+ "secret_references_project_idx": {
2582
+ "name": "secret_references_project_idx",
2583
+ "columns": [
2584
+ "project_id"
2585
+ ],
2586
+ "isUnique": false
2587
+ },
2588
+ "secret_references_source_project_idx": {
2589
+ "name": "secret_references_source_project_idx",
2590
+ "columns": [
2591
+ "source_project_id"
2592
+ ],
2593
+ "isUnique": false
2594
+ },
2595
+ "secret_references_created_by_idx": {
2596
+ "name": "secret_references_created_by_idx",
2597
+ "columns": [
2598
+ "created_by"
2599
+ ],
2600
+ "isUnique": false
2601
+ },
2602
+ "secret_references_created_seq_key": {
2603
+ "name": "secret_references_created_seq_key",
2604
+ "columns": [
2605
+ "created_seq"
2606
+ ],
2607
+ "isUnique": true
2608
+ }
2609
+ },
2610
+ "foreignKeys": {
2611
+ "secret_references_secret_id_fkey": {
2612
+ "name": "secret_references_secret_id_fkey",
2613
+ "tableFrom": "secret_references",
2614
+ "tableTo": "secrets",
2615
+ "columnsFrom": [
2616
+ "secret_id"
2617
+ ],
2618
+ "columnsTo": [
2619
+ "id"
2620
+ ],
2621
+ "onDelete": "restrict",
2622
+ "onUpdate": "no action"
2623
+ },
2624
+ "secret_references_source_secret_id_fkey": {
2625
+ "name": "secret_references_source_secret_id_fkey",
2626
+ "tableFrom": "secret_references",
2627
+ "tableTo": "secrets",
2628
+ "columnsFrom": [
2629
+ "source_secret_id"
2630
+ ],
2631
+ "columnsTo": [
2632
+ "id"
2633
+ ],
2634
+ "onDelete": "restrict",
2635
+ "onUpdate": "no action"
2636
+ },
2637
+ "secret_references_created_seq_fkey": {
2638
+ "name": "secret_references_created_seq_fkey",
2639
+ "tableFrom": "secret_references",
2640
+ "tableTo": "audit_log",
2641
+ "columnsFrom": [
2642
+ "created_seq"
2643
+ ],
2644
+ "columnsTo": [
2645
+ "seq"
2646
+ ],
2647
+ "onDelete": "restrict",
2648
+ "onUpdate": "no action"
2649
+ }
2650
+ },
2651
+ "compositePrimaryKeys": {},
2652
+ "uniqueConstraints": {},
2653
+ "checkConstraints": {}
2654
+ },
2655
+ "secret_versions": {
2656
+ "name": "secret_versions",
2657
+ "columns": {
2658
+ "id": {
2659
+ "name": "id",
2660
+ "type": "text",
2661
+ "primaryKey": true,
2662
+ "notNull": true,
2663
+ "autoincrement": false
2664
+ },
2665
+ "secret_id": {
2666
+ "name": "secret_id",
2667
+ "type": "text",
2668
+ "primaryKey": false,
2669
+ "notNull": true,
2670
+ "autoincrement": false
2671
+ },
2672
+ "version": {
2673
+ "name": "version",
2674
+ "type": "integer",
2675
+ "primaryKey": false,
2676
+ "notNull": true,
2677
+ "autoincrement": false
2678
+ },
2679
+ "envelope_version": {
2680
+ "name": "envelope_version",
2681
+ "type": "integer",
2682
+ "primaryKey": false,
2683
+ "notNull": true,
2684
+ "autoincrement": false
2685
+ },
2686
+ "ciphertext": {
2687
+ "name": "ciphertext",
2688
+ "type": "blob",
2689
+ "primaryKey": false,
2690
+ "notNull": true,
2691
+ "autoincrement": false
2692
+ },
2693
+ "iv": {
2694
+ "name": "iv",
2695
+ "type": "blob",
2696
+ "primaryKey": false,
2697
+ "notNull": true,
2698
+ "autoincrement": false
2699
+ },
2700
+ "auth_tag": {
2701
+ "name": "auth_tag",
2702
+ "type": "blob",
2703
+ "primaryKey": false,
2704
+ "notNull": true,
2705
+ "autoincrement": false
2706
+ },
2707
+ "wrapped_dek": {
2708
+ "name": "wrapped_dek",
2709
+ "type": "blob",
2710
+ "primaryKey": false,
2711
+ "notNull": true,
2712
+ "autoincrement": false
2713
+ },
2714
+ "kek_provider": {
2715
+ "name": "kek_provider",
2716
+ "type": "text",
2717
+ "primaryKey": false,
2718
+ "notNull": true,
2719
+ "autoincrement": false
2720
+ },
2721
+ "kek_id": {
2722
+ "name": "kek_id",
2723
+ "type": "text",
2724
+ "primaryKey": false,
2725
+ "notNull": true,
2726
+ "autoincrement": false
2727
+ },
2728
+ "kek_version": {
2729
+ "name": "kek_version",
2730
+ "type": "text",
2731
+ "primaryKey": false,
2732
+ "notNull": true,
2733
+ "autoincrement": false
2734
+ },
2735
+ "created_at": {
2736
+ "name": "created_at",
2737
+ "type": "integer",
2738
+ "primaryKey": false,
2739
+ "notNull": true,
2740
+ "autoincrement": false,
2741
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2742
+ },
2743
+ "created_by": {
2744
+ "name": "created_by",
2745
+ "type": "text",
2746
+ "primaryKey": false,
2747
+ "notNull": true,
2748
+ "autoincrement": false
2749
+ },
2750
+ "recipe": {
2751
+ "name": "recipe",
2752
+ "type": "text",
2753
+ "primaryKey": false,
2754
+ "notNull": false,
2755
+ "autoincrement": false
2756
+ },
2757
+ "pair_id": {
2758
+ "name": "pair_id",
2759
+ "type": "text",
2760
+ "primaryKey": false,
2761
+ "notNull": false,
2762
+ "autoincrement": false
2763
+ },
2764
+ "pair_half": {
2765
+ "name": "pair_half",
2766
+ "type": "text",
2767
+ "primaryKey": false,
2768
+ "notNull": false,
2769
+ "autoincrement": false
2770
+ },
2771
+ "plaintext": {
2772
+ "name": "plaintext",
2773
+ "type": "text",
2774
+ "primaryKey": false,
2775
+ "notNull": false,
2776
+ "autoincrement": false
2777
+ },
2778
+ "sensitive": {
2779
+ "name": "sensitive",
2780
+ "type": "integer",
2781
+ "primaryKey": false,
2782
+ "notNull": true,
2783
+ "autoincrement": false,
2784
+ "default": false
2785
+ }
2786
+ },
2787
+ "indexes": {
2788
+ "secret_versions_secret_idx": {
2789
+ "name": "secret_versions_secret_idx",
2790
+ "columns": [
2791
+ "secret_id",
2792
+ "version"
2793
+ ],
2794
+ "isUnique": false
2795
+ },
2796
+ "secret_versions_secret_id_version_key": {
2797
+ "name": "secret_versions_secret_id_version_key",
2798
+ "columns": [
2799
+ "secret_id",
2800
+ "version"
2801
+ ],
2802
+ "isUnique": true
2803
+ }
2804
+ },
2805
+ "foreignKeys": {
2806
+ "secret_versions_secret_id_fkey": {
2807
+ "name": "secret_versions_secret_id_fkey",
2808
+ "tableFrom": "secret_versions",
2809
+ "tableTo": "secrets",
2810
+ "columnsFrom": [
2811
+ "secret_id"
2812
+ ],
2813
+ "columnsTo": [
2814
+ "id"
2815
+ ],
2816
+ "onDelete": "restrict",
2817
+ "onUpdate": "no action"
2818
+ }
2819
+ },
2820
+ "compositePrimaryKeys": {},
2821
+ "uniqueConstraints": {},
2822
+ "checkConstraints": {
2823
+ "secret_versions_version_check": {
2824
+ "name": "secret_versions_version_check",
2825
+ "value": "\"secret_versions\".\"version\" > 0"
2826
+ },
2827
+ "secret_versions_iv_check": {
2828
+ "name": "secret_versions_iv_check",
2829
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
2830
+ },
2831
+ "secret_versions_auth_tag_check": {
2832
+ "name": "secret_versions_auth_tag_check",
2833
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
2834
+ }
2835
+ }
2836
+ },
2837
+ "secrets": {
2838
+ "name": "secrets",
2839
+ "columns": {
2840
+ "id": {
2841
+ "name": "id",
2842
+ "type": "text",
2843
+ "primaryKey": true,
2844
+ "notNull": true,
2845
+ "autoincrement": false
2846
+ },
2847
+ "project_id": {
2848
+ "name": "project_id",
2849
+ "type": "text",
2850
+ "primaryKey": false,
2851
+ "notNull": true,
2852
+ "autoincrement": false
2853
+ },
2854
+ "environment_id": {
2855
+ "name": "environment_id",
2856
+ "type": "text",
2857
+ "primaryKey": false,
2858
+ "notNull": true,
2859
+ "autoincrement": false
2860
+ },
2861
+ "key": {
2862
+ "name": "key",
2863
+ "type": "text",
2864
+ "primaryKey": false,
2865
+ "notNull": true,
2866
+ "autoincrement": false
2867
+ },
2868
+ "created_at": {
2869
+ "name": "created_at",
2870
+ "type": "integer",
2871
+ "primaryKey": false,
2872
+ "notNull": true,
2873
+ "autoincrement": false,
2874
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2875
+ },
2876
+ "updated_at": {
2877
+ "name": "updated_at",
2878
+ "type": "integer",
2879
+ "primaryKey": false,
2880
+ "notNull": true,
2881
+ "autoincrement": false,
2882
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2883
+ },
2884
+ "current_version_id": {
2885
+ "name": "current_version_id",
2886
+ "type": "text",
2887
+ "primaryKey": false,
2888
+ "notNull": false,
2889
+ "autoincrement": false
2890
+ },
2891
+ "current_version": {
2892
+ "name": "current_version",
2893
+ "type": "integer",
2894
+ "primaryKey": false,
2895
+ "notNull": true,
2896
+ "autoincrement": false,
2897
+ "default": 0
2898
+ },
2899
+ "archived_at": {
2900
+ "name": "archived_at",
2901
+ "type": "integer",
2902
+ "primaryKey": false,
2903
+ "notNull": false,
2904
+ "autoincrement": false
2905
+ },
2906
+ "folder": {
2907
+ "name": "folder",
2908
+ "type": "text",
2909
+ "primaryKey": false,
2910
+ "notNull": false,
2911
+ "autoincrement": false
2912
+ },
2913
+ "seal": {
2914
+ "name": "seal",
2915
+ "type": "blob",
2916
+ "primaryKey": false,
2917
+ "notNull": false,
2918
+ "autoincrement": false
2919
+ }
2920
+ },
2921
+ "indexes": {
2922
+ "secrets_lookup_idx": {
2923
+ "name": "secrets_lookup_idx",
2924
+ "columns": [
2925
+ "project_id",
2926
+ "environment_id",
2927
+ "key"
2928
+ ],
2929
+ "isUnique": false
2930
+ },
2931
+ "secrets_live_idx": {
2932
+ "name": "secrets_live_idx",
2933
+ "columns": [
2934
+ "environment_id"
2935
+ ],
2936
+ "isUnique": false,
2937
+ "where": "\"secrets\".\"archived_at\" IS NULL"
2938
+ },
2939
+ "secrets_project_id_environment_id_key_key": {
2940
+ "name": "secrets_project_id_environment_id_key_key",
2941
+ "columns": [
2942
+ "project_id",
2943
+ "environment_id",
2944
+ "key"
2945
+ ],
2946
+ "isUnique": true
2947
+ }
2948
+ },
2949
+ "foreignKeys": {
2950
+ "secrets_current_version_id_secret_versions_id_fk": {
2951
+ "name": "secrets_current_version_id_secret_versions_id_fk",
2952
+ "tableFrom": "secrets",
2953
+ "tableTo": "secret_versions",
2954
+ "columnsFrom": [
2955
+ "current_version_id"
2956
+ ],
2957
+ "columnsTo": [
2958
+ "id"
2959
+ ],
2960
+ "onDelete": "no action",
2961
+ "onUpdate": "no action"
2962
+ },
2963
+ "secrets_project_id_fkey": {
2964
+ "name": "secrets_project_id_fkey",
2965
+ "tableFrom": "secrets",
2966
+ "tableTo": "projects",
2967
+ "columnsFrom": [
2968
+ "project_id"
2969
+ ],
2970
+ "columnsTo": [
2971
+ "id"
2972
+ ],
2973
+ "onDelete": "restrict",
2974
+ "onUpdate": "no action"
2975
+ },
2976
+ "secrets_environment_id_fkey": {
2977
+ "name": "secrets_environment_id_fkey",
2978
+ "tableFrom": "secrets",
2979
+ "tableTo": "environments",
2980
+ "columnsFrom": [
2981
+ "environment_id"
2982
+ ],
2983
+ "columnsTo": [
2984
+ "id"
2985
+ ],
2986
+ "onDelete": "restrict",
2987
+ "onUpdate": "no action"
2988
+ },
2989
+ "secrets_environment_in_project": {
2990
+ "name": "secrets_environment_in_project",
2991
+ "tableFrom": "secrets",
2992
+ "tableTo": "environments",
2993
+ "columnsFrom": [
2994
+ "environment_id",
2995
+ "project_id"
2996
+ ],
2997
+ "columnsTo": [
2998
+ "id",
2999
+ "project_id"
3000
+ ],
3001
+ "onDelete": "no action",
3002
+ "onUpdate": "no action"
3003
+ }
3004
+ },
3005
+ "compositePrimaryKeys": {},
3006
+ "uniqueConstraints": {},
3007
+ "checkConstraints": {
3008
+ "secrets_seal_check": {
3009
+ "name": "secrets_seal_check",
3010
+ "value": "\"secrets\".\"seal\" IS NULL OR octet_length(\"secrets\".\"seal\") = 16"
3011
+ },
3012
+ "secrets_key_check": {
3013
+ "name": "secrets_key_check",
3014
+ "value": "length(\"secrets\".\"key\") BETWEEN 1 AND 128 AND \"secrets\".\"key\" GLOB '[A-Za-z_]*' AND \"secrets\".\"key\" NOT GLOB '*[^A-Za-z0-9_]*'"
3015
+ },
3016
+ "secrets_folder_check": {
3017
+ "name": "secrets_folder_check",
3018
+ "value": "\"secrets\".\"folder\" IS NULL OR (length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" NOT GLOB '*/*' AND \"secrets\".\"folder\" = trim(\"secrets\".\"folder\"))"
3019
+ }
3020
+ }
3021
+ },
3022
+ "service_bindings": {
3023
+ "name": "service_bindings",
3024
+ "columns": {
3025
+ "id": {
3026
+ "name": "id",
3027
+ "type": "text",
3028
+ "primaryKey": true,
3029
+ "notNull": true,
3030
+ "autoincrement": false
3031
+ },
3032
+ "auth_mac": {
3033
+ "name": "auth_mac",
3034
+ "type": "blob",
3035
+ "primaryKey": false,
3036
+ "notNull": true,
3037
+ "autoincrement": false
3038
+ },
3039
+ "principal": {
3040
+ "name": "principal",
3041
+ "type": "text",
3042
+ "primaryKey": false,
3043
+ "notNull": true,
3044
+ "autoincrement": false
3045
+ },
3046
+ "generation": {
3047
+ "name": "generation",
3048
+ "type": "integer",
3049
+ "primaryKey": false,
3050
+ "notNull": true,
3051
+ "autoincrement": false
3052
+ },
3053
+ "profile": {
3054
+ "name": "profile",
3055
+ "type": "text",
3056
+ "primaryKey": false,
3057
+ "notNull": true,
3058
+ "autoincrement": false
3059
+ },
3060
+ "issuer": {
3061
+ "name": "issuer",
3062
+ "type": "text",
3063
+ "primaryKey": false,
3064
+ "notNull": true,
3065
+ "autoincrement": false
3066
+ },
3067
+ "jwks_uri": {
3068
+ "name": "jwks_uri",
3069
+ "type": "text",
3070
+ "primaryKey": false,
3071
+ "notNull": true,
3072
+ "autoincrement": false
3073
+ },
3074
+ "jwks": {
3075
+ "name": "jwks",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": false,
3079
+ "autoincrement": false
3080
+ },
3081
+ "claims": {
3082
+ "name": "claims",
3083
+ "type": "text",
3084
+ "primaryKey": false,
3085
+ "notNull": true,
3086
+ "autoincrement": false
3087
+ },
3088
+ "scope": {
3089
+ "name": "scope",
3090
+ "type": "text",
3091
+ "primaryKey": false,
3092
+ "notNull": false,
3093
+ "autoincrement": false
3094
+ },
3095
+ "policy": {
3096
+ "name": "policy",
3097
+ "type": "text",
3098
+ "primaryKey": false,
3099
+ "notNull": false,
3100
+ "autoincrement": false
3101
+ },
3102
+ "origin": {
3103
+ "name": "origin",
3104
+ "type": "text",
3105
+ "primaryKey": false,
3106
+ "notNull": false,
3107
+ "autoincrement": false
3108
+ },
3109
+ "label": {
3110
+ "name": "label",
3111
+ "type": "text",
3112
+ "primaryKey": false,
3113
+ "notNull": false,
3114
+ "autoincrement": false
3115
+ },
3116
+ "created_at": {
3117
+ "name": "created_at",
3118
+ "type": "integer",
3119
+ "primaryKey": false,
3120
+ "notNull": true,
3121
+ "autoincrement": false,
3122
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
3123
+ },
3124
+ "created_by": {
3125
+ "name": "created_by",
3126
+ "type": "text",
3127
+ "primaryKey": false,
3128
+ "notNull": true,
3129
+ "autoincrement": false
3130
+ },
3131
+ "last_used_at": {
3132
+ "name": "last_used_at",
3133
+ "type": "integer",
3134
+ "primaryKey": false,
3135
+ "notNull": false,
3136
+ "autoincrement": false
3137
+ },
3138
+ "revoked_at": {
3139
+ "name": "revoked_at",
3140
+ "type": "integer",
3141
+ "primaryKey": false,
3142
+ "notNull": false,
3143
+ "autoincrement": false
3144
+ },
3145
+ "revoked_by": {
3146
+ "name": "revoked_by",
3147
+ "type": "text",
3148
+ "primaryKey": false,
3149
+ "notNull": false,
3150
+ "autoincrement": false
3151
+ },
3152
+ "seal": {
3153
+ "name": "seal",
3154
+ "type": "blob",
3155
+ "primaryKey": false,
3156
+ "notNull": false,
3157
+ "autoincrement": false
3158
+ }
3159
+ },
3160
+ "indexes": {
3161
+ "service_bindings_principal_idx": {
3162
+ "name": "service_bindings_principal_idx",
3163
+ "columns": [
3164
+ "principal",
3165
+ "issuer"
3166
+ ],
3167
+ "isUnique": false
3168
+ },
3169
+ "service_bindings_live_idx": {
3170
+ "name": "service_bindings_live_idx",
3171
+ "columns": [
3172
+ "principal",
3173
+ "issuer",
3174
+ "generation",
3175
+ "created_at",
3176
+ "id"
3177
+ ],
3178
+ "isUnique": false,
3179
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL"
3180
+ }
3181
+ },
3182
+ "foreignKeys": {
3183
+ "service_bindings_principal_fkey": {
3184
+ "name": "service_bindings_principal_fkey",
3185
+ "tableFrom": "service_bindings",
3186
+ "tableTo": "vault_members",
3187
+ "columnsFrom": [
3188
+ "principal"
3189
+ ],
3190
+ "columnsTo": [
3191
+ "principal"
3192
+ ],
3193
+ "onDelete": "restrict",
3194
+ "onUpdate": "no action"
3195
+ }
3196
+ },
3197
+ "compositePrimaryKeys": {},
3198
+ "uniqueConstraints": {},
3199
+ "checkConstraints": {
3200
+ "service_bindings_seal_check": {
3201
+ "name": "service_bindings_seal_check",
3202
+ "value": "\"service_bindings\".\"seal\" IS NULL OR octet_length(\"service_bindings\".\"seal\") = 16"
3203
+ },
3204
+ "service_bindings_principal_check": {
3205
+ "name": "service_bindings_principal_check",
3206
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
3207
+ },
3208
+ "service_bindings_auth_mac_check": {
3209
+ "name": "service_bindings_auth_mac_check",
3210
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
3211
+ },
3212
+ "service_bindings_claims_check": {
3213
+ "name": "service_bindings_claims_check",
3214
+ "value": "json_valid(\"service_bindings\".\"claims\")"
3215
+ }
3216
+ }
3217
+ },
3218
+ "vault_grants": {
3219
+ "name": "vault_grants",
3220
+ "columns": {
3221
+ "principal": {
3222
+ "name": "principal",
3223
+ "type": "text",
3224
+ "primaryKey": false,
3225
+ "notNull": true,
3226
+ "autoincrement": false
3227
+ },
3228
+ "project_id": {
3229
+ "name": "project_id",
3230
+ "type": "text",
3231
+ "primaryKey": false,
3232
+ "notNull": false,
3233
+ "autoincrement": false
3234
+ },
3235
+ "environment_id": {
3236
+ "name": "environment_id",
3237
+ "type": "text",
3238
+ "primaryKey": false,
3239
+ "notNull": false,
3240
+ "autoincrement": false
3241
+ },
3242
+ "environment_slug": {
3243
+ "name": "environment_slug",
3244
+ "type": "text",
3245
+ "primaryKey": false,
3246
+ "notNull": false,
3247
+ "autoincrement": false
3248
+ },
3249
+ "role": {
3250
+ "name": "role",
3251
+ "type": "text",
3252
+ "primaryKey": false,
3253
+ "notNull": true,
3254
+ "autoincrement": false
3255
+ },
3256
+ "expires_at": {
3257
+ "name": "expires_at",
3258
+ "type": "integer",
3259
+ "primaryKey": false,
3260
+ "notNull": false,
3261
+ "autoincrement": false
3262
+ },
3263
+ "granted_at": {
3264
+ "name": "granted_at",
3265
+ "type": "integer",
3266
+ "primaryKey": false,
3267
+ "notNull": true,
3268
+ "autoincrement": false
3269
+ },
3270
+ "granted_by": {
3271
+ "name": "granted_by",
3272
+ "type": "text",
3273
+ "primaryKey": false,
3274
+ "notNull": true,
3275
+ "autoincrement": false
3276
+ }
3277
+ },
3278
+ "indexes": {
3279
+ "vault_grants_on_every_project": {
3280
+ "name": "vault_grants_on_every_project",
3281
+ "columns": [
3282
+ "principal"
3283
+ ],
3284
+ "isUnique": true,
3285
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL"
3286
+ },
3287
+ "vault_grants_on_project": {
3288
+ "name": "vault_grants_on_project",
3289
+ "columns": [
3290
+ "principal",
3291
+ "project_id"
3292
+ ],
3293
+ "isUnique": true
3294
+ },
3295
+ "vault_grants_on_environment": {
3296
+ "name": "vault_grants_on_environment",
3297
+ "columns": [
3298
+ "principal",
3299
+ "environment_id"
3300
+ ],
3301
+ "isUnique": true
3302
+ },
3303
+ "vault_grants_on_environment_slug": {
3304
+ "name": "vault_grants_on_environment_slug",
3305
+ "columns": [
3306
+ "principal",
3307
+ "environment_slug"
3308
+ ],
3309
+ "isUnique": true
3310
+ }
3311
+ },
3312
+ "foreignKeys": {
3313
+ "vault_grants_principal_fkey": {
3314
+ "name": "vault_grants_principal_fkey",
3315
+ "tableFrom": "vault_grants",
3316
+ "tableTo": "vault_members",
3317
+ "columnsFrom": [
3318
+ "principal"
3319
+ ],
3320
+ "columnsTo": [
3321
+ "principal"
3322
+ ],
3323
+ "onDelete": "restrict",
3324
+ "onUpdate": "no action"
3325
+ },
3326
+ "vault_grants_project_id_fkey": {
3327
+ "name": "vault_grants_project_id_fkey",
3328
+ "tableFrom": "vault_grants",
3329
+ "tableTo": "projects",
3330
+ "columnsFrom": [
3331
+ "project_id"
3332
+ ],
3333
+ "columnsTo": [
3334
+ "id"
3335
+ ],
3336
+ "onDelete": "restrict",
3337
+ "onUpdate": "no action"
3338
+ },
3339
+ "vault_grants_environment_id_fkey": {
3340
+ "name": "vault_grants_environment_id_fkey",
3341
+ "tableFrom": "vault_grants",
3342
+ "tableTo": "environments",
3343
+ "columnsFrom": [
3344
+ "environment_id"
3345
+ ],
3346
+ "columnsTo": [
3347
+ "id"
3348
+ ],
3349
+ "onDelete": "restrict",
3350
+ "onUpdate": "no action"
3351
+ }
3352
+ },
3353
+ "compositePrimaryKeys": {},
3354
+ "uniqueConstraints": {},
3355
+ "checkConstraints": {
3356
+ "vault_grants_one_place": {
3357
+ "name": "vault_grants_one_place",
3358
+ "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)"
3359
+ },
3360
+ "vault_grants_environment_slug_check": {
3361
+ "name": "vault_grants_environment_slug_check",
3362
+ "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-]*')"
3363
+ },
3364
+ "vault_grants_role_check": {
3365
+ "name": "vault_grants_role_check",
3366
+ "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-]*'"
3367
+ }
3368
+ }
3369
+ },
3370
+ "vault_members": {
3371
+ "name": "vault_members",
3372
+ "columns": {
3373
+ "principal": {
3374
+ "name": "principal",
3375
+ "type": "text",
3376
+ "primaryKey": true,
3377
+ "notNull": true,
3378
+ "autoincrement": false
3379
+ },
3380
+ "status": {
3381
+ "name": "status",
3382
+ "type": "text",
3383
+ "primaryKey": false,
3384
+ "notNull": true,
3385
+ "autoincrement": false
3386
+ },
3387
+ "owner": {
3388
+ "name": "owner",
3389
+ "type": "integer",
3390
+ "primaryKey": false,
3391
+ "notNull": true,
3392
+ "autoincrement": false,
3393
+ "default": false
3394
+ },
3395
+ "role": {
3396
+ "name": "role",
3397
+ "type": "text",
3398
+ "primaryKey": false,
3399
+ "notNull": false,
3400
+ "autoincrement": false
3401
+ },
3402
+ "scope": {
3403
+ "name": "scope",
3404
+ "type": "text",
3405
+ "primaryKey": false,
3406
+ "notNull": false,
3407
+ "autoincrement": false
3408
+ },
3409
+ "generation": {
3410
+ "name": "generation",
3411
+ "type": "integer",
3412
+ "primaryKey": false,
3413
+ "notNull": true,
3414
+ "autoincrement": false,
3415
+ "default": 0
3416
+ },
3417
+ "created_at": {
3418
+ "name": "created_at",
3419
+ "type": "integer",
3420
+ "primaryKey": false,
3421
+ "notNull": true,
3422
+ "autoincrement": false
3423
+ },
3424
+ "created_by": {
3425
+ "name": "created_by",
3426
+ "type": "text",
3427
+ "primaryKey": false,
3428
+ "notNull": true,
3429
+ "autoincrement": false
3430
+ },
3431
+ "status_changed_at": {
3432
+ "name": "status_changed_at",
3433
+ "type": "integer",
3434
+ "primaryKey": false,
3435
+ "notNull": true,
3436
+ "autoincrement": false
3437
+ },
3438
+ "status_changed_by": {
3439
+ "name": "status_changed_by",
3440
+ "type": "text",
3441
+ "primaryKey": false,
3442
+ "notNull": true,
3443
+ "autoincrement": false
3444
+ },
3445
+ "access_seq": {
3446
+ "name": "access_seq",
3447
+ "type": "integer",
3448
+ "primaryKey": false,
3449
+ "notNull": true,
3450
+ "autoincrement": false
3451
+ },
3452
+ "mac": {
3453
+ "name": "mac",
3454
+ "type": "blob",
3455
+ "primaryKey": false,
3456
+ "notNull": true,
3457
+ "autoincrement": false
3458
+ },
3459
+ "seal": {
3460
+ "name": "seal",
3461
+ "type": "blob",
3462
+ "primaryKey": false,
3463
+ "notNull": false,
3464
+ "autoincrement": false
3465
+ }
3466
+ },
3467
+ "indexes": {},
3468
+ "foreignKeys": {},
3469
+ "compositePrimaryKeys": {},
3470
+ "uniqueConstraints": {},
3471
+ "checkConstraints": {
3472
+ "vault_members_seal_check": {
3473
+ "name": "vault_members_seal_check",
3474
+ "value": "\"vault_members\".\"seal\" IS NULL OR octet_length(\"vault_members\".\"seal\") = 16"
3475
+ },
3476
+ "vault_members_mac_check": {
3477
+ "name": "vault_members_mac_check",
3478
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
3479
+ },
3480
+ "vault_members_principal_check": {
3481
+ "name": "vault_members_principal_check",
3482
+ "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"
3483
+ },
3484
+ "vault_members_user_lowercase": {
3485
+ "name": "vault_members_user_lowercase",
3486
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
3487
+ },
3488
+ "vault_members_status_check": {
3489
+ "name": "vault_members_status_check",
3490
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
3491
+ },
3492
+ "vault_members_owner_check": {
3493
+ "name": "vault_members_owner_check",
3494
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
3495
+ },
3496
+ "vault_members_generation_check": {
3497
+ "name": "vault_members_generation_check",
3498
+ "value": "\"vault_members\".\"generation\" >= 0"
3499
+ }
3500
+ }
3501
+ },
3502
+ "vault_releases": {
3503
+ "name": "vault_releases",
3504
+ "columns": {
3505
+ "principal": {
3506
+ "name": "principal",
3507
+ "type": "text",
3508
+ "primaryKey": false,
3509
+ "notNull": true,
3510
+ "autoincrement": false
3511
+ },
3512
+ "key": {
3513
+ "name": "key",
3514
+ "type": "text",
3515
+ "primaryKey": false,
3516
+ "notNull": true,
3517
+ "autoincrement": false
3518
+ },
3519
+ "released_at": {
3520
+ "name": "released_at",
3521
+ "type": "integer",
3522
+ "primaryKey": false,
3523
+ "notNull": true,
3524
+ "autoincrement": false
3525
+ }
3526
+ },
3527
+ "indexes": {},
3528
+ "foreignKeys": {},
3529
+ "compositePrimaryKeys": {
3530
+ "vault_releases_pkey": {
3531
+ "columns": [
3532
+ "principal",
3533
+ "key"
3534
+ ],
3535
+ "name": "vault_releases_pkey"
3536
+ }
3537
+ },
3538
+ "uniqueConstraints": {},
3539
+ "checkConstraints": {}
3540
+ }
3541
+ },
3542
+ "views": {},
3543
+ "enums": {},
3544
+ "_meta": {
3545
+ "schemas": {},
3546
+ "tables": {},
3547
+ "columns": {}
3548
+ },
3549
+ "internal": {
3550
+ "indexes": {
3551
+ "audit_log_unbind_idx": {
3552
+ "columns": {
3553
+ "json_extract(\"metadata\", '$.bindingId')": {
3554
+ "isExpression": true
3555
+ }
3556
+ }
3557
+ },
3558
+ "audit_log_freeze_idx": {
3559
+ "columns": {
3560
+ "json_extract(\"metadata\", '$.target')": {
3561
+ "isExpression": true
3562
+ }
3563
+ }
3564
+ },
3565
+ "audit_log_supersede_idx": {
3566
+ "columns": {
3567
+ "json_extract(\"metadata\", '$.enrollmentId')": {
3568
+ "isExpression": true
3569
+ }
3570
+ }
3571
+ },
3572
+ "audit_log_exchange_idx": {
3573
+ "columns": {
3574
+ "json_extract(\"metadata\", '$.credentialId')": {
3575
+ "isExpression": true
3576
+ }
3577
+ }
3578
+ },
3579
+ "audit_log_token_create_idx": {
3580
+ "columns": {
3581
+ "json_extract(\"metadata\", '$.targetCredentialId')": {
3582
+ "isExpression": true
3583
+ }
3584
+ }
3585
+ },
3586
+ "audit_log_also_project_idx": {
3587
+ "columns": {
3588
+ "json_extract(\"metadata\", '$.also.projectId')": {
3589
+ "isExpression": true
3590
+ }
3591
+ }
3592
+ },
3593
+ "audit_log_also_environment_idx": {
3594
+ "columns": {
3595
+ "json_extract(\"metadata\", '$.also.environmentId')": {
3596
+ "isExpression": true
3597
+ }
3598
+ }
3599
+ },
3600
+ "audit_log_also_secret_idx": {
3601
+ "columns": {
3602
+ "json_extract(\"metadata\", '$.also.secretId')": {
3603
+ "isExpression": true
3604
+ }
3605
+ }
3606
+ }
3607
+ }
3608
+ }
3609
+ }