@coffre/db 0.14.4 → 0.15.0

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