@coffre/db 0.14.4 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +2 -1
  2. package/dist/change-records-_fKvahvs.js +55 -0
  3. package/dist/connect.d.ts +22 -10
  4. package/dist/connect.js +74 -12
  5. package/dist/database-CVteLhp1.d.ts +410 -0
  6. package/dist/{database-BadNeeN-.js → database-D55ENPX-.js} +46 -25
  7. package/dist/dialect.d.ts +4 -3
  8. package/dist/dialect.js +14 -5
  9. package/dist/grants.d.ts +4 -4
  10. package/dist/grants.js +4 -4
  11. package/dist/hyperdrive.d.ts +48 -23
  12. package/dist/hyperdrive.js +168 -91
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +1 -1
  15. package/dist/log-DaD7fyUq.d.ts +722 -0
  16. package/dist/log.d.ts +2 -596
  17. package/dist/log.js +224 -10
  18. package/dist/migrate.d.ts +43 -3
  19. package/dist/migrate.js +149 -29
  20. package/dist/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  21. package/dist/migrations/postgres/0022_log_015.sql +672 -0
  22. package/dist/migrations/postgres/0023_change_path.sql +153 -0
  23. package/dist/migrations/postgres/0024_use_015.sql +556 -0
  24. package/dist/migrations/postgres/0025_app_change.sql +221 -0
  25. package/dist/migrations/postgres/0026_issue_lock.sql +106 -0
  26. package/dist/migrations/postgres/0027_retention.sql +118 -0
  27. package/dist/migrations/postgres/0028_use_stalls.sql +594 -0
  28. package/dist/migrations/postgres/0029_use_objects.sql +887 -0
  29. package/dist/migrations/postgres/0030_unarchive_restores.sql +259 -0
  30. package/dist/migrations/postgres/0031_app_read.sql +65 -0
  31. package/dist/migrations/postgres/0032_secrets_live_index.sql +4 -0
  32. package/dist/migrations/postgres/0033_use_generations.sql +582 -0
  33. package/dist/migrations/postgres/0034_vault_credentials.sql +153 -0
  34. package/dist/migrations/postgres/0035_first_days.sql +3 -0
  35. package/dist/migrations/postgres/0036_vault_issues.sql +91 -0
  36. package/dist/migrations/postgres/0037_vault_bindings.sql +271 -0
  37. package/dist/migrations/postgres/0040_binding_origin.sql +159 -0
  38. package/dist/migrations/postgres/0041_cutover.sql +132 -0
  39. package/dist/migrations/postgres/0042_sign_in_index.sql +7 -0
  40. package/dist/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  41. package/dist/migrations/postgres/0044_use_by_name.sql +705 -0
  42. package/dist/migrations/postgres/0045_decide_first.sql +878 -0
  43. package/dist/migrations/postgres/0046_way_in_uses.sql +1149 -0
  44. package/dist/migrations/postgres/0047_cutover_finish.sql +268 -0
  45. package/dist/migrations/postgres/0048_use_batch.sql +59 -0
  46. package/dist/migrations/postgres/0049_reads.sql +171 -0
  47. package/dist/migrations/postgres/meta/0021_snapshot.json +3334 -0
  48. package/dist/migrations/postgres/meta/0022_snapshot.json +3831 -0
  49. package/dist/migrations/postgres/meta/0023_snapshot.json +3831 -0
  50. package/dist/migrations/postgres/meta/0024_snapshot.json +3831 -0
  51. package/dist/migrations/postgres/meta/0025_snapshot.json +3831 -0
  52. package/dist/migrations/postgres/meta/0026_snapshot.json +3831 -0
  53. package/dist/migrations/postgres/meta/0027_snapshot.json +3853 -0
  54. package/dist/migrations/postgres/meta/0028_snapshot.json +3853 -0
  55. package/dist/migrations/postgres/meta/0029_snapshot.json +3859 -0
  56. package/dist/migrations/postgres/meta/0030_snapshot.json +3859 -0
  57. package/dist/migrations/postgres/meta/0031_snapshot.json +3859 -0
  58. package/dist/migrations/postgres/meta/0032_snapshot.json +3875 -0
  59. package/dist/migrations/postgres/meta/0033_snapshot.json +3875 -0
  60. package/dist/migrations/postgres/meta/0034_snapshot.json +3875 -0
  61. package/dist/migrations/postgres/meta/0035_snapshot.json +3875 -0
  62. package/dist/migrations/postgres/meta/0036_snapshot.json +3875 -0
  63. package/dist/migrations/postgres/meta/0037_snapshot.json +3875 -0
  64. package/dist/migrations/postgres/meta/0038_snapshot.json +3881 -0
  65. package/dist/migrations/postgres/meta/0039_snapshot.json +3881 -0
  66. package/dist/migrations/postgres/meta/0040_snapshot.json +3931 -0
  67. package/dist/migrations/postgres/meta/0041_snapshot.json +3981 -0
  68. package/dist/migrations/postgres/meta/0042_snapshot.json +3981 -0
  69. package/dist/migrations/postgres/meta/0043_snapshot.json +3981 -0
  70. package/dist/migrations/postgres/meta/0044_snapshot.json +3991 -0
  71. package/dist/migrations/postgres/meta/0045_snapshot.json +3997 -0
  72. package/dist/migrations/postgres/meta/0046_snapshot.json +3997 -0
  73. package/dist/migrations/postgres/meta/0047_snapshot.json +4234 -0
  74. package/dist/migrations/postgres/meta/_journal.json +189 -0
  75. package/dist/migrations/sqlite/0018_log_015.sql +84 -0
  76. package/dist/migrations/sqlite/0019_retention.sql +2 -0
  77. package/dist/migrations/sqlite/0020_ended_references.sql +1 -0
  78. package/dist/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  79. package/dist/migrations/sqlite/0022_binding_origin.sql +1 -0
  80. package/dist/migrations/sqlite/0023_sign_in_index.sql +2 -0
  81. package/dist/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  82. package/dist/migrations/sqlite/0025_way_in_uses.sql +42 -0
  83. package/dist/migrations/sqlite/0026_cutover_finish.sql +11 -0
  84. package/dist/migrations/sqlite/0027_reads.sql +38 -0
  85. package/dist/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  86. package/dist/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  87. package/dist/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  88. package/dist/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  89. package/dist/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  90. package/dist/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  91. package/dist/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  92. package/dist/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  93. package/dist/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  94. package/dist/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  95. package/dist/migrations/sqlite/meta/_journal.json +70 -0
  96. package/dist/platform-Y3gICK6n.d.ts +58 -0
  97. package/dist/portable.d.ts +2 -2
  98. package/dist/postgres-BI3xTnyw.js +1718 -0
  99. package/dist/postgres-platform-node.d.ts +14 -0
  100. package/dist/postgres-platform-node.js +21 -0
  101. package/dist/postgres-platform-workerd.d.ts +61 -0
  102. package/dist/postgres-platform-workerd.js +163 -0
  103. package/dist/{schema-z8GcN_Xu.d.ts → schema-DgoPqqsI.d.ts} +1329 -9
  104. package/dist/schema-sqlite.d.ts +1308 -8
  105. package/dist/schema-sqlite.js +156 -20
  106. package/dist/schema-version.d.ts +1 -1
  107. package/dist/schema-version.js +261 -2
  108. package/dist/schema.d.ts +2 -2
  109. package/dist/schema.js +229 -22
  110. package/package.json +13 -5
  111. package/src/active-subject.ts +9 -0
  112. package/src/change-records.ts +38 -0
  113. package/src/connect.ts +67 -13
  114. package/src/database.ts +67 -51
  115. package/src/dialect.ts +17 -8
  116. package/src/grants.ts +3 -3
  117. package/src/hyperdrive.ts +181 -104
  118. package/src/log.ts +244 -11
  119. package/src/migrate.ts +157 -30
  120. package/src/migrations/postgres/0021_prune_vault_releases.sql +19 -0
  121. package/src/migrations/postgres/0022_log_015.sql +672 -0
  122. package/src/migrations/postgres/0023_change_path.sql +153 -0
  123. package/src/migrations/postgres/0024_use_015.sql +556 -0
  124. package/src/migrations/postgres/0025_app_change.sql +221 -0
  125. package/src/migrations/postgres/0026_issue_lock.sql +106 -0
  126. package/src/migrations/postgres/0027_retention.sql +118 -0
  127. package/src/migrations/postgres/0028_use_stalls.sql +594 -0
  128. package/src/migrations/postgres/0029_use_objects.sql +887 -0
  129. package/src/migrations/postgres/0030_unarchive_restores.sql +259 -0
  130. package/src/migrations/postgres/0031_app_read.sql +65 -0
  131. package/src/migrations/postgres/0032_secrets_live_index.sql +4 -0
  132. package/src/migrations/postgres/0033_use_generations.sql +582 -0
  133. package/src/migrations/postgres/0034_vault_credentials.sql +153 -0
  134. package/src/migrations/postgres/0035_first_days.sql +3 -0
  135. package/src/migrations/postgres/0036_vault_issues.sql +91 -0
  136. package/src/migrations/postgres/0037_vault_bindings.sql +271 -0
  137. package/src/migrations/postgres/0040_binding_origin.sql +159 -0
  138. package/src/migrations/postgres/0041_cutover.sql +132 -0
  139. package/src/migrations/postgres/0042_sign_in_index.sql +7 -0
  140. package/src/migrations/postgres/0043_issue_revoke_index.sql +4 -0
  141. package/src/migrations/postgres/0044_use_by_name.sql +705 -0
  142. package/src/migrations/postgres/0045_decide_first.sql +878 -0
  143. package/src/migrations/postgres/0046_way_in_uses.sql +1149 -0
  144. package/src/migrations/postgres/0047_cutover_finish.sql +268 -0
  145. package/src/migrations/postgres/0048_use_batch.sql +59 -0
  146. package/src/migrations/postgres/0049_reads.sql +171 -0
  147. package/src/migrations/postgres/meta/0021_snapshot.json +3334 -0
  148. package/src/migrations/postgres/meta/0022_snapshot.json +3831 -0
  149. package/src/migrations/postgres/meta/0023_snapshot.json +3831 -0
  150. package/src/migrations/postgres/meta/0024_snapshot.json +3831 -0
  151. package/src/migrations/postgres/meta/0025_snapshot.json +3831 -0
  152. package/src/migrations/postgres/meta/0026_snapshot.json +3831 -0
  153. package/src/migrations/postgres/meta/0027_snapshot.json +3853 -0
  154. package/src/migrations/postgres/meta/0028_snapshot.json +3853 -0
  155. package/src/migrations/postgres/meta/0029_snapshot.json +3859 -0
  156. package/src/migrations/postgres/meta/0030_snapshot.json +3859 -0
  157. package/src/migrations/postgres/meta/0031_snapshot.json +3859 -0
  158. package/src/migrations/postgres/meta/0032_snapshot.json +3875 -0
  159. package/src/migrations/postgres/meta/0033_snapshot.json +3875 -0
  160. package/src/migrations/postgres/meta/0034_snapshot.json +3875 -0
  161. package/src/migrations/postgres/meta/0035_snapshot.json +3875 -0
  162. package/src/migrations/postgres/meta/0036_snapshot.json +3875 -0
  163. package/src/migrations/postgres/meta/0037_snapshot.json +3875 -0
  164. package/src/migrations/postgres/meta/0038_snapshot.json +3881 -0
  165. package/src/migrations/postgres/meta/0039_snapshot.json +3881 -0
  166. package/src/migrations/postgres/meta/0040_snapshot.json +3931 -0
  167. package/src/migrations/postgres/meta/0041_snapshot.json +3981 -0
  168. package/src/migrations/postgres/meta/0042_snapshot.json +3981 -0
  169. package/src/migrations/postgres/meta/0043_snapshot.json +3981 -0
  170. package/src/migrations/postgres/meta/0044_snapshot.json +3991 -0
  171. package/src/migrations/postgres/meta/0045_snapshot.json +3997 -0
  172. package/src/migrations/postgres/meta/0046_snapshot.json +3997 -0
  173. package/src/migrations/postgres/meta/0047_snapshot.json +4234 -0
  174. package/src/migrations/postgres/meta/_journal.json +189 -0
  175. package/src/migrations/sqlite/0018_log_015.sql +84 -0
  176. package/src/migrations/sqlite/0019_retention.sql +2 -0
  177. package/src/migrations/sqlite/0020_ended_references.sql +1 -0
  178. package/src/migrations/sqlite/0021_secrets_live_index.sql +1 -0
  179. package/src/migrations/sqlite/0022_binding_origin.sql +1 -0
  180. package/src/migrations/sqlite/0023_sign_in_index.sql +2 -0
  181. package/src/migrations/sqlite/0024_issue_revoke_index.sql +2 -0
  182. package/src/migrations/sqlite/0025_way_in_uses.sql +42 -0
  183. package/src/migrations/sqlite/0026_cutover_finish.sql +11 -0
  184. package/src/migrations/sqlite/0027_reads.sql +38 -0
  185. package/src/migrations/sqlite/meta/0018_snapshot.json +3529 -0
  186. package/src/migrations/sqlite/meta/0019_snapshot.json +3538 -0
  187. package/src/migrations/sqlite/meta/0020_snapshot.json +3545 -0
  188. package/src/migrations/sqlite/meta/0021_snapshot.json +3553 -0
  189. package/src/migrations/sqlite/meta/0022_snapshot.json +3560 -0
  190. package/src/migrations/sqlite/meta/0023_snapshot.json +3579 -0
  191. package/src/migrations/sqlite/meta/0024_snapshot.json +3598 -0
  192. package/src/migrations/sqlite/meta/0025_snapshot.json +3609 -0
  193. package/src/migrations/sqlite/meta/0026_snapshot.json +3616 -0
  194. package/src/migrations/sqlite/meta/0027_snapshot.json +3834 -0
  195. package/src/migrations/sqlite/meta/_journal.json +70 -0
  196. package/src/postgres-js/README.md +183 -0
  197. package/src/postgres-js/UNLICENSE +24 -0
  198. package/src/postgres-js/bytes.ts +89 -0
  199. package/src/postgres-js/connection.ts +882 -0
  200. package/src/postgres-js/errors.ts +84 -0
  201. package/src/postgres-js/index.ts +516 -0
  202. package/src/postgres-js/platform.node.ts +29 -0
  203. package/src/postgres-js/platform.ts +60 -0
  204. package/src/postgres-js/platform.workerd.ts +225 -0
  205. package/src/postgres-js/query.ts +123 -0
  206. package/src/postgres-js/queue.ts +42 -0
  207. package/src/postgres-js/result.ts +46 -0
  208. package/src/postgres-js/types.ts +52 -0
  209. package/src/postgres.ts +375 -26
  210. package/src/schema-version.ts +2 -2
  211. package/src/schema.sqlite.ts +200 -9
  212. package/src/schema.ts +294 -8
  213. package/src/verify-runtime.ts +18 -29
  214. package/LICENSE +0 -21
  215. package/dist/database-CFhTnnzM.d.ts +0 -73
  216. package/dist/postgres-Bmar8y0q.js +0 -29
  217. package/dist/relations-BfR3JjT1.js +0 -38
  218. package/src/relations.ts +0 -40
