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