@coffre/db 0.14.5 → 0.15.0

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