@@ -0,0 +1,3853 @@
1
+ {
2
+ "id": "43b8d6b7-66c5-47fb-870a-820f9daa5974",
3
+ "prevId": "bb769243-ea6e-413f-8d50-3641ae6374b4",
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
+ "log_checkpoints_floor_idx": {
1979
+ "name": "log_checkpoints_floor_idx",
1980
+ "columns": [
1981
+ {
1982
+ "expression": "at_floor",
1983
+ "isExpression": false,
1984
+ "asc": true,
1985
+ "nulls": "last"
1986
+ },
1987
+ {
1988
+ "expression": "upto",
1989
+ "isExpression": false,
1990
+ "asc": true,
1991
+ "nulls": "last"
1992
+ }
1993
+ ],
1994
+ "isUnique": false,
1995
+ "concurrently": false,
1996
+ "method": "btree",
1997
+ "with": {}
1998
+ }
1999
+ },
2000
+ "foreignKeys": {},
2001
+ "compositePrimaryKeys": {},
2002
+ "uniqueConstraints": {},
2003
+ "policies": {},
2004
+ "checkConstraints": {
2005
+ "log_checkpoints_changes_root_check": {
2006
+ "name": "log_checkpoints_changes_root_check",
2007
+ "value": "octet_length(\"log_checkpoints\".\"changes_root\") = 32"
2008
+ },
2009
+ "log_checkpoints_uses_root_check": {
2010
+ "name": "log_checkpoints_uses_root_check",
2011
+ "value": "octet_length(\"log_checkpoints\".\"uses_root\") = 32"
2012
+ }
2013
+ },
2014
+ "isRLSEnabled": false
2015
+ },
2016
+ "public.log_fence": {
2017
+ "name": "log_fence",
2018
+ "schema": "",
2019
+ "columns": {
2020
+ "only_row": {
2021
+ "name": "only_row",
2022
+ "type": "boolean",
2023
+ "primaryKey": true,
2024
+ "notNull": true,
2025
+ "default": true
2026
+ },
2027
+ "at_floor": {
2028
+ "name": "at_floor",
2029
+ "type": "bigint",
2030
+ "primaryKey": false,
2031
+ "notNull": true
2032
+ }
2033
+ },
2034
+ "indexes": {},
2035
+ "foreignKeys": {},
2036
+ "compositePrimaryKeys": {},
2037
+ "uniqueConstraints": {},
2038
+ "policies": {},
2039
+ "checkConstraints": {
2040
+ "log_fence_only_row_check": {
2041
+ "name": "log_fence_only_row_check",
2042
+ "value": "\"log_fence\".\"only_row\""
2043
+ }
2044
+ },
2045
+ "isRLSEnabled": false
2046
+ },
2047
+ "public.log_tiles": {
2048
+ "name": "log_tiles",
2049
+ "schema": "",
2050
+ "columns": {
2051
+ "tree": {
2052
+ "name": "tree",
2053
+ "type": "text",
2054
+ "primaryKey": false,
2055
+ "notNull": true
2056
+ },
2057
+ "level": {
2058
+ "name": "level",
2059
+ "type": "smallint",
2060
+ "primaryKey": false,
2061
+ "notNull": true
2062
+ },
2063
+ "leaf": {
2064
+ "name": "leaf",
2065
+ "type": "bigint",
2066
+ "primaryKey": false,
2067
+ "notNull": true
2068
+ },
2069
+ "hashes": {
2070
+ "name": "hashes",
2071
+ "type": "bytea",
2072
+ "primaryKey": false,
2073
+ "notNull": true
2074
+ }
2075
+ },
2076
+ "indexes": {},
2077
+ "foreignKeys": {},
2078
+ "compositePrimaryKeys": {
2079
+ "log_tiles_pkey": {
2080
+ "name": "log_tiles_pkey",
2081
+ "columns": [
2082
+ "tree",
2083
+ "level",
2084
+ "leaf"
2085
+ ]
2086
+ }
2087
+ },
2088
+ "uniqueConstraints": {},
2089
+ "policies": {},
2090
+ "checkConstraints": {
2091
+ "log_tiles_tree_check": {
2092
+ "name": "log_tiles_tree_check",
2093
+ "value": "\"log_tiles\".\"tree\" IN ('changes', 'uses')"
2094
+ },
2095
+ "log_tiles_level_check": {
2096
+ "name": "log_tiles_level_check",
2097
+ "value": "\"log_tiles\".\"level\" BETWEEN 0 AND 7"
2098
+ },
2099
+ "log_tiles_leaf_check": {
2100
+ "name": "log_tiles_leaf_check",
2101
+ "value": "\"log_tiles\".\"leaf\" >= 0 AND \"log_tiles\".\"leaf\" % (256::numeric ^ (\"log_tiles\".\"level\" + 1)) = 0"
2102
+ },
2103
+ "log_tiles_hashes_check": {
2104
+ "name": "log_tiles_hashes_check",
2105
+ "value": "octet_length(\"log_tiles\".\"hashes\") BETWEEN 32 AND 8192 AND octet_length(\"log_tiles\".\"hashes\") % 32 = 0"
2106
+ }
2107
+ },
2108
+ "isRLSEnabled": false
2109
+ },
2110
+ "public.log_uses": {
2111
+ "name": "log_uses",
2112
+ "schema": "",
2113
+ "columns": {
2114
+ "number": {
2115
+ "name": "number",
2116
+ "type": "bigint",
2117
+ "primaryKey": false,
2118
+ "notNull": true
2119
+ },
2120
+ "at": {
2121
+ "name": "at",
2122
+ "type": "bigint",
2123
+ "primaryKey": false,
2124
+ "notNull": true
2125
+ },
2126
+ "request_id": {
2127
+ "name": "request_id",
2128
+ "type": "bigint",
2129
+ "primaryKey": false,
2130
+ "notNull": true
2131
+ },
2132
+ "credential": {
2133
+ "name": "credential",
2134
+ "type": "uuid",
2135
+ "primaryKey": false,
2136
+ "notNull": true
2137
+ },
2138
+ "secret": {
2139
+ "name": "secret",
2140
+ "type": "uuid",
2141
+ "primaryKey": false,
2142
+ "notNull": true
2143
+ },
2144
+ "purpose": {
2145
+ "name": "purpose",
2146
+ "type": "smallint",
2147
+ "primaryKey": false,
2148
+ "notNull": true
2149
+ },
2150
+ "mac": {
2151
+ "name": "mac",
2152
+ "type": "bytea",
2153
+ "primaryKey": false,
2154
+ "notNull": true
2155
+ },
2156
+ "place": {
2157
+ "name": "place",
2158
+ "type": "uuid",
2159
+ "primaryKey": false,
2160
+ "notNull": false
2161
+ }
2162
+ },
2163
+ "indexes": {
2164
+ "log_uses_request_idx": {
2165
+ "name": "log_uses_request_idx",
2166
+ "columns": [
2167
+ {
2168
+ "expression": "at",
2169
+ "isExpression": false,
2170
+ "asc": true,
2171
+ "nulls": "last"
2172
+ },
2173
+ {
2174
+ "expression": "request_id",
2175
+ "isExpression": false,
2176
+ "asc": true,
2177
+ "nulls": "last"
2178
+ }
2179
+ ],
2180
+ "isUnique": true,
2181
+ "concurrently": false,
2182
+ "method": "btree",
2183
+ "with": {}
2184
+ }
2185
+ },
2186
+ "foreignKeys": {},
2187
+ "compositePrimaryKeys": {},
2188
+ "uniqueConstraints": {},
2189
+ "policies": {},
2190
+ "checkConstraints": {
2191
+ "log_uses_mac_check": {
2192
+ "name": "log_uses_mac_check",
2193
+ "value": "octet_length(\"log_uses\".\"mac\") = 16"
2194
+ }
2195
+ },
2196
+ "isRLSEnabled": false
2197
+ },
2198
+ "public.mcp_approvals": {
2199
+ "name": "mcp_approvals",
2200
+ "schema": "",
2201
+ "columns": {
2202
+ "id": {
2203
+ "name": "id",
2204
+ "type": "uuid",
2205
+ "primaryKey": true,
2206
+ "notNull": true
2207
+ },
2208
+ "connection_id": {
2209
+ "name": "connection_id",
2210
+ "type": "uuid",
2211
+ "primaryKey": false,
2212
+ "notNull": true
2213
+ },
2214
+ "tool": {
2215
+ "name": "tool",
2216
+ "type": "text",
2217
+ "primaryKey": false,
2218
+ "notNull": true
2219
+ },
2220
+ "arguments": {
2221
+ "name": "arguments",
2222
+ "type": "text",
2223
+ "primaryKey": false,
2224
+ "notNull": true
2225
+ },
2226
+ "digest": {
2227
+ "name": "digest",
2228
+ "type": "bytea",
2229
+ "primaryKey": false,
2230
+ "notNull": true
2231
+ },
2232
+ "status": {
2233
+ "name": "status",
2234
+ "type": "text",
2235
+ "primaryKey": false,
2236
+ "notNull": true,
2237
+ "default": "'pending'"
2238
+ },
2239
+ "outcome": {
2240
+ "name": "outcome",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": false
2244
+ },
2245
+ "created_at": {
2246
+ "name": "created_at",
2247
+ "type": "timestamp with time zone",
2248
+ "primaryKey": false,
2249
+ "notNull": true,
2250
+ "default": "now()"
2251
+ },
2252
+ "expires_at": {
2253
+ "name": "expires_at",
2254
+ "type": "timestamp with time zone",
2255
+ "primaryKey": false,
2256
+ "notNull": true
2257
+ },
2258
+ "decided_at": {
2259
+ "name": "decided_at",
2260
+ "type": "timestamp with time zone",
2261
+ "primaryKey": false,
2262
+ "notNull": false
2263
+ },
2264
+ "reported_at": {
2265
+ "name": "reported_at",
2266
+ "type": "timestamp with time zone",
2267
+ "primaryKey": false,
2268
+ "notNull": false
2269
+ }
2270
+ },
2271
+ "indexes": {
2272
+ "mcp_approvals_open_idx": {
2273
+ "name": "mcp_approvals_open_idx",
2274
+ "columns": [
2275
+ {
2276
+ "expression": "connection_id",
2277
+ "isExpression": false,
2278
+ "asc": true,
2279
+ "nulls": "last"
2280
+ },
2281
+ {
2282
+ "expression": "digest",
2283
+ "isExpression": false,
2284
+ "asc": true,
2285
+ "nulls": "last"
2286
+ }
2287
+ ],
2288
+ "isUnique": false,
2289
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL",
2290
+ "concurrently": false,
2291
+ "method": "btree",
2292
+ "with": {}
2293
+ }
2294
+ },
2295
+ "foreignKeys": {
2296
+ "mcp_approvals_connection_fkey": {
2297
+ "name": "mcp_approvals_connection_fkey",
2298
+ "tableFrom": "mcp_approvals",
2299
+ "tableTo": "mcp_connections",
2300
+ "columnsFrom": [
2301
+ "connection_id"
2302
+ ],
2303
+ "columnsTo": [
2304
+ "id"
2305
+ ],
2306
+ "onDelete": "restrict",
2307
+ "onUpdate": "no action"
2308
+ }
2309
+ },
2310
+ "compositePrimaryKeys": {},
2311
+ "uniqueConstraints": {},
2312
+ "policies": {},
2313
+ "checkConstraints": {
2314
+ "mcp_approvals_status_check": {
2315
+ "name": "mcp_approvals_status_check",
2316
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
2317
+ },
2318
+ "mcp_approvals_digest_check": {
2319
+ "name": "mcp_approvals_digest_check",
2320
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
2321
+ },
2322
+ "mcp_approvals_arguments_check": {
2323
+ "name": "mcp_approvals_arguments_check",
2324
+ "value": "\"mcp_approvals\".\"arguments\"::jsonb IS NOT NULL"
2325
+ }
2326
+ },
2327
+ "isRLSEnabled": false
2328
+ },
2329
+ "public.mcp_connections": {
2330
+ "name": "mcp_connections",
2331
+ "schema": "",
2332
+ "columns": {
2333
+ "id": {
2334
+ "name": "id",
2335
+ "type": "uuid",
2336
+ "primaryKey": true,
2337
+ "notNull": true
2338
+ },
2339
+ "auth_mac": {
2340
+ "name": "auth_mac",
2341
+ "type": "bytea",
2342
+ "primaryKey": false,
2343
+ "notNull": true
2344
+ },
2345
+ "principal": {
2346
+ "name": "principal",
2347
+ "type": "text",
2348
+ "primaryKey": false,
2349
+ "notNull": true
2350
+ },
2351
+ "generation": {
2352
+ "name": "generation",
2353
+ "type": "integer",
2354
+ "primaryKey": false,
2355
+ "notNull": true
2356
+ },
2357
+ "client_id": {
2358
+ "name": "client_id",
2359
+ "type": "text",
2360
+ "primaryKey": false,
2361
+ "notNull": true
2362
+ },
2363
+ "client_name": {
2364
+ "name": "client_name",
2365
+ "type": "text",
2366
+ "primaryKey": false,
2367
+ "notNull": true
2368
+ },
2369
+ "client_host": {
2370
+ "name": "client_host",
2371
+ "type": "text",
2372
+ "primaryKey": false,
2373
+ "notNull": false
2374
+ },
2375
+ "registration": {
2376
+ "name": "registration",
2377
+ "type": "text",
2378
+ "primaryKey": false,
2379
+ "notNull": true
2380
+ },
2381
+ "scopes": {
2382
+ "name": "scopes",
2383
+ "type": "text",
2384
+ "primaryKey": false,
2385
+ "notNull": true
2386
+ },
2387
+ "redirect_uri": {
2388
+ "name": "redirect_uri",
2389
+ "type": "text",
2390
+ "primaryKey": false,
2391
+ "notNull": true
2392
+ },
2393
+ "code_hash": {
2394
+ "name": "code_hash",
2395
+ "type": "bytea",
2396
+ "primaryKey": false,
2397
+ "notNull": false
2398
+ },
2399
+ "code_challenge": {
2400
+ "name": "code_challenge",
2401
+ "type": "text",
2402
+ "primaryKey": false,
2403
+ "notNull": false
2404
+ },
2405
+ "code_expires_at": {
2406
+ "name": "code_expires_at",
2407
+ "type": "timestamp with time zone",
2408
+ "primaryKey": false,
2409
+ "notNull": false
2410
+ },
2411
+ "refresh_hash": {
2412
+ "name": "refresh_hash",
2413
+ "type": "bytea",
2414
+ "primaryKey": false,
2415
+ "notNull": false
2416
+ },
2417
+ "refresh_previous_hash": {
2418
+ "name": "refresh_previous_hash",
2419
+ "type": "bytea",
2420
+ "primaryKey": false,
2421
+ "notNull": false
2422
+ },
2423
+ "expires_at": {
2424
+ "name": "expires_at",
2425
+ "type": "timestamp with time zone",
2426
+ "primaryKey": false,
2427
+ "notNull": true
2428
+ },
2429
+ "created_at": {
2430
+ "name": "created_at",
2431
+ "type": "timestamp with time zone",
2432
+ "primaryKey": false,
2433
+ "notNull": true,
2434
+ "default": "now()"
2435
+ },
2436
+ "last_used_at": {
2437
+ "name": "last_used_at",
2438
+ "type": "timestamp with time zone",
2439
+ "primaryKey": false,
2440
+ "notNull": false
2441
+ },
2442
+ "last_used_ip": {
2443
+ "name": "last_used_ip",
2444
+ "type": "text",
2445
+ "primaryKey": false,
2446
+ "notNull": false
2447
+ },
2448
+ "revoked_at": {
2449
+ "name": "revoked_at",
2450
+ "type": "timestamp with time zone",
2451
+ "primaryKey": false,
2452
+ "notNull": false
2453
+ },
2454
+ "revoked_by": {
2455
+ "name": "revoked_by",
2456
+ "type": "text",
2457
+ "primaryKey": false,
2458
+ "notNull": false
2459
+ }
2460
+ },
2461
+ "indexes": {
2462
+ "mcp_connections_refresh_previous_idx": {
2463
+ "name": "mcp_connections_refresh_previous_idx",
2464
+ "columns": [
2465
+ {
2466
+ "expression": "refresh_previous_hash",
2467
+ "isExpression": false,
2468
+ "asc": true,
2469
+ "nulls": "last"
2470
+ }
2471
+ ],
2472
+ "isUnique": false,
2473
+ "concurrently": false,
2474
+ "method": "btree",
2475
+ "with": {}
2476
+ },
2477
+ "mcp_connections_live_idx": {
2478
+ "name": "mcp_connections_live_idx",
2479
+ "columns": [
2480
+ {
2481
+ "expression": "principal",
2482
+ "isExpression": false,
2483
+ "asc": true,
2484
+ "nulls": "last"
2485
+ },
2486
+ {
2487
+ "expression": "expires_at",
2488
+ "isExpression": false,
2489
+ "asc": true,
2490
+ "nulls": "last"
2491
+ }
2492
+ ],
2493
+ "isUnique": false,
2494
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL",
2495
+ "concurrently": false,
2496
+ "method": "btree",
2497
+ "with": {}
2498
+ }
2499
+ },
2500
+ "foreignKeys": {
2501
+ "mcp_connections_principal_fkey": {
2502
+ "name": "mcp_connections_principal_fkey",
2503
+ "tableFrom": "mcp_connections",
2504
+ "tableTo": "vault_members",
2505
+ "columnsFrom": [
2506
+ "principal"
2507
+ ],
2508
+ "columnsTo": [
2509
+ "principal"
2510
+ ],
2511
+ "onDelete": "restrict",
2512
+ "onUpdate": "no action"
2513
+ }
2514
+ },
2515
+ "compositePrimaryKeys": {},
2516
+ "uniqueConstraints": {
2517
+ "mcp_connections_code_hash_key": {
2518
+ "name": "mcp_connections_code_hash_key",
2519
+ "nullsNotDistinct": false,
2520
+ "columns": [
2521
+ "code_hash"
2522
+ ]
2523
+ },
2524
+ "mcp_connections_refresh_hash_key": {
2525
+ "name": "mcp_connections_refresh_hash_key",
2526
+ "nullsNotDistinct": false,
2527
+ "columns": [
2528
+ "refresh_hash"
2529
+ ]
2530
+ }
2531
+ },
2532
+ "policies": {},
2533
+ "checkConstraints": {
2534
+ "mcp_connections_principal_check": {
2535
+ "name": "mcp_connections_principal_check",
2536
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
2537
+ },
2538
+ "mcp_connections_registration_check": {
2539
+ "name": "mcp_connections_registration_check",
2540
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
2541
+ },
2542
+ "mcp_connections_auth_mac_check": {
2543
+ "name": "mcp_connections_auth_mac_check",
2544
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
2545
+ },
2546
+ "mcp_connections_code_hash_check": {
2547
+ "name": "mcp_connections_code_hash_check",
2548
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
2549
+ },
2550
+ "mcp_connections_refresh_hash_check": {
2551
+ "name": "mcp_connections_refresh_hash_check",
2552
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
2553
+ }
2554
+ },
2555
+ "isRLSEnabled": false
2556
+ },
2557
+ "public.oauth_clients": {
2558
+ "name": "oauth_clients",
2559
+ "schema": "",
2560
+ "columns": {
2561
+ "id": {
2562
+ "name": "id",
2563
+ "type": "uuid",
2564
+ "primaryKey": true,
2565
+ "notNull": true
2566
+ },
2567
+ "auth_mac": {
2568
+ "name": "auth_mac",
2569
+ "type": "bytea",
2570
+ "primaryKey": false,
2571
+ "notNull": true
2572
+ },
2573
+ "name": {
2574
+ "name": "name",
2575
+ "type": "text",
2576
+ "primaryKey": false,
2577
+ "notNull": true
2578
+ },
2579
+ "redirect_uris": {
2580
+ "name": "redirect_uris",
2581
+ "type": "text",
2582
+ "primaryKey": false,
2583
+ "notNull": true
2584
+ },
2585
+ "created_at": {
2586
+ "name": "created_at",
2587
+ "type": "timestamp with time zone",
2588
+ "primaryKey": false,
2589
+ "notNull": true,
2590
+ "default": "now()"
2591
+ },
2592
+ "created_ip": {
2593
+ "name": "created_ip",
2594
+ "type": "text",
2595
+ "primaryKey": false,
2596
+ "notNull": false
2597
+ },
2598
+ "revoked_at": {
2599
+ "name": "revoked_at",
2600
+ "type": "timestamp with time zone",
2601
+ "primaryKey": false,
2602
+ "notNull": false
2603
+ }
2604
+ },
2605
+ "indexes": {},
2606
+ "foreignKeys": {},
2607
+ "compositePrimaryKeys": {},
2608
+ "uniqueConstraints": {},
2609
+ "policies": {},
2610
+ "checkConstraints": {
2611
+ "oauth_clients_auth_mac_check": {
2612
+ "name": "oauth_clients_auth_mac_check",
2613
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
2614
+ },
2615
+ "oauth_clients_redirect_uris_check": {
2616
+ "name": "oauth_clients_redirect_uris_check",
2617
+ "value": "\"oauth_clients\".\"redirect_uris\"::jsonb IS NOT NULL"
2618
+ }
2619
+ },
2620
+ "isRLSEnabled": false
2621
+ },
2622
+ "public.projects": {
2623
+ "name": "projects",
2624
+ "schema": "",
2625
+ "columns": {
2626
+ "id": {
2627
+ "name": "id",
2628
+ "type": "uuid",
2629
+ "primaryKey": true,
2630
+ "notNull": true,
2631
+ "default": "gen_random_uuid()"
2632
+ },
2633
+ "slug": {
2634
+ "name": "slug",
2635
+ "type": "text",
2636
+ "primaryKey": false,
2637
+ "notNull": true
2638
+ },
2639
+ "name": {
2640
+ "name": "name",
2641
+ "type": "text",
2642
+ "primaryKey": false,
2643
+ "notNull": true
2644
+ },
2645
+ "created_at": {
2646
+ "name": "created_at",
2647
+ "type": "timestamp with time zone",
2648
+ "primaryKey": false,
2649
+ "notNull": true,
2650
+ "default": "now()"
2651
+ },
2652
+ "archived_at": {
2653
+ "name": "archived_at",
2654
+ "type": "timestamp with time zone",
2655
+ "primaryKey": false,
2656
+ "notNull": false
2657
+ },
2658
+ "folder": {
2659
+ "name": "folder",
2660
+ "type": "text",
2661
+ "primaryKey": false,
2662
+ "notNull": false
2663
+ }
2664
+ },
2665
+ "indexes": {},
2666
+ "foreignKeys": {},
2667
+ "compositePrimaryKeys": {},
2668
+ "uniqueConstraints": {
2669
+ "projects_slug_key": {
2670
+ "name": "projects_slug_key",
2671
+ "nullsNotDistinct": false,
2672
+ "columns": [
2673
+ "slug"
2674
+ ]
2675
+ }
2676
+ },
2677
+ "policies": {},
2678
+ "checkConstraints": {
2679
+ "projects_slug_check": {
2680
+ "name": "projects_slug_check",
2681
+ "value": "\"projects\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
2682
+ },
2683
+ "projects_folder_check": {
2684
+ "name": "projects_folder_check",
2685
+ "value": "\"projects\".\"folder\" IS NULL OR (char_length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" !~ '[/[:cntrl:]]' AND \"projects\".\"folder\" = btrim(\"projects\".\"folder\"))"
2686
+ }
2687
+ },
2688
+ "isRLSEnabled": false
2689
+ },
2690
+ "public.secret_references": {
2691
+ "name": "secret_references",
2692
+ "schema": "",
2693
+ "columns": {
2694
+ "id": {
2695
+ "name": "id",
2696
+ "type": "uuid",
2697
+ "primaryKey": true,
2698
+ "notNull": true
2699
+ },
2700
+ "project_id": {
2701
+ "name": "project_id",
2702
+ "type": "uuid",
2703
+ "primaryKey": false,
2704
+ "notNull": true
2705
+ },
2706
+ "environment_id": {
2707
+ "name": "environment_id",
2708
+ "type": "uuid",
2709
+ "primaryKey": false,
2710
+ "notNull": true
2711
+ },
2712
+ "secret_id": {
2713
+ "name": "secret_id",
2714
+ "type": "uuid",
2715
+ "primaryKey": false,
2716
+ "notNull": true
2717
+ },
2718
+ "source_project_id": {
2719
+ "name": "source_project_id",
2720
+ "type": "uuid",
2721
+ "primaryKey": false,
2722
+ "notNull": true
2723
+ },
2724
+ "source_environment_id": {
2725
+ "name": "source_environment_id",
2726
+ "type": "uuid",
2727
+ "primaryKey": false,
2728
+ "notNull": true
2729
+ },
2730
+ "source_secret_id": {
2731
+ "name": "source_secret_id",
2732
+ "type": "uuid",
2733
+ "primaryKey": false,
2734
+ "notNull": true
2735
+ },
2736
+ "created_seq": {
2737
+ "name": "created_seq",
2738
+ "type": "bigint",
2739
+ "primaryKey": false,
2740
+ "notNull": true
2741
+ },
2742
+ "created_at": {
2743
+ "name": "created_at",
2744
+ "type": "timestamp with time zone",
2745
+ "primaryKey": false,
2746
+ "notNull": true,
2747
+ "default": "now()"
2748
+ },
2749
+ "created_by": {
2750
+ "name": "created_by",
2751
+ "type": "text",
2752
+ "primaryKey": false,
2753
+ "notNull": true
2754
+ }
2755
+ },
2756
+ "indexes": {
2757
+ "secret_references_holder_idx": {
2758
+ "name": "secret_references_holder_idx",
2759
+ "columns": [
2760
+ {
2761
+ "expression": "secret_id",
2762
+ "isExpression": false,
2763
+ "asc": true,
2764
+ "nulls": "last"
2765
+ },
2766
+ {
2767
+ "expression": "created_seq",
2768
+ "isExpression": false,
2769
+ "asc": true,
2770
+ "nulls": "last"
2771
+ }
2772
+ ],
2773
+ "isUnique": false,
2774
+ "concurrently": false,
2775
+ "method": "btree",
2776
+ "with": {}
2777
+ },
2778
+ "secret_references_source_idx": {
2779
+ "name": "secret_references_source_idx",
2780
+ "columns": [
2781
+ {
2782
+ "expression": "source_secret_id",
2783
+ "isExpression": false,
2784
+ "asc": true,
2785
+ "nulls": "last"
2786
+ }
2787
+ ],
2788
+ "isUnique": false,
2789
+ "concurrently": false,
2790
+ "method": "btree",
2791
+ "with": {}
2792
+ },
2793
+ "secret_references_project_idx": {
2794
+ "name": "secret_references_project_idx",
2795
+ "columns": [
2796
+ {
2797
+ "expression": "project_id",
2798
+ "isExpression": false,
2799
+ "asc": true,
2800
+ "nulls": "last"
2801
+ }
2802
+ ],
2803
+ "isUnique": false,
2804
+ "concurrently": false,
2805
+ "method": "btree",
2806
+ "with": {}
2807
+ },
2808
+ "secret_references_source_project_idx": {
2809
+ "name": "secret_references_source_project_idx",
2810
+ "columns": [
2811
+ {
2812
+ "expression": "source_project_id",
2813
+ "isExpression": false,
2814
+ "asc": true,
2815
+ "nulls": "last"
2816
+ }
2817
+ ],
2818
+ "isUnique": false,
2819
+ "concurrently": false,
2820
+ "method": "btree",
2821
+ "with": {}
2822
+ },
2823
+ "secret_references_created_by_idx": {
2824
+ "name": "secret_references_created_by_idx",
2825
+ "columns": [
2826
+ {
2827
+ "expression": "created_by",
2828
+ "isExpression": false,
2829
+ "asc": true,
2830
+ "nulls": "last"
2831
+ }
2832
+ ],
2833
+ "isUnique": false,
2834
+ "concurrently": false,
2835
+ "method": "btree",
2836
+ "with": {}
2837
+ }
2838
+ },
2839
+ "foreignKeys": {
2840
+ "secret_references_secret_id_fkey": {
2841
+ "name": "secret_references_secret_id_fkey",
2842
+ "tableFrom": "secret_references",
2843
+ "tableTo": "secrets",
2844
+ "columnsFrom": [
2845
+ "secret_id"
2846
+ ],
2847
+ "columnsTo": [
2848
+ "id"
2849
+ ],
2850
+ "onDelete": "restrict",
2851
+ "onUpdate": "no action"
2852
+ },
2853
+ "secret_references_source_secret_id_fkey": {
2854
+ "name": "secret_references_source_secret_id_fkey",
2855
+ "tableFrom": "secret_references",
2856
+ "tableTo": "secrets",
2857
+ "columnsFrom": [
2858
+ "source_secret_id"
2859
+ ],
2860
+ "columnsTo": [
2861
+ "id"
2862
+ ],
2863
+ "onDelete": "restrict",
2864
+ "onUpdate": "no action"
2865
+ },
2866
+ "secret_references_created_seq_fkey": {
2867
+ "name": "secret_references_created_seq_fkey",
2868
+ "tableFrom": "secret_references",
2869
+ "tableTo": "audit_log",
2870
+ "columnsFrom": [
2871
+ "created_seq"
2872
+ ],
2873
+ "columnsTo": [
2874
+ "seq"
2875
+ ],
2876
+ "onDelete": "restrict",
2877
+ "onUpdate": "no action"
2878
+ }
2879
+ },
2880
+ "compositePrimaryKeys": {},
2881
+ "uniqueConstraints": {
2882
+ "secret_references_created_seq_key": {
2883
+ "name": "secret_references_created_seq_key",
2884
+ "nullsNotDistinct": false,
2885
+ "columns": [
2886
+ "created_seq"
2887
+ ]
2888
+ }
2889
+ },
2890
+ "policies": {},
2891
+ "checkConstraints": {},
2892
+ "isRLSEnabled": false
2893
+ },
2894
+ "public.secret_versions": {
2895
+ "name": "secret_versions",
2896
+ "schema": "",
2897
+ "columns": {
2898
+ "id": {
2899
+ "name": "id",
2900
+ "type": "uuid",
2901
+ "primaryKey": true,
2902
+ "notNull": true,
2903
+ "default": "gen_random_uuid()"
2904
+ },
2905
+ "secret_id": {
2906
+ "name": "secret_id",
2907
+ "type": "uuid",
2908
+ "primaryKey": false,
2909
+ "notNull": true
2910
+ },
2911
+ "version": {
2912
+ "name": "version",
2913
+ "type": "integer",
2914
+ "primaryKey": false,
2915
+ "notNull": true
2916
+ },
2917
+ "envelope_version": {
2918
+ "name": "envelope_version",
2919
+ "type": "integer",
2920
+ "primaryKey": false,
2921
+ "notNull": true
2922
+ },
2923
+ "ciphertext": {
2924
+ "name": "ciphertext",
2925
+ "type": "bytea",
2926
+ "primaryKey": false,
2927
+ "notNull": true
2928
+ },
2929
+ "iv": {
2930
+ "name": "iv",
2931
+ "type": "bytea",
2932
+ "primaryKey": false,
2933
+ "notNull": true
2934
+ },
2935
+ "auth_tag": {
2936
+ "name": "auth_tag",
2937
+ "type": "bytea",
2938
+ "primaryKey": false,
2939
+ "notNull": true
2940
+ },
2941
+ "wrapped_dek": {
2942
+ "name": "wrapped_dek",
2943
+ "type": "bytea",
2944
+ "primaryKey": false,
2945
+ "notNull": true
2946
+ },
2947
+ "kek_provider": {
2948
+ "name": "kek_provider",
2949
+ "type": "text",
2950
+ "primaryKey": false,
2951
+ "notNull": true
2952
+ },
2953
+ "kek_id": {
2954
+ "name": "kek_id",
2955
+ "type": "text",
2956
+ "primaryKey": false,
2957
+ "notNull": true
2958
+ },
2959
+ "kek_version": {
2960
+ "name": "kek_version",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "created_at": {
2966
+ "name": "created_at",
2967
+ "type": "timestamp with time zone",
2968
+ "primaryKey": false,
2969
+ "notNull": true,
2970
+ "default": "now()"
2971
+ },
2972
+ "created_by": {
2973
+ "name": "created_by",
2974
+ "type": "text",
2975
+ "primaryKey": false,
2976
+ "notNull": true
2977
+ },
2978
+ "recipe": {
2979
+ "name": "recipe",
2980
+ "type": "text",
2981
+ "primaryKey": false,
2982
+ "notNull": false
2983
+ },
2984
+ "pair_id": {
2985
+ "name": "pair_id",
2986
+ "type": "uuid",
2987
+ "primaryKey": false,
2988
+ "notNull": false
2989
+ },
2990
+ "pair_half": {
2991
+ "name": "pair_half",
2992
+ "type": "text",
2993
+ "primaryKey": false,
2994
+ "notNull": false
2995
+ },
2996
+ "plaintext": {
2997
+ "name": "plaintext",
2998
+ "type": "text",
2999
+ "primaryKey": false,
3000
+ "notNull": false
3001
+ },
3002
+ "sensitive": {
3003
+ "name": "sensitive",
3004
+ "type": "boolean",
3005
+ "primaryKey": false,
3006
+ "notNull": true,
3007
+ "default": false
3008
+ }
3009
+ },
3010
+ "indexes": {
3011
+ "secret_versions_secret_idx": {
3012
+ "name": "secret_versions_secret_idx",
3013
+ "columns": [
3014
+ {
3015
+ "expression": "secret_id",
3016
+ "isExpression": false,
3017
+ "asc": true,
3018
+ "nulls": "last"
3019
+ },
3020
+ {
3021
+ "expression": "version",
3022
+ "isExpression": false,
3023
+ "asc": false,
3024
+ "nulls": "last"
3025
+ }
3026
+ ],
3027
+ "isUnique": false,
3028
+ "concurrently": false,
3029
+ "method": "btree",
3030
+ "with": {}
3031
+ }
3032
+ },
3033
+ "foreignKeys": {
3034
+ "secret_versions_secret_id_fkey": {
3035
+ "name": "secret_versions_secret_id_fkey",
3036
+ "tableFrom": "secret_versions",
3037
+ "tableTo": "secrets",
3038
+ "columnsFrom": [
3039
+ "secret_id"
3040
+ ],
3041
+ "columnsTo": [
3042
+ "id"
3043
+ ],
3044
+ "onDelete": "restrict",
3045
+ "onUpdate": "no action"
3046
+ }
3047
+ },
3048
+ "compositePrimaryKeys": {},
3049
+ "uniqueConstraints": {
3050
+ "secret_versions_secret_id_version_key": {
3051
+ "name": "secret_versions_secret_id_version_key",
3052
+ "nullsNotDistinct": false,
3053
+ "columns": [
3054
+ "secret_id",
3055
+ "version"
3056
+ ]
3057
+ }
3058
+ },
3059
+ "policies": {},
3060
+ "checkConstraints": {
3061
+ "secret_versions_version_check": {
3062
+ "name": "secret_versions_version_check",
3063
+ "value": "\"secret_versions\".\"version\" > 0"
3064
+ },
3065
+ "secret_versions_iv_check": {
3066
+ "name": "secret_versions_iv_check",
3067
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
3068
+ },
3069
+ "secret_versions_auth_tag_check": {
3070
+ "name": "secret_versions_auth_tag_check",
3071
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
3072
+ }
3073
+ },
3074
+ "isRLSEnabled": false
3075
+ },
3076
+ "public.secrets": {
3077
+ "name": "secrets",
3078
+ "schema": "",
3079
+ "columns": {
3080
+ "id": {
3081
+ "name": "id",
3082
+ "type": "uuid",
3083
+ "primaryKey": true,
3084
+ "notNull": true,
3085
+ "default": "gen_random_uuid()"
3086
+ },
3087
+ "project_id": {
3088
+ "name": "project_id",
3089
+ "type": "uuid",
3090
+ "primaryKey": false,
3091
+ "notNull": true
3092
+ },
3093
+ "environment_id": {
3094
+ "name": "environment_id",
3095
+ "type": "uuid",
3096
+ "primaryKey": false,
3097
+ "notNull": true
3098
+ },
3099
+ "key": {
3100
+ "name": "key",
3101
+ "type": "text",
3102
+ "primaryKey": false,
3103
+ "notNull": true
3104
+ },
3105
+ "created_at": {
3106
+ "name": "created_at",
3107
+ "type": "timestamp with time zone",
3108
+ "primaryKey": false,
3109
+ "notNull": true,
3110
+ "default": "now()"
3111
+ },
3112
+ "updated_at": {
3113
+ "name": "updated_at",
3114
+ "type": "timestamp with time zone",
3115
+ "primaryKey": false,
3116
+ "notNull": true,
3117
+ "default": "now()"
3118
+ },
3119
+ "current_version_id": {
3120
+ "name": "current_version_id",
3121
+ "type": "uuid",
3122
+ "primaryKey": false,
3123
+ "notNull": false
3124
+ },
3125
+ "current_version": {
3126
+ "name": "current_version",
3127
+ "type": "integer",
3128
+ "primaryKey": false,
3129
+ "notNull": true,
3130
+ "default": 0
3131
+ },
3132
+ "archived_at": {
3133
+ "name": "archived_at",
3134
+ "type": "timestamp with time zone",
3135
+ "primaryKey": false,
3136
+ "notNull": false
3137
+ },
3138
+ "folder": {
3139
+ "name": "folder",
3140
+ "type": "text",
3141
+ "primaryKey": false,
3142
+ "notNull": false
3143
+ },
3144
+ "seal": {
3145
+ "name": "seal",
3146
+ "type": "bytea",
3147
+ "primaryKey": false,
3148
+ "notNull": false
3149
+ }
3150
+ },
3151
+ "indexes": {
3152
+ "secrets_lookup_idx": {
3153
+ "name": "secrets_lookup_idx",
3154
+ "columns": [
3155
+ {
3156
+ "expression": "project_id",
3157
+ "isExpression": false,
3158
+ "asc": true,
3159
+ "nulls": "last"
3160
+ },
3161
+ {
3162
+ "expression": "environment_id",
3163
+ "isExpression": false,
3164
+ "asc": true,
3165
+ "nulls": "last"
3166
+ },
3167
+ {
3168
+ "expression": "key",
3169
+ "isExpression": false,
3170
+ "asc": true,
3171
+ "nulls": "last"
3172
+ }
3173
+ ],
3174
+ "isUnique": false,
3175
+ "concurrently": false,
3176
+ "method": "btree",
3177
+ "with": {}
3178
+ }
3179
+ },
3180
+ "foreignKeys": {
3181
+ "secrets_current_version_id_secret_versions_id_fk": {
3182
+ "name": "secrets_current_version_id_secret_versions_id_fk",
3183
+ "tableFrom": "secrets",
3184
+ "tableTo": "secret_versions",
3185
+ "columnsFrom": [
3186
+ "current_version_id"
3187
+ ],
3188
+ "columnsTo": [
3189
+ "id"
3190
+ ],
3191
+ "onDelete": "no action",
3192
+ "onUpdate": "no action"
3193
+ },
3194
+ "secrets_project_id_fkey": {
3195
+ "name": "secrets_project_id_fkey",
3196
+ "tableFrom": "secrets",
3197
+ "tableTo": "projects",
3198
+ "columnsFrom": [
3199
+ "project_id"
3200
+ ],
3201
+ "columnsTo": [
3202
+ "id"
3203
+ ],
3204
+ "onDelete": "restrict",
3205
+ "onUpdate": "no action"
3206
+ },
3207
+ "secrets_environment_id_fkey": {
3208
+ "name": "secrets_environment_id_fkey",
3209
+ "tableFrom": "secrets",
3210
+ "tableTo": "environments",
3211
+ "columnsFrom": [
3212
+ "environment_id"
3213
+ ],
3214
+ "columnsTo": [
3215
+ "id"
3216
+ ],
3217
+ "onDelete": "restrict",
3218
+ "onUpdate": "no action"
3219
+ },
3220
+ "secrets_environment_in_project": {
3221
+ "name": "secrets_environment_in_project",
3222
+ "tableFrom": "secrets",
3223
+ "tableTo": "environments",
3224
+ "columnsFrom": [
3225
+ "environment_id",
3226
+ "project_id"
3227
+ ],
3228
+ "columnsTo": [
3229
+ "id",
3230
+ "project_id"
3231
+ ],
3232
+ "onDelete": "no action",
3233
+ "onUpdate": "no action"
3234
+ }
3235
+ },
3236
+ "compositePrimaryKeys": {},
3237
+ "uniqueConstraints": {
3238
+ "secrets_project_id_environment_id_key_key": {
3239
+ "name": "secrets_project_id_environment_id_key_key",
3240
+ "nullsNotDistinct": false,
3241
+ "columns": [
3242
+ "project_id",
3243
+ "environment_id",
3244
+ "key"
3245
+ ]
3246
+ }
3247
+ },
3248
+ "policies": {},
3249
+ "checkConstraints": {
3250
+ "secrets_seal_check": {
3251
+ "name": "secrets_seal_check",
3252
+ "value": "\"secrets\".\"seal\" IS NULL OR octet_length(\"secrets\".\"seal\") = 16"
3253
+ },
3254
+ "secrets_key_check": {
3255
+ "name": "secrets_key_check",
3256
+ "value": "\"secrets\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
3257
+ },
3258
+ "secrets_folder_check": {
3259
+ "name": "secrets_folder_check",
3260
+ "value": "\"secrets\".\"folder\" IS NULL OR (char_length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" !~ '[/[:cntrl:]]' AND \"secrets\".\"folder\" = btrim(\"secrets\".\"folder\"))"
3261
+ }
3262
+ },
3263
+ "isRLSEnabled": false
3264
+ },
3265
+ "public.service_bindings": {
3266
+ "name": "service_bindings",
3267
+ "schema": "",
3268
+ "columns": {
3269
+ "id": {
3270
+ "name": "id",
3271
+ "type": "uuid",
3272
+ "primaryKey": true,
3273
+ "notNull": true
3274
+ },
3275
+ "auth_mac": {
3276
+ "name": "auth_mac",
3277
+ "type": "bytea",
3278
+ "primaryKey": false,
3279
+ "notNull": true
3280
+ },
3281
+ "principal": {
3282
+ "name": "principal",
3283
+ "type": "text",
3284
+ "primaryKey": false,
3285
+ "notNull": true
3286
+ },
3287
+ "generation": {
3288
+ "name": "generation",
3289
+ "type": "integer",
3290
+ "primaryKey": false,
3291
+ "notNull": true
3292
+ },
3293
+ "profile": {
3294
+ "name": "profile",
3295
+ "type": "text",
3296
+ "primaryKey": false,
3297
+ "notNull": true
3298
+ },
3299
+ "issuer": {
3300
+ "name": "issuer",
3301
+ "type": "text",
3302
+ "primaryKey": false,
3303
+ "notNull": true
3304
+ },
3305
+ "jwks_uri": {
3306
+ "name": "jwks_uri",
3307
+ "type": "text",
3308
+ "primaryKey": false,
3309
+ "notNull": true
3310
+ },
3311
+ "jwks": {
3312
+ "name": "jwks",
3313
+ "type": "text",
3314
+ "primaryKey": false,
3315
+ "notNull": false
3316
+ },
3317
+ "claims": {
3318
+ "name": "claims",
3319
+ "type": "text",
3320
+ "primaryKey": false,
3321
+ "notNull": true
3322
+ },
3323
+ "scope": {
3324
+ "name": "scope",
3325
+ "type": "text",
3326
+ "primaryKey": false,
3327
+ "notNull": false
3328
+ },
3329
+ "policy": {
3330
+ "name": "policy",
3331
+ "type": "text",
3332
+ "primaryKey": false,
3333
+ "notNull": false
3334
+ },
3335
+ "label": {
3336
+ "name": "label",
3337
+ "type": "text",
3338
+ "primaryKey": false,
3339
+ "notNull": false
3340
+ },
3341
+ "created_at": {
3342
+ "name": "created_at",
3343
+ "type": "timestamp with time zone",
3344
+ "primaryKey": false,
3345
+ "notNull": true,
3346
+ "default": "now()"
3347
+ },
3348
+ "created_by": {
3349
+ "name": "created_by",
3350
+ "type": "text",
3351
+ "primaryKey": false,
3352
+ "notNull": true
3353
+ },
3354
+ "last_used_at": {
3355
+ "name": "last_used_at",
3356
+ "type": "timestamp with time zone",
3357
+ "primaryKey": false,
3358
+ "notNull": false
3359
+ },
3360
+ "revoked_at": {
3361
+ "name": "revoked_at",
3362
+ "type": "timestamp with time zone",
3363
+ "primaryKey": false,
3364
+ "notNull": false
3365
+ },
3366
+ "revoked_by": {
3367
+ "name": "revoked_by",
3368
+ "type": "text",
3369
+ "primaryKey": false,
3370
+ "notNull": false
3371
+ },
3372
+ "seal": {
3373
+ "name": "seal",
3374
+ "type": "bytea",
3375
+ "primaryKey": false,
3376
+ "notNull": false
3377
+ }
3378
+ },
3379
+ "indexes": {
3380
+ "service_bindings_principal_idx": {
3381
+ "name": "service_bindings_principal_idx",
3382
+ "columns": [
3383
+ {
3384
+ "expression": "principal",
3385
+ "isExpression": false,
3386
+ "asc": true,
3387
+ "nulls": "last"
3388
+ },
3389
+ {
3390
+ "expression": "issuer",
3391
+ "isExpression": false,
3392
+ "asc": true,
3393
+ "nulls": "last"
3394
+ }
3395
+ ],
3396
+ "isUnique": false,
3397
+ "concurrently": false,
3398
+ "method": "btree",
3399
+ "with": {}
3400
+ },
3401
+ "service_bindings_live_idx": {
3402
+ "name": "service_bindings_live_idx",
3403
+ "columns": [
3404
+ {
3405
+ "expression": "principal",
3406
+ "isExpression": false,
3407
+ "asc": true,
3408
+ "nulls": "last"
3409
+ },
3410
+ {
3411
+ "expression": "issuer",
3412
+ "isExpression": false,
3413
+ "asc": true,
3414
+ "nulls": "last"
3415
+ },
3416
+ {
3417
+ "expression": "generation",
3418
+ "isExpression": false,
3419
+ "asc": true,
3420
+ "nulls": "last"
3421
+ },
3422
+ {
3423
+ "expression": "created_at",
3424
+ "isExpression": false,
3425
+ "asc": true,
3426
+ "nulls": "last"
3427
+ },
3428
+ {
3429
+ "expression": "id",
3430
+ "isExpression": false,
3431
+ "asc": true,
3432
+ "nulls": "last"
3433
+ }
3434
+ ],
3435
+ "isUnique": false,
3436
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL",
3437
+ "concurrently": false,
3438
+ "method": "btree",
3439
+ "with": {}
3440
+ }
3441
+ },
3442
+ "foreignKeys": {
3443
+ "service_bindings_principal_fkey": {
3444
+ "name": "service_bindings_principal_fkey",
3445
+ "tableFrom": "service_bindings",
3446
+ "tableTo": "vault_members",
3447
+ "columnsFrom": [
3448
+ "principal"
3449
+ ],
3450
+ "columnsTo": [
3451
+ "principal"
3452
+ ],
3453
+ "onDelete": "restrict",
3454
+ "onUpdate": "no action"
3455
+ }
3456
+ },
3457
+ "compositePrimaryKeys": {},
3458
+ "uniqueConstraints": {},
3459
+ "policies": {},
3460
+ "checkConstraints": {
3461
+ "service_bindings_seal_check": {
3462
+ "name": "service_bindings_seal_check",
3463
+ "value": "\"service_bindings\".\"seal\" IS NULL OR octet_length(\"service_bindings\".\"seal\") = 16"
3464
+ },
3465
+ "service_bindings_principal_check": {
3466
+ "name": "service_bindings_principal_check",
3467
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
3468
+ },
3469
+ "service_bindings_auth_mac_check": {
3470
+ "name": "service_bindings_auth_mac_check",
3471
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
3472
+ },
3473
+ "service_bindings_claims_check": {
3474
+ "name": "service_bindings_claims_check",
3475
+ "value": "\"service_bindings\".\"claims\"::jsonb IS NOT NULL"
3476
+ }
3477
+ },
3478
+ "isRLSEnabled": false
3479
+ },
3480
+ "public.log_config": {
3481
+ "name": "log_config",
3482
+ "schema": "",
3483
+ "columns": {
3484
+ "name": {
3485
+ "name": "name",
3486
+ "type": "text",
3487
+ "primaryKey": true,
3488
+ "notNull": true
3489
+ },
3490
+ "value": {
3491
+ "name": "value",
3492
+ "type": "text",
3493
+ "primaryKey": false,
3494
+ "notNull": true
3495
+ },
3496
+ "seal": {
3497
+ "name": "seal",
3498
+ "type": "bytea",
3499
+ "primaryKey": false,
3500
+ "notNull": false
3501
+ }
3502
+ },
3503
+ "indexes": {},
3504
+ "foreignKeys": {},
3505
+ "compositePrimaryKeys": {},
3506
+ "uniqueConstraints": {},
3507
+ "policies": {},
3508
+ "checkConstraints": {
3509
+ "log_config_name_check": {
3510
+ "name": "log_config_name_check",
3511
+ "value": "\"log_config\".\"name\" IN ('policy', 'roles')"
3512
+ },
3513
+ "log_config_value_check": {
3514
+ "name": "log_config_value_check",
3515
+ "value": "\"log_config\".\"value\"::jsonb IS NOT NULL"
3516
+ },
3517
+ "log_config_seal_check": {
3518
+ "name": "log_config_seal_check",
3519
+ "value": "\"log_config\".\"seal\" IS NULL OR octet_length(\"log_config\".\"seal\") = 16"
3520
+ }
3521
+ },
3522
+ "isRLSEnabled": false
3523
+ },
3524
+ "public.vault_grants": {
3525
+ "name": "vault_grants",
3526
+ "schema": "",
3527
+ "columns": {
3528
+ "principal": {
3529
+ "name": "principal",
3530
+ "type": "text",
3531
+ "primaryKey": false,
3532
+ "notNull": true
3533
+ },
3534
+ "project_id": {
3535
+ "name": "project_id",
3536
+ "type": "uuid",
3537
+ "primaryKey": false,
3538
+ "notNull": false
3539
+ },
3540
+ "environment_id": {
3541
+ "name": "environment_id",
3542
+ "type": "uuid",
3543
+ "primaryKey": false,
3544
+ "notNull": false
3545
+ },
3546
+ "environment_slug": {
3547
+ "name": "environment_slug",
3548
+ "type": "text",
3549
+ "primaryKey": false,
3550
+ "notNull": false
3551
+ },
3552
+ "role": {
3553
+ "name": "role",
3554
+ "type": "text",
3555
+ "primaryKey": false,
3556
+ "notNull": true
3557
+ },
3558
+ "expires_at": {
3559
+ "name": "expires_at",
3560
+ "type": "bigint",
3561
+ "primaryKey": false,
3562
+ "notNull": false
3563
+ },
3564
+ "granted_at": {
3565
+ "name": "granted_at",
3566
+ "type": "bigint",
3567
+ "primaryKey": false,
3568
+ "notNull": true
3569
+ },
3570
+ "granted_by": {
3571
+ "name": "granted_by",
3572
+ "type": "text",
3573
+ "primaryKey": false,
3574
+ "notNull": true
3575
+ }
3576
+ },
3577
+ "indexes": {
3578
+ "vault_grants_on_every_project": {
3579
+ "name": "vault_grants_on_every_project",
3580
+ "columns": [
3581
+ {
3582
+ "expression": "principal",
3583
+ "isExpression": false,
3584
+ "asc": true,
3585
+ "nulls": "last"
3586
+ }
3587
+ ],
3588
+ "isUnique": true,
3589
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL",
3590
+ "concurrently": false,
3591
+ "method": "btree",
3592
+ "with": {}
3593
+ }
3594
+ },
3595
+ "foreignKeys": {
3596
+ "vault_grants_principal_fkey": {
3597
+ "name": "vault_grants_principal_fkey",
3598
+ "tableFrom": "vault_grants",
3599
+ "tableTo": "vault_members",
3600
+ "columnsFrom": [
3601
+ "principal"
3602
+ ],
3603
+ "columnsTo": [
3604
+ "principal"
3605
+ ],
3606
+ "onDelete": "restrict",
3607
+ "onUpdate": "no action"
3608
+ },
3609
+ "vault_grants_project_id_fkey": {
3610
+ "name": "vault_grants_project_id_fkey",
3611
+ "tableFrom": "vault_grants",
3612
+ "tableTo": "projects",
3613
+ "columnsFrom": [
3614
+ "project_id"
3615
+ ],
3616
+ "columnsTo": [
3617
+ "id"
3618
+ ],
3619
+ "onDelete": "restrict",
3620
+ "onUpdate": "no action"
3621
+ },
3622
+ "vault_grants_environment_id_fkey": {
3623
+ "name": "vault_grants_environment_id_fkey",
3624
+ "tableFrom": "vault_grants",
3625
+ "tableTo": "environments",
3626
+ "columnsFrom": [
3627
+ "environment_id"
3628
+ ],
3629
+ "columnsTo": [
3630
+ "id"
3631
+ ],
3632
+ "onDelete": "restrict",
3633
+ "onUpdate": "no action"
3634
+ }
3635
+ },
3636
+ "compositePrimaryKeys": {},
3637
+ "uniqueConstraints": {
3638
+ "vault_grants_on_project": {
3639
+ "name": "vault_grants_on_project",
3640
+ "nullsNotDistinct": false,
3641
+ "columns": [
3642
+ "principal",
3643
+ "project_id"
3644
+ ]
3645
+ },
3646
+ "vault_grants_on_environment": {
3647
+ "name": "vault_grants_on_environment",
3648
+ "nullsNotDistinct": false,
3649
+ "columns": [
3650
+ "principal",
3651
+ "environment_id"
3652
+ ]
3653
+ },
3654
+ "vault_grants_on_environment_slug": {
3655
+ "name": "vault_grants_on_environment_slug",
3656
+ "nullsNotDistinct": false,
3657
+ "columns": [
3658
+ "principal",
3659
+ "environment_slug"
3660
+ ]
3661
+ }
3662
+ },
3663
+ "policies": {},
3664
+ "checkConstraints": {
3665
+ "vault_grants_one_place": {
3666
+ "name": "vault_grants_one_place",
3667
+ "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)"
3668
+ },
3669
+ "vault_grants_environment_slug_check": {
3670
+ "name": "vault_grants_environment_slug_check",
3671
+ "value": "\"vault_grants\".\"environment_slug\" IS NULL OR \"vault_grants\".\"environment_slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
3672
+ },
3673
+ "vault_grants_role_check": {
3674
+ "name": "vault_grants_role_check",
3675
+ "value": "\"vault_grants\".\"role\" ~ '^[a-z][a-z0-9-]{1,31}$'"
3676
+ }
3677
+ },
3678
+ "isRLSEnabled": false
3679
+ },
3680
+ "public.vault_members": {
3681
+ "name": "vault_members",
3682
+ "schema": "",
3683
+ "columns": {
3684
+ "principal": {
3685
+ "name": "principal",
3686
+ "type": "text",
3687
+ "primaryKey": true,
3688
+ "notNull": true
3689
+ },
3690
+ "status": {
3691
+ "name": "status",
3692
+ "type": "text",
3693
+ "primaryKey": false,
3694
+ "notNull": true
3695
+ },
3696
+ "owner": {
3697
+ "name": "owner",
3698
+ "type": "boolean",
3699
+ "primaryKey": false,
3700
+ "notNull": true,
3701
+ "default": false
3702
+ },
3703
+ "role": {
3704
+ "name": "role",
3705
+ "type": "text",
3706
+ "primaryKey": false,
3707
+ "notNull": false
3708
+ },
3709
+ "scope": {
3710
+ "name": "scope",
3711
+ "type": "text",
3712
+ "primaryKey": false,
3713
+ "notNull": false
3714
+ },
3715
+ "generation": {
3716
+ "name": "generation",
3717
+ "type": "integer",
3718
+ "primaryKey": false,
3719
+ "notNull": true,
3720
+ "default": 0
3721
+ },
3722
+ "created_at": {
3723
+ "name": "created_at",
3724
+ "type": "bigint",
3725
+ "primaryKey": false,
3726
+ "notNull": true
3727
+ },
3728
+ "created_by": {
3729
+ "name": "created_by",
3730
+ "type": "text",
3731
+ "primaryKey": false,
3732
+ "notNull": true
3733
+ },
3734
+ "status_changed_at": {
3735
+ "name": "status_changed_at",
3736
+ "type": "bigint",
3737
+ "primaryKey": false,
3738
+ "notNull": true
3739
+ },
3740
+ "status_changed_by": {
3741
+ "name": "status_changed_by",
3742
+ "type": "text",
3743
+ "primaryKey": false,
3744
+ "notNull": true
3745
+ },
3746
+ "access_seq": {
3747
+ "name": "access_seq",
3748
+ "type": "bigint",
3749
+ "primaryKey": false,
3750
+ "notNull": true
3751
+ },
3752
+ "mac": {
3753
+ "name": "mac",
3754
+ "type": "bytea",
3755
+ "primaryKey": false,
3756
+ "notNull": true
3757
+ },
3758
+ "seal": {
3759
+ "name": "seal",
3760
+ "type": "bytea",
3761
+ "primaryKey": false,
3762
+ "notNull": false
3763
+ }
3764
+ },
3765
+ "indexes": {},
3766
+ "foreignKeys": {},
3767
+ "compositePrimaryKeys": {},
3768
+ "uniqueConstraints": {},
3769
+ "policies": {},
3770
+ "checkConstraints": {
3771
+ "vault_members_seal_check": {
3772
+ "name": "vault_members_seal_check",
3773
+ "value": "\"vault_members\".\"seal\" IS NULL OR octet_length(\"vault_members\".\"seal\") = 16"
3774
+ },
3775
+ "vault_members_mac_check": {
3776
+ "name": "vault_members_mac_check",
3777
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
3778
+ },
3779
+ "vault_members_principal_check": {
3780
+ "name": "vault_members_principal_check",
3781
+ "value": "\"vault_members\".\"principal\" ~ '^(user|token):[^[:space:]:][^[:space:]]*$'"
3782
+ },
3783
+ "vault_members_user_lowercase": {
3784
+ "name": "vault_members_user_lowercase",
3785
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
3786
+ },
3787
+ "vault_members_status_check": {
3788
+ "name": "vault_members_status_check",
3789
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
3790
+ },
3791
+ "vault_members_owner_check": {
3792
+ "name": "vault_members_owner_check",
3793
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
3794
+ },
3795
+ "vault_members_generation_check": {
3796
+ "name": "vault_members_generation_check",
3797
+ "value": "\"vault_members\".\"generation\" >= 0"
3798
+ }
3799
+ },
3800
+ "isRLSEnabled": false
3801
+ },
3802
+ "public.vault_releases": {
3803
+ "name": "vault_releases",
3804
+ "schema": "",
3805
+ "columns": {
3806
+ "principal": {
3807
+ "name": "principal",
3808
+ "type": "text",
3809
+ "primaryKey": false,
3810
+ "notNull": true
3811
+ },
3812
+ "key": {
3813
+ "name": "key",
3814
+ "type": "text",
3815
+ "primaryKey": false,
3816
+ "notNull": true
3817
+ },
3818
+ "released_at": {
3819
+ "name": "released_at",
3820
+ "type": "bigint",
3821
+ "primaryKey": false,
3822
+ "notNull": true
3823
+ }
3824
+ },
3825
+ "indexes": {},
3826
+ "foreignKeys": {},
3827
+ "compositePrimaryKeys": {
3828
+ "vault_releases_pkey": {
3829
+ "name": "vault_releases_pkey",
3830
+ "columns": [
3831
+ "principal",
3832
+ "key"
3833
+ ]
3834
+ }
3835
+ },
3836
+ "uniqueConstraints": {},
3837
+ "policies": {},
3838
+ "checkConstraints": {},
3839
+ "isRLSEnabled": false
3840
+ }
3841
+ },
3842
+ "enums": {},
3843
+ "schemas": {},
3844
+ "sequences": {},
3845
+ "roles": {},
3846
+ "policies": {},
3847
+ "views": {},
3848
+ "_meta": {
3849
+ "columns": {},
3850
+ "schemas": {},
3851
+ "tables": {}
3852
+ }
3853
+ }