@coffre/db 0.6.2 → 0.8.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 (72) hide show
  1. package/dist/connect.d.ts +1 -1
  2. package/dist/{database-C63WjCrC.d.ts → database-BEnexh-3.d.ts} +1 -1
  3. package/dist/dialect.d.ts +1 -1
  4. package/dist/grants.d.ts +1 -1
  5. package/dist/hyperdrive.d.ts +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/log.d.ts +22 -1
  8. package/dist/log.js +37 -2
  9. package/dist/migrations/postgres/0004_environment_parents.sql +5 -0
  10. package/dist/migrations/postgres/0005_personal_tokens.sql +5 -0
  11. package/dist/migrations/postgres/0006_uploaded_keys.sql +2 -0
  12. package/dist/migrations/postgres/0007_personal_configs.sql +4 -0
  13. package/dist/migrations/postgres/0008_recipes.sql +19 -0
  14. package/dist/migrations/postgres/0009_handles.sql +3 -0
  15. package/dist/migrations/postgres/meta/0004_snapshot.json +2913 -0
  16. package/dist/migrations/postgres/meta/0005_snapshot.json +2929 -0
  17. package/dist/migrations/postgres/meta/0006_snapshot.json +2935 -0
  18. package/dist/migrations/postgres/meta/0007_snapshot.json +2967 -0
  19. package/dist/migrations/postgres/meta/0008_snapshot.json +2985 -0
  20. package/dist/migrations/postgres/meta/0009_snapshot.json +2985 -0
  21. package/dist/migrations/postgres/meta/_journal.json +42 -0
  22. package/dist/migrations/sqlite/0004_environment_parents.sql +3 -0
  23. package/dist/migrations/sqlite/0005_personal_tokens.sql +37 -0
  24. package/dist/migrations/sqlite/0006_uploaded_keys.sql +1 -0
  25. package/dist/migrations/sqlite/0007_personal_configs.sql +3 -0
  26. package/dist/migrations/sqlite/0008_recipes.sql +15 -0
  27. package/dist/migrations/sqlite/0009_handles.sql +36 -0
  28. package/dist/migrations/sqlite/meta/0004_snapshot.json +2641 -0
  29. package/dist/migrations/sqlite/meta/0005_snapshot.json +2656 -0
  30. package/dist/migrations/sqlite/meta/0006_snapshot.json +2663 -0
  31. package/dist/migrations/sqlite/meta/0007_snapshot.json +2683 -0
  32. package/dist/migrations/sqlite/meta/0008_snapshot.json +2704 -0
  33. package/dist/migrations/sqlite/meta/0009_snapshot.json +2704 -0
  34. package/dist/migrations/sqlite/meta/_journal.json +42 -0
  35. package/dist/portable.d.ts +2 -2
  36. package/dist/{schema-a7PkFgea.d.ts → schema-BZRkBJQZ.d.ts} +102 -0
  37. package/dist/schema-sqlite.d.ts +114 -0
  38. package/dist/schema-sqlite.js +20 -4
  39. package/dist/schema-version.d.ts +1 -1
  40. package/dist/schema-version.js +84 -0
  41. package/dist/schema.d.ts +1 -1
  42. package/dist/schema.js +20 -4
  43. package/package.json +2 -2
  44. package/src/log.ts +40 -1
  45. package/src/migrations/postgres/0004_environment_parents.sql +5 -0
  46. package/src/migrations/postgres/0005_personal_tokens.sql +5 -0
  47. package/src/migrations/postgres/0006_uploaded_keys.sql +2 -0
  48. package/src/migrations/postgres/0007_personal_configs.sql +4 -0
  49. package/src/migrations/postgres/0008_recipes.sql +19 -0
  50. package/src/migrations/postgres/0009_handles.sql +3 -0
  51. package/src/migrations/postgres/meta/0004_snapshot.json +2913 -0
  52. package/src/migrations/postgres/meta/0005_snapshot.json +2929 -0
  53. package/src/migrations/postgres/meta/0006_snapshot.json +2935 -0
  54. package/src/migrations/postgres/meta/0007_snapshot.json +2967 -0
  55. package/src/migrations/postgres/meta/0008_snapshot.json +2985 -0
  56. package/src/migrations/postgres/meta/0009_snapshot.json +2985 -0
  57. package/src/migrations/postgres/meta/_journal.json +42 -0
  58. package/src/migrations/sqlite/0004_environment_parents.sql +3 -0
  59. package/src/migrations/sqlite/0005_personal_tokens.sql +37 -0
  60. package/src/migrations/sqlite/0006_uploaded_keys.sql +1 -0
  61. package/src/migrations/sqlite/0007_personal_configs.sql +3 -0
  62. package/src/migrations/sqlite/0008_recipes.sql +15 -0
  63. package/src/migrations/sqlite/0009_handles.sql +36 -0
  64. package/src/migrations/sqlite/meta/0004_snapshot.json +2641 -0
  65. package/src/migrations/sqlite/meta/0005_snapshot.json +2656 -0
  66. package/src/migrations/sqlite/meta/0006_snapshot.json +2663 -0
  67. package/src/migrations/sqlite/meta/0007_snapshot.json +2683 -0
  68. package/src/migrations/sqlite/meta/0008_snapshot.json +2704 -0
  69. package/src/migrations/sqlite/meta/0009_snapshot.json +2704 -0
  70. package/src/migrations/sqlite/meta/_journal.json +42 -0
  71. package/src/schema.sqlite.ts +31 -3
  72. package/src/schema.ts +37 -3
@@ -0,0 +1,2935 @@
1
+ {
2
+ "id": "b12cae6b-5c5d-421f-b58f-5d0fc48945a8",
3
+ "prevId": "033b31db-8acc-46e1-8e55-577387444ff4",
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_exchange_idx": {
401
+ "name": "audit_log_exchange_idx",
402
+ "columns": [
403
+ {
404
+ "expression": "((\"metadata\")::jsonb ->> 'credentialId')",
405
+ "asc": true,
406
+ "isExpression": true,
407
+ "nulls": "last"
408
+ }
409
+ ],
410
+ "isUnique": false,
411
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.exchange' AND \"audit_log\".\"decision\" = 'allow'",
412
+ "concurrently": false,
413
+ "method": "btree",
414
+ "with": {}
415
+ },
416
+ "audit_log_token_create_idx": {
417
+ "name": "audit_log_token_create_idx",
418
+ "columns": [
419
+ {
420
+ "expression": "((\"metadata\")::jsonb ->> 'targetCredentialId')",
421
+ "asc": true,
422
+ "isExpression": true,
423
+ "nulls": "last"
424
+ }
425
+ ],
426
+ "isUnique": false,
427
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.create' AND \"audit_log\".\"decision\" = 'allow'",
428
+ "concurrently": false,
429
+ "method": "btree",
430
+ "with": {}
431
+ },
432
+ "audit_log_reference_end_idx": {
433
+ "name": "audit_log_reference_end_idx",
434
+ "columns": [
435
+ {
436
+ "expression": "related_seq",
437
+ "isExpression": false,
438
+ "asc": true,
439
+ "nulls": "last"
440
+ }
441
+ ],
442
+ "isUnique": false,
443
+ "where": "\"audit_log\".\"author\" = 'vault' AND \"audit_log\".\"action\" = 'reference.end' AND \"audit_log\".\"decision\" = 'allow'",
444
+ "concurrently": false,
445
+ "method": "btree",
446
+ "with": {}
447
+ },
448
+ "audit_log_also_project_idx": {
449
+ "name": "audit_log_also_project_idx",
450
+ "columns": [
451
+ {
452
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'projectId')",
453
+ "asc": true,
454
+ "isExpression": true,
455
+ "nulls": "last"
456
+ },
457
+ {
458
+ "expression": "seq",
459
+ "isExpression": false,
460
+ "asc": true,
461
+ "nulls": "last"
462
+ }
463
+ ],
464
+ "isUnique": false,
465
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
466
+ "concurrently": false,
467
+ "method": "btree",
468
+ "with": {}
469
+ },
470
+ "audit_log_also_environment_idx": {
471
+ "name": "audit_log_also_environment_idx",
472
+ "columns": [
473
+ {
474
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'environmentId')",
475
+ "asc": true,
476
+ "isExpression": true,
477
+ "nulls": "last"
478
+ },
479
+ {
480
+ "expression": "seq",
481
+ "isExpression": false,
482
+ "asc": true,
483
+ "nulls": "last"
484
+ }
485
+ ],
486
+ "isUnique": false,
487
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
488
+ "concurrently": false,
489
+ "method": "btree",
490
+ "with": {}
491
+ },
492
+ "audit_log_also_secret_idx": {
493
+ "name": "audit_log_also_secret_idx",
494
+ "columns": [
495
+ {
496
+ "expression": "(((\"metadata\")::jsonb -> 'also') ->> 'secretId')",
497
+ "asc": true,
498
+ "isExpression": true,
499
+ "nulls": "last"
500
+ },
501
+ {
502
+ "expression": "seq",
503
+ "isExpression": false,
504
+ "asc": true,
505
+ "nulls": "last"
506
+ }
507
+ ],
508
+ "isUnique": false,
509
+ "where": "((\"audit_log\".\"metadata\")::jsonb -> 'also') IS NOT NULL",
510
+ "concurrently": false,
511
+ "method": "btree",
512
+ "with": {}
513
+ }
514
+ },
515
+ "foreignKeys": {
516
+ "audit_log_project_id_fkey": {
517
+ "name": "audit_log_project_id_fkey",
518
+ "tableFrom": "audit_log",
519
+ "tableTo": "projects",
520
+ "columnsFrom": [
521
+ "project_id"
522
+ ],
523
+ "columnsTo": [
524
+ "id"
525
+ ],
526
+ "onDelete": "restrict",
527
+ "onUpdate": "no action"
528
+ },
529
+ "audit_log_environment_id_fkey": {
530
+ "name": "audit_log_environment_id_fkey",
531
+ "tableFrom": "audit_log",
532
+ "tableTo": "environments",
533
+ "columnsFrom": [
534
+ "environment_id"
535
+ ],
536
+ "columnsTo": [
537
+ "id"
538
+ ],
539
+ "onDelete": "restrict",
540
+ "onUpdate": "no action"
541
+ },
542
+ "audit_log_secret_id_fkey": {
543
+ "name": "audit_log_secret_id_fkey",
544
+ "tableFrom": "audit_log",
545
+ "tableTo": "secrets",
546
+ "columnsFrom": [
547
+ "secret_id"
548
+ ],
549
+ "columnsTo": [
550
+ "id"
551
+ ],
552
+ "onDelete": "restrict",
553
+ "onUpdate": "no action"
554
+ },
555
+ "audit_log_secret_version_id_fkey": {
556
+ "name": "audit_log_secret_version_id_fkey",
557
+ "tableFrom": "audit_log",
558
+ "tableTo": "secret_versions",
559
+ "columnsFrom": [
560
+ "secret_version_id"
561
+ ],
562
+ "columnsTo": [
563
+ "id"
564
+ ],
565
+ "onDelete": "restrict",
566
+ "onUpdate": "no action"
567
+ },
568
+ "audit_log_related_seq_fkey": {
569
+ "name": "audit_log_related_seq_fkey",
570
+ "tableFrom": "audit_log",
571
+ "tableTo": "audit_log",
572
+ "columnsFrom": [
573
+ "related_seq"
574
+ ],
575
+ "columnsTo": [
576
+ "seq"
577
+ ],
578
+ "onDelete": "restrict",
579
+ "onUpdate": "no action"
580
+ }
581
+ },
582
+ "compositePrimaryKeys": {},
583
+ "uniqueConstraints": {},
584
+ "policies": {},
585
+ "checkConstraints": {
586
+ "audit_log_author_check": {
587
+ "name": "audit_log_author_check",
588
+ "value": "\"audit_log\".\"author\" IN ('app', 'vault')"
589
+ },
590
+ "audit_log_actor_check": {
591
+ "name": "audit_log_actor_check",
592
+ "value": "\"audit_log\".\"actor\" ~ '^(user|token|system):.+$'"
593
+ },
594
+ "audit_log_decision_check": {
595
+ "name": "audit_log_decision_check",
596
+ "value": "\"audit_log\".\"decision\" IN ('allow', 'deny')"
597
+ },
598
+ "audit_log_metadata_check": {
599
+ "name": "audit_log_metadata_check",
600
+ "value": "\"audit_log\".\"metadata\"::jsonb IS NOT NULL"
601
+ },
602
+ "audit_log_prev_hash_check": {
603
+ "name": "audit_log_prev_hash_check",
604
+ "value": "octet_length(\"audit_log\".\"prev_hash\") = 32"
605
+ },
606
+ "audit_log_mac_check": {
607
+ "name": "audit_log_mac_check",
608
+ "value": "octet_length(\"audit_log\".\"mac\") = 32"
609
+ },
610
+ "audit_log_hash_check": {
611
+ "name": "audit_log_hash_check",
612
+ "value": "octet_length(\"audit_log\".\"hash\") = 32"
613
+ }
614
+ },
615
+ "isRLSEnabled": false
616
+ },
617
+ "public.consumed_tokens": {
618
+ "name": "consumed_tokens",
619
+ "schema": "",
620
+ "columns": {
621
+ "hash": {
622
+ "name": "hash",
623
+ "type": "bytea",
624
+ "primaryKey": true,
625
+ "notNull": true
626
+ },
627
+ "consumed_at": {
628
+ "name": "consumed_at",
629
+ "type": "timestamp with time zone",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "default": "now()"
633
+ }
634
+ },
635
+ "indexes": {},
636
+ "foreignKeys": {},
637
+ "compositePrimaryKeys": {},
638
+ "uniqueConstraints": {},
639
+ "policies": {},
640
+ "checkConstraints": {
641
+ "consumed_tokens_hash_check": {
642
+ "name": "consumed_tokens_hash_check",
643
+ "value": "octet_length(\"consumed_tokens\".\"hash\") = 32"
644
+ }
645
+ },
646
+ "isRLSEnabled": false
647
+ },
648
+ "public.credentials": {
649
+ "name": "credentials",
650
+ "schema": "",
651
+ "columns": {
652
+ "id": {
653
+ "name": "id",
654
+ "type": "uuid",
655
+ "primaryKey": true,
656
+ "notNull": true,
657
+ "default": "gen_random_uuid()"
658
+ },
659
+ "kind": {
660
+ "name": "kind",
661
+ "type": "text",
662
+ "primaryKey": false,
663
+ "notNull": true
664
+ },
665
+ "auth_mac": {
666
+ "name": "auth_mac",
667
+ "type": "bytea",
668
+ "primaryKey": false,
669
+ "notNull": true
670
+ },
671
+ "token_hash": {
672
+ "name": "token_hash",
673
+ "type": "bytea",
674
+ "primaryKey": false,
675
+ "notNull": true
676
+ },
677
+ "token_hint": {
678
+ "name": "token_hint",
679
+ "type": "text",
680
+ "primaryKey": false,
681
+ "notNull": true
682
+ },
683
+ "generation": {
684
+ "name": "generation",
685
+ "type": "integer",
686
+ "primaryKey": false,
687
+ "notNull": true
688
+ },
689
+ "principal": {
690
+ "name": "principal",
691
+ "type": "text",
692
+ "primaryKey": false,
693
+ "notNull": true
694
+ },
695
+ "identity_id": {
696
+ "name": "identity_id",
697
+ "type": "uuid",
698
+ "primaryKey": false,
699
+ "notNull": false
700
+ },
701
+ "scope": {
702
+ "name": "scope",
703
+ "type": "text",
704
+ "primaryKey": false,
705
+ "notNull": false
706
+ },
707
+ "label": {
708
+ "name": "label",
709
+ "type": "text",
710
+ "primaryKey": false,
711
+ "notNull": false
712
+ },
713
+ "created_at": {
714
+ "name": "created_at",
715
+ "type": "timestamp with time zone",
716
+ "primaryKey": false,
717
+ "notNull": true,
718
+ "default": "now()"
719
+ },
720
+ "created_by": {
721
+ "name": "created_by",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "expires_at": {
727
+ "name": "expires_at",
728
+ "type": "timestamp with time zone",
729
+ "primaryKey": false,
730
+ "notNull": true
731
+ },
732
+ "last_used_at": {
733
+ "name": "last_used_at",
734
+ "type": "timestamp with time zone",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "last_used_ip": {
739
+ "name": "last_used_ip",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": false
743
+ },
744
+ "revoked_at": {
745
+ "name": "revoked_at",
746
+ "type": "timestamp with time zone",
747
+ "primaryKey": false,
748
+ "notNull": false
749
+ },
750
+ "revoked_by": {
751
+ "name": "revoked_by",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": false
755
+ }
756
+ },
757
+ "indexes": {
758
+ "credentials_principal_idx": {
759
+ "name": "credentials_principal_idx",
760
+ "columns": [
761
+ {
762
+ "expression": "principal",
763
+ "isExpression": false,
764
+ "asc": true,
765
+ "nulls": "last"
766
+ },
767
+ {
768
+ "expression": "generation",
769
+ "isExpression": false,
770
+ "asc": true,
771
+ "nulls": "last"
772
+ }
773
+ ],
774
+ "isUnique": false,
775
+ "concurrently": false,
776
+ "method": "btree",
777
+ "with": {}
778
+ },
779
+ "credentials_live_idx": {
780
+ "name": "credentials_live_idx",
781
+ "columns": [
782
+ {
783
+ "expression": "principal",
784
+ "isExpression": false,
785
+ "asc": true,
786
+ "nulls": "last"
787
+ },
788
+ {
789
+ "expression": "expires_at",
790
+ "isExpression": false,
791
+ "asc": true,
792
+ "nulls": "last"
793
+ }
794
+ ],
795
+ "isUnique": false,
796
+ "where": "\"credentials\".\"revoked_at\" IS NULL",
797
+ "concurrently": false,
798
+ "method": "btree",
799
+ "with": {}
800
+ },
801
+ "credentials_issued_by_idx": {
802
+ "name": "credentials_issued_by_idx",
803
+ "columns": [
804
+ {
805
+ "expression": "principal",
806
+ "isExpression": false,
807
+ "asc": true,
808
+ "nulls": "last"
809
+ },
810
+ {
811
+ "expression": "created_by",
812
+ "isExpression": false,
813
+ "asc": true,
814
+ "nulls": "last"
815
+ },
816
+ {
817
+ "expression": "created_at",
818
+ "isExpression": false,
819
+ "asc": true,
820
+ "nulls": "last"
821
+ }
822
+ ],
823
+ "isUnique": false,
824
+ "concurrently": false,
825
+ "method": "btree",
826
+ "with": {}
827
+ }
828
+ },
829
+ "foreignKeys": {
830
+ "credentials_principal_fkey": {
831
+ "name": "credentials_principal_fkey",
832
+ "tableFrom": "credentials",
833
+ "tableTo": "vault_members",
834
+ "columnsFrom": [
835
+ "principal"
836
+ ],
837
+ "columnsTo": [
838
+ "principal"
839
+ ],
840
+ "onDelete": "restrict",
841
+ "onUpdate": "no action"
842
+ },
843
+ "credentials_identity_id_fkey": {
844
+ "name": "credentials_identity_id_fkey",
845
+ "tableFrom": "credentials",
846
+ "tableTo": "identities",
847
+ "columnsFrom": [
848
+ "identity_id",
849
+ "principal",
850
+ "generation"
851
+ ],
852
+ "columnsTo": [
853
+ "id",
854
+ "principal",
855
+ "generation"
856
+ ],
857
+ "onDelete": "restrict",
858
+ "onUpdate": "no action"
859
+ }
860
+ },
861
+ "compositePrimaryKeys": {},
862
+ "uniqueConstraints": {
863
+ "credentials_token_hash_key": {
864
+ "name": "credentials_token_hash_key",
865
+ "nullsNotDistinct": false,
866
+ "columns": [
867
+ "token_hash"
868
+ ]
869
+ }
870
+ },
871
+ "policies": {},
872
+ "checkConstraints": {
873
+ "credentials_kind_check": {
874
+ "name": "credentials_kind_check",
875
+ "value": "\"credentials\".\"kind\" IN ('browser', 'cli', 'service', 'personal')"
876
+ },
877
+ "credentials_principal_check": {
878
+ "name": "credentials_principal_check",
879
+ "value": "\"credentials\".\"principal\" LIKE 'user:%' OR \"credentials\".\"principal\" LIKE 'token:%'"
880
+ },
881
+ "credentials_kind_matches_principal": {
882
+ "name": "credentials_kind_matches_principal",
883
+ "value": "(\"credentials\".\"kind\" = 'service') = (\"credentials\".\"principal\" LIKE 'token:%')"
884
+ },
885
+ "credentials_token_hash_check": {
886
+ "name": "credentials_token_hash_check",
887
+ "value": "octet_length(\"credentials\".\"token_hash\") = 32"
888
+ },
889
+ "credentials_auth_mac_check": {
890
+ "name": "credentials_auth_mac_check",
891
+ "value": "octet_length(\"credentials\".\"auth_mac\") = 32"
892
+ }
893
+ },
894
+ "isRLSEnabled": false
895
+ },
896
+ "public.device_authorizations": {
897
+ "name": "device_authorizations",
898
+ "schema": "",
899
+ "columns": {
900
+ "id": {
901
+ "name": "id",
902
+ "type": "uuid",
903
+ "primaryKey": true,
904
+ "notNull": true,
905
+ "default": "gen_random_uuid()"
906
+ },
907
+ "device_code_hash": {
908
+ "name": "device_code_hash",
909
+ "type": "bytea",
910
+ "primaryKey": false,
911
+ "notNull": true
912
+ },
913
+ "auth_mac": {
914
+ "name": "auth_mac",
915
+ "type": "bytea",
916
+ "primaryKey": false,
917
+ "notNull": true
918
+ },
919
+ "user_code": {
920
+ "name": "user_code",
921
+ "type": "text",
922
+ "primaryKey": false,
923
+ "notNull": true
924
+ },
925
+ "client_label": {
926
+ "name": "client_label",
927
+ "type": "text",
928
+ "primaryKey": false,
929
+ "notNull": false
930
+ },
931
+ "client_ip": {
932
+ "name": "client_ip",
933
+ "type": "text",
934
+ "primaryKey": false,
935
+ "notNull": false
936
+ },
937
+ "created_at": {
938
+ "name": "created_at",
939
+ "type": "timestamp with time zone",
940
+ "primaryKey": false,
941
+ "notNull": true,
942
+ "default": "now()"
943
+ },
944
+ "expires_at": {
945
+ "name": "expires_at",
946
+ "type": "timestamp with time zone",
947
+ "primaryKey": false,
948
+ "notNull": true
949
+ },
950
+ "decided_at": {
951
+ "name": "decided_at",
952
+ "type": "timestamp with time zone",
953
+ "primaryKey": false,
954
+ "notNull": false
955
+ },
956
+ "decision": {
957
+ "name": "decision",
958
+ "type": "text",
959
+ "primaryKey": false,
960
+ "notNull": false
961
+ },
962
+ "generation": {
963
+ "name": "generation",
964
+ "type": "integer",
965
+ "primaryKey": false,
966
+ "notNull": true,
967
+ "default": 0
968
+ },
969
+ "principal": {
970
+ "name": "principal",
971
+ "type": "text",
972
+ "primaryKey": false,
973
+ "notNull": false
974
+ },
975
+ "consumed_at": {
976
+ "name": "consumed_at",
977
+ "type": "timestamp with time zone",
978
+ "primaryKey": false,
979
+ "notNull": false
980
+ }
981
+ },
982
+ "indexes": {},
983
+ "foreignKeys": {
984
+ "device_authorizations_principal_fkey": {
985
+ "name": "device_authorizations_principal_fkey",
986
+ "tableFrom": "device_authorizations",
987
+ "tableTo": "vault_members",
988
+ "columnsFrom": [
989
+ "principal"
990
+ ],
991
+ "columnsTo": [
992
+ "principal"
993
+ ],
994
+ "onDelete": "restrict",
995
+ "onUpdate": "no action"
996
+ }
997
+ },
998
+ "compositePrimaryKeys": {},
999
+ "uniqueConstraints": {
1000
+ "device_authorizations_device_code_hash_key": {
1001
+ "name": "device_authorizations_device_code_hash_key",
1002
+ "nullsNotDistinct": false,
1003
+ "columns": [
1004
+ "device_code_hash"
1005
+ ]
1006
+ },
1007
+ "device_authorizations_user_code_key": {
1008
+ "name": "device_authorizations_user_code_key",
1009
+ "nullsNotDistinct": false,
1010
+ "columns": [
1011
+ "user_code"
1012
+ ]
1013
+ }
1014
+ },
1015
+ "policies": {},
1016
+ "checkConstraints": {
1017
+ "device_authorizations_auth_mac_check": {
1018
+ "name": "device_authorizations_auth_mac_check",
1019
+ "value": "octet_length(\"device_authorizations\".\"auth_mac\") = 32"
1020
+ },
1021
+ "device_authorizations_decision_check": {
1022
+ "name": "device_authorizations_decision_check",
1023
+ "value": "\"device_authorizations\".\"decision\" IS NULL OR \"device_authorizations\".\"decision\" IN ('approved', 'denied')"
1024
+ },
1025
+ "device_authorizations_approval_names_principal": {
1026
+ "name": "device_authorizations_approval_names_principal",
1027
+ "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 ))"
1028
+ }
1029
+ },
1030
+ "isRLSEnabled": false
1031
+ },
1032
+ "public.dismissed_keys": {
1033
+ "name": "dismissed_keys",
1034
+ "schema": "",
1035
+ "columns": {
1036
+ "environment_id": {
1037
+ "name": "environment_id",
1038
+ "type": "uuid",
1039
+ "primaryKey": false,
1040
+ "notNull": true
1041
+ },
1042
+ "key": {
1043
+ "name": "key",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": true
1047
+ },
1048
+ "dismissed_at": {
1049
+ "name": "dismissed_at",
1050
+ "type": "timestamp with time zone",
1051
+ "primaryKey": false,
1052
+ "notNull": true,
1053
+ "default": "now()"
1054
+ },
1055
+ "dismissed_by": {
1056
+ "name": "dismissed_by",
1057
+ "type": "text",
1058
+ "primaryKey": false,
1059
+ "notNull": true
1060
+ },
1061
+ "restored_at": {
1062
+ "name": "restored_at",
1063
+ "type": "timestamp with time zone",
1064
+ "primaryKey": false,
1065
+ "notNull": false
1066
+ },
1067
+ "restored_by": {
1068
+ "name": "restored_by",
1069
+ "type": "text",
1070
+ "primaryKey": false,
1071
+ "notNull": false
1072
+ }
1073
+ },
1074
+ "indexes": {},
1075
+ "foreignKeys": {
1076
+ "dismissed_keys_environment_id_fkey": {
1077
+ "name": "dismissed_keys_environment_id_fkey",
1078
+ "tableFrom": "dismissed_keys",
1079
+ "tableTo": "environments",
1080
+ "columnsFrom": [
1081
+ "environment_id"
1082
+ ],
1083
+ "columnsTo": [
1084
+ "id"
1085
+ ],
1086
+ "onDelete": "restrict",
1087
+ "onUpdate": "no action"
1088
+ }
1089
+ },
1090
+ "compositePrimaryKeys": {
1091
+ "dismissed_keys_pkey": {
1092
+ "name": "dismissed_keys_pkey",
1093
+ "columns": [
1094
+ "environment_id",
1095
+ "key"
1096
+ ]
1097
+ }
1098
+ },
1099
+ "uniqueConstraints": {},
1100
+ "policies": {},
1101
+ "checkConstraints": {
1102
+ "dismissed_keys_key_check": {
1103
+ "name": "dismissed_keys_key_check",
1104
+ "value": "\"dismissed_keys\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
1105
+ }
1106
+ },
1107
+ "isRLSEnabled": false
1108
+ },
1109
+ "public.environments": {
1110
+ "name": "environments",
1111
+ "schema": "",
1112
+ "columns": {
1113
+ "id": {
1114
+ "name": "id",
1115
+ "type": "uuid",
1116
+ "primaryKey": true,
1117
+ "notNull": true,
1118
+ "default": "gen_random_uuid()"
1119
+ },
1120
+ "project_id": {
1121
+ "name": "project_id",
1122
+ "type": "uuid",
1123
+ "primaryKey": false,
1124
+ "notNull": true
1125
+ },
1126
+ "slug": {
1127
+ "name": "slug",
1128
+ "type": "text",
1129
+ "primaryKey": false,
1130
+ "notNull": true
1131
+ },
1132
+ "name": {
1133
+ "name": "name",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": true
1137
+ },
1138
+ "created_at": {
1139
+ "name": "created_at",
1140
+ "type": "timestamp with time zone",
1141
+ "primaryKey": false,
1142
+ "notNull": true,
1143
+ "default": "now()"
1144
+ },
1145
+ "archived_at": {
1146
+ "name": "archived_at",
1147
+ "type": "timestamp with time zone",
1148
+ "primaryKey": false,
1149
+ "notNull": false
1150
+ },
1151
+ "parent_id": {
1152
+ "name": "parent_id",
1153
+ "type": "uuid",
1154
+ "primaryKey": false,
1155
+ "notNull": false
1156
+ }
1157
+ },
1158
+ "indexes": {
1159
+ "environments_parent_idx": {
1160
+ "name": "environments_parent_idx",
1161
+ "columns": [
1162
+ {
1163
+ "expression": "parent_id",
1164
+ "isExpression": false,
1165
+ "asc": true,
1166
+ "nulls": "last"
1167
+ }
1168
+ ],
1169
+ "isUnique": false,
1170
+ "concurrently": false,
1171
+ "method": "btree",
1172
+ "with": {}
1173
+ }
1174
+ },
1175
+ "foreignKeys": {
1176
+ "environments_project_id_fkey": {
1177
+ "name": "environments_project_id_fkey",
1178
+ "tableFrom": "environments",
1179
+ "tableTo": "projects",
1180
+ "columnsFrom": [
1181
+ "project_id"
1182
+ ],
1183
+ "columnsTo": [
1184
+ "id"
1185
+ ],
1186
+ "onDelete": "restrict",
1187
+ "onUpdate": "no action"
1188
+ },
1189
+ "environments_parent_in_project": {
1190
+ "name": "environments_parent_in_project",
1191
+ "tableFrom": "environments",
1192
+ "tableTo": "environments",
1193
+ "columnsFrom": [
1194
+ "parent_id",
1195
+ "project_id"
1196
+ ],
1197
+ "columnsTo": [
1198
+ "id",
1199
+ "project_id"
1200
+ ],
1201
+ "onDelete": "no action",
1202
+ "onUpdate": "no action"
1203
+ }
1204
+ },
1205
+ "compositePrimaryKeys": {},
1206
+ "uniqueConstraints": {
1207
+ "environments_project_id_slug_key": {
1208
+ "name": "environments_project_id_slug_key",
1209
+ "nullsNotDistinct": false,
1210
+ "columns": [
1211
+ "project_id",
1212
+ "slug"
1213
+ ]
1214
+ },
1215
+ "environments_project_scoped": {
1216
+ "name": "environments_project_scoped",
1217
+ "nullsNotDistinct": false,
1218
+ "columns": [
1219
+ "id",
1220
+ "project_id"
1221
+ ]
1222
+ }
1223
+ },
1224
+ "policies": {},
1225
+ "checkConstraints": {
1226
+ "environments_slug_check": {
1227
+ "name": "environments_slug_check",
1228
+ "value": "\"environments\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
1229
+ },
1230
+ "environments_parent_check": {
1231
+ "name": "environments_parent_check",
1232
+ "value": "\"environments\".\"parent_id\" IS NULL OR \"environments\".\"parent_id\" <> \"environments\".\"id\""
1233
+ }
1234
+ },
1235
+ "isRLSEnabled": false
1236
+ },
1237
+ "public.identities": {
1238
+ "name": "identities",
1239
+ "schema": "",
1240
+ "columns": {
1241
+ "id": {
1242
+ "name": "id",
1243
+ "type": "uuid",
1244
+ "primaryKey": true,
1245
+ "notNull": true,
1246
+ "default": "gen_random_uuid()"
1247
+ },
1248
+ "provider": {
1249
+ "name": "provider",
1250
+ "type": "text",
1251
+ "primaryKey": false,
1252
+ "notNull": true
1253
+ },
1254
+ "auth_mac": {
1255
+ "name": "auth_mac",
1256
+ "type": "bytea",
1257
+ "primaryKey": false,
1258
+ "notNull": true
1259
+ },
1260
+ "subject": {
1261
+ "name": "subject",
1262
+ "type": "text",
1263
+ "primaryKey": false,
1264
+ "notNull": true
1265
+ },
1266
+ "issuer_hash": {
1267
+ "name": "issuer_hash",
1268
+ "type": "text",
1269
+ "primaryKey": false,
1270
+ "notNull": true
1271
+ },
1272
+ "generation": {
1273
+ "name": "generation",
1274
+ "type": "integer",
1275
+ "primaryKey": false,
1276
+ "notNull": true
1277
+ },
1278
+ "principal": {
1279
+ "name": "principal",
1280
+ "type": "text",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "email": {
1285
+ "name": "email",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": false
1289
+ },
1290
+ "created_at": {
1291
+ "name": "created_at",
1292
+ "type": "timestamp with time zone",
1293
+ "primaryKey": false,
1294
+ "notNull": true,
1295
+ "default": "now()"
1296
+ },
1297
+ "created_by": {
1298
+ "name": "created_by",
1299
+ "type": "text",
1300
+ "primaryKey": false,
1301
+ "notNull": true
1302
+ },
1303
+ "last_sign_in_at": {
1304
+ "name": "last_sign_in_at",
1305
+ "type": "timestamp with time zone",
1306
+ "primaryKey": false,
1307
+ "notNull": false
1308
+ },
1309
+ "revoked_at": {
1310
+ "name": "revoked_at",
1311
+ "type": "timestamp with time zone",
1312
+ "primaryKey": false,
1313
+ "notNull": false
1314
+ },
1315
+ "revoked_by": {
1316
+ "name": "revoked_by",
1317
+ "type": "text",
1318
+ "primaryKey": false,
1319
+ "notNull": false
1320
+ },
1321
+ "active_subject": {
1322
+ "name": "active_subject",
1323
+ "type": "text",
1324
+ "primaryKey": false,
1325
+ "notNull": false,
1326
+ "generated": {
1327
+ "as": "CASE WHEN revoked_at IS NULL THEN subject END",
1328
+ "type": "stored"
1329
+ }
1330
+ }
1331
+ },
1332
+ "indexes": {
1333
+ "identities_active_subject": {
1334
+ "name": "identities_active_subject",
1335
+ "columns": [
1336
+ {
1337
+ "expression": "provider",
1338
+ "isExpression": false,
1339
+ "asc": true,
1340
+ "nulls": "last"
1341
+ },
1342
+ {
1343
+ "expression": "issuer_hash",
1344
+ "isExpression": false,
1345
+ "asc": true,
1346
+ "nulls": "last"
1347
+ },
1348
+ {
1349
+ "expression": "active_subject",
1350
+ "isExpression": false,
1351
+ "asc": true,
1352
+ "nulls": "last"
1353
+ }
1354
+ ],
1355
+ "isUnique": true,
1356
+ "concurrently": false,
1357
+ "method": "btree",
1358
+ "with": {}
1359
+ },
1360
+ "identities_principal_idx": {
1361
+ "name": "identities_principal_idx",
1362
+ "columns": [
1363
+ {
1364
+ "expression": "principal",
1365
+ "isExpression": false,
1366
+ "asc": true,
1367
+ "nulls": "last"
1368
+ },
1369
+ {
1370
+ "expression": "generation",
1371
+ "isExpression": false,
1372
+ "asc": true,
1373
+ "nulls": "last"
1374
+ }
1375
+ ],
1376
+ "isUnique": false,
1377
+ "concurrently": false,
1378
+ "method": "btree",
1379
+ "with": {}
1380
+ }
1381
+ },
1382
+ "foreignKeys": {
1383
+ "identities_principal_fkey": {
1384
+ "name": "identities_principal_fkey",
1385
+ "tableFrom": "identities",
1386
+ "tableTo": "vault_members",
1387
+ "columnsFrom": [
1388
+ "principal"
1389
+ ],
1390
+ "columnsTo": [
1391
+ "principal"
1392
+ ],
1393
+ "onDelete": "restrict",
1394
+ "onUpdate": "no action"
1395
+ }
1396
+ },
1397
+ "compositePrimaryKeys": {},
1398
+ "uniqueConstraints": {
1399
+ "identities_member_generation_key": {
1400
+ "name": "identities_member_generation_key",
1401
+ "nullsNotDistinct": false,
1402
+ "columns": [
1403
+ "id",
1404
+ "principal",
1405
+ "generation"
1406
+ ]
1407
+ }
1408
+ },
1409
+ "policies": {},
1410
+ "checkConstraints": {
1411
+ "identities_principal_check": {
1412
+ "name": "identities_principal_check",
1413
+ "value": "\"identities\".\"principal\" LIKE 'user:%'"
1414
+ },
1415
+ "identities_provider_check": {
1416
+ "name": "identities_provider_check",
1417
+ "value": "\"identities\".\"provider\" ~ '^[a-z0-9][a-z0-9-]{0,31}$'"
1418
+ },
1419
+ "identities_auth_mac_check": {
1420
+ "name": "identities_auth_mac_check",
1421
+ "value": "octet_length(\"identities\".\"auth_mac\") = 32"
1422
+ }
1423
+ },
1424
+ "isRLSEnabled": false
1425
+ },
1426
+ "public.mcp_approvals": {
1427
+ "name": "mcp_approvals",
1428
+ "schema": "",
1429
+ "columns": {
1430
+ "id": {
1431
+ "name": "id",
1432
+ "type": "uuid",
1433
+ "primaryKey": true,
1434
+ "notNull": true
1435
+ },
1436
+ "connection_id": {
1437
+ "name": "connection_id",
1438
+ "type": "uuid",
1439
+ "primaryKey": false,
1440
+ "notNull": true
1441
+ },
1442
+ "tool": {
1443
+ "name": "tool",
1444
+ "type": "text",
1445
+ "primaryKey": false,
1446
+ "notNull": true
1447
+ },
1448
+ "arguments": {
1449
+ "name": "arguments",
1450
+ "type": "text",
1451
+ "primaryKey": false,
1452
+ "notNull": true
1453
+ },
1454
+ "digest": {
1455
+ "name": "digest",
1456
+ "type": "bytea",
1457
+ "primaryKey": false,
1458
+ "notNull": true
1459
+ },
1460
+ "status": {
1461
+ "name": "status",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": true,
1465
+ "default": "'pending'"
1466
+ },
1467
+ "outcome": {
1468
+ "name": "outcome",
1469
+ "type": "text",
1470
+ "primaryKey": false,
1471
+ "notNull": false
1472
+ },
1473
+ "created_at": {
1474
+ "name": "created_at",
1475
+ "type": "timestamp with time zone",
1476
+ "primaryKey": false,
1477
+ "notNull": true,
1478
+ "default": "now()"
1479
+ },
1480
+ "expires_at": {
1481
+ "name": "expires_at",
1482
+ "type": "timestamp with time zone",
1483
+ "primaryKey": false,
1484
+ "notNull": true
1485
+ },
1486
+ "decided_at": {
1487
+ "name": "decided_at",
1488
+ "type": "timestamp with time zone",
1489
+ "primaryKey": false,
1490
+ "notNull": false
1491
+ },
1492
+ "reported_at": {
1493
+ "name": "reported_at",
1494
+ "type": "timestamp with time zone",
1495
+ "primaryKey": false,
1496
+ "notNull": false
1497
+ }
1498
+ },
1499
+ "indexes": {
1500
+ "mcp_approvals_open_idx": {
1501
+ "name": "mcp_approvals_open_idx",
1502
+ "columns": [
1503
+ {
1504
+ "expression": "connection_id",
1505
+ "isExpression": false,
1506
+ "asc": true,
1507
+ "nulls": "last"
1508
+ },
1509
+ {
1510
+ "expression": "digest",
1511
+ "isExpression": false,
1512
+ "asc": true,
1513
+ "nulls": "last"
1514
+ }
1515
+ ],
1516
+ "isUnique": false,
1517
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL",
1518
+ "concurrently": false,
1519
+ "method": "btree",
1520
+ "with": {}
1521
+ }
1522
+ },
1523
+ "foreignKeys": {
1524
+ "mcp_approvals_connection_fkey": {
1525
+ "name": "mcp_approvals_connection_fkey",
1526
+ "tableFrom": "mcp_approvals",
1527
+ "tableTo": "mcp_connections",
1528
+ "columnsFrom": [
1529
+ "connection_id"
1530
+ ],
1531
+ "columnsTo": [
1532
+ "id"
1533
+ ],
1534
+ "onDelete": "restrict",
1535
+ "onUpdate": "no action"
1536
+ }
1537
+ },
1538
+ "compositePrimaryKeys": {},
1539
+ "uniqueConstraints": {},
1540
+ "policies": {},
1541
+ "checkConstraints": {
1542
+ "mcp_approvals_status_check": {
1543
+ "name": "mcp_approvals_status_check",
1544
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
1545
+ },
1546
+ "mcp_approvals_digest_check": {
1547
+ "name": "mcp_approvals_digest_check",
1548
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
1549
+ },
1550
+ "mcp_approvals_arguments_check": {
1551
+ "name": "mcp_approvals_arguments_check",
1552
+ "value": "\"mcp_approvals\".\"arguments\"::jsonb IS NOT NULL"
1553
+ }
1554
+ },
1555
+ "isRLSEnabled": false
1556
+ },
1557
+ "public.mcp_connections": {
1558
+ "name": "mcp_connections",
1559
+ "schema": "",
1560
+ "columns": {
1561
+ "id": {
1562
+ "name": "id",
1563
+ "type": "uuid",
1564
+ "primaryKey": true,
1565
+ "notNull": true
1566
+ },
1567
+ "auth_mac": {
1568
+ "name": "auth_mac",
1569
+ "type": "bytea",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "principal": {
1574
+ "name": "principal",
1575
+ "type": "text",
1576
+ "primaryKey": false,
1577
+ "notNull": true
1578
+ },
1579
+ "generation": {
1580
+ "name": "generation",
1581
+ "type": "integer",
1582
+ "primaryKey": false,
1583
+ "notNull": true
1584
+ },
1585
+ "client_id": {
1586
+ "name": "client_id",
1587
+ "type": "text",
1588
+ "primaryKey": false,
1589
+ "notNull": true
1590
+ },
1591
+ "client_name": {
1592
+ "name": "client_name",
1593
+ "type": "text",
1594
+ "primaryKey": false,
1595
+ "notNull": true
1596
+ },
1597
+ "client_host": {
1598
+ "name": "client_host",
1599
+ "type": "text",
1600
+ "primaryKey": false,
1601
+ "notNull": false
1602
+ },
1603
+ "registration": {
1604
+ "name": "registration",
1605
+ "type": "text",
1606
+ "primaryKey": false,
1607
+ "notNull": true
1608
+ },
1609
+ "scopes": {
1610
+ "name": "scopes",
1611
+ "type": "text",
1612
+ "primaryKey": false,
1613
+ "notNull": true
1614
+ },
1615
+ "redirect_uri": {
1616
+ "name": "redirect_uri",
1617
+ "type": "text",
1618
+ "primaryKey": false,
1619
+ "notNull": true
1620
+ },
1621
+ "code_hash": {
1622
+ "name": "code_hash",
1623
+ "type": "bytea",
1624
+ "primaryKey": false,
1625
+ "notNull": false
1626
+ },
1627
+ "code_challenge": {
1628
+ "name": "code_challenge",
1629
+ "type": "text",
1630
+ "primaryKey": false,
1631
+ "notNull": false
1632
+ },
1633
+ "code_expires_at": {
1634
+ "name": "code_expires_at",
1635
+ "type": "timestamp with time zone",
1636
+ "primaryKey": false,
1637
+ "notNull": false
1638
+ },
1639
+ "refresh_hash": {
1640
+ "name": "refresh_hash",
1641
+ "type": "bytea",
1642
+ "primaryKey": false,
1643
+ "notNull": false
1644
+ },
1645
+ "refresh_previous_hash": {
1646
+ "name": "refresh_previous_hash",
1647
+ "type": "bytea",
1648
+ "primaryKey": false,
1649
+ "notNull": false
1650
+ },
1651
+ "expires_at": {
1652
+ "name": "expires_at",
1653
+ "type": "timestamp with time zone",
1654
+ "primaryKey": false,
1655
+ "notNull": true
1656
+ },
1657
+ "created_at": {
1658
+ "name": "created_at",
1659
+ "type": "timestamp with time zone",
1660
+ "primaryKey": false,
1661
+ "notNull": true,
1662
+ "default": "now()"
1663
+ },
1664
+ "last_used_at": {
1665
+ "name": "last_used_at",
1666
+ "type": "timestamp with time zone",
1667
+ "primaryKey": false,
1668
+ "notNull": false
1669
+ },
1670
+ "last_used_ip": {
1671
+ "name": "last_used_ip",
1672
+ "type": "text",
1673
+ "primaryKey": false,
1674
+ "notNull": false
1675
+ },
1676
+ "revoked_at": {
1677
+ "name": "revoked_at",
1678
+ "type": "timestamp with time zone",
1679
+ "primaryKey": false,
1680
+ "notNull": false
1681
+ },
1682
+ "revoked_by": {
1683
+ "name": "revoked_by",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": false
1687
+ }
1688
+ },
1689
+ "indexes": {
1690
+ "mcp_connections_refresh_previous_idx": {
1691
+ "name": "mcp_connections_refresh_previous_idx",
1692
+ "columns": [
1693
+ {
1694
+ "expression": "refresh_previous_hash",
1695
+ "isExpression": false,
1696
+ "asc": true,
1697
+ "nulls": "last"
1698
+ }
1699
+ ],
1700
+ "isUnique": false,
1701
+ "concurrently": false,
1702
+ "method": "btree",
1703
+ "with": {}
1704
+ },
1705
+ "mcp_connections_live_idx": {
1706
+ "name": "mcp_connections_live_idx",
1707
+ "columns": [
1708
+ {
1709
+ "expression": "principal",
1710
+ "isExpression": false,
1711
+ "asc": true,
1712
+ "nulls": "last"
1713
+ },
1714
+ {
1715
+ "expression": "expires_at",
1716
+ "isExpression": false,
1717
+ "asc": true,
1718
+ "nulls": "last"
1719
+ }
1720
+ ],
1721
+ "isUnique": false,
1722
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL",
1723
+ "concurrently": false,
1724
+ "method": "btree",
1725
+ "with": {}
1726
+ }
1727
+ },
1728
+ "foreignKeys": {
1729
+ "mcp_connections_principal_fkey": {
1730
+ "name": "mcp_connections_principal_fkey",
1731
+ "tableFrom": "mcp_connections",
1732
+ "tableTo": "vault_members",
1733
+ "columnsFrom": [
1734
+ "principal"
1735
+ ],
1736
+ "columnsTo": [
1737
+ "principal"
1738
+ ],
1739
+ "onDelete": "restrict",
1740
+ "onUpdate": "no action"
1741
+ }
1742
+ },
1743
+ "compositePrimaryKeys": {},
1744
+ "uniqueConstraints": {
1745
+ "mcp_connections_code_hash_key": {
1746
+ "name": "mcp_connections_code_hash_key",
1747
+ "nullsNotDistinct": false,
1748
+ "columns": [
1749
+ "code_hash"
1750
+ ]
1751
+ },
1752
+ "mcp_connections_refresh_hash_key": {
1753
+ "name": "mcp_connections_refresh_hash_key",
1754
+ "nullsNotDistinct": false,
1755
+ "columns": [
1756
+ "refresh_hash"
1757
+ ]
1758
+ }
1759
+ },
1760
+ "policies": {},
1761
+ "checkConstraints": {
1762
+ "mcp_connections_principal_check": {
1763
+ "name": "mcp_connections_principal_check",
1764
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
1765
+ },
1766
+ "mcp_connections_registration_check": {
1767
+ "name": "mcp_connections_registration_check",
1768
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
1769
+ },
1770
+ "mcp_connections_auth_mac_check": {
1771
+ "name": "mcp_connections_auth_mac_check",
1772
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
1773
+ },
1774
+ "mcp_connections_code_hash_check": {
1775
+ "name": "mcp_connections_code_hash_check",
1776
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
1777
+ },
1778
+ "mcp_connections_refresh_hash_check": {
1779
+ "name": "mcp_connections_refresh_hash_check",
1780
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
1781
+ }
1782
+ },
1783
+ "isRLSEnabled": false
1784
+ },
1785
+ "public.oauth_clients": {
1786
+ "name": "oauth_clients",
1787
+ "schema": "",
1788
+ "columns": {
1789
+ "id": {
1790
+ "name": "id",
1791
+ "type": "uuid",
1792
+ "primaryKey": true,
1793
+ "notNull": true
1794
+ },
1795
+ "auth_mac": {
1796
+ "name": "auth_mac",
1797
+ "type": "bytea",
1798
+ "primaryKey": false,
1799
+ "notNull": true
1800
+ },
1801
+ "name": {
1802
+ "name": "name",
1803
+ "type": "text",
1804
+ "primaryKey": false,
1805
+ "notNull": true
1806
+ },
1807
+ "redirect_uris": {
1808
+ "name": "redirect_uris",
1809
+ "type": "text",
1810
+ "primaryKey": false,
1811
+ "notNull": true
1812
+ },
1813
+ "created_at": {
1814
+ "name": "created_at",
1815
+ "type": "timestamp with time zone",
1816
+ "primaryKey": false,
1817
+ "notNull": true,
1818
+ "default": "now()"
1819
+ },
1820
+ "created_ip": {
1821
+ "name": "created_ip",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": false
1825
+ },
1826
+ "revoked_at": {
1827
+ "name": "revoked_at",
1828
+ "type": "timestamp with time zone",
1829
+ "primaryKey": false,
1830
+ "notNull": false
1831
+ }
1832
+ },
1833
+ "indexes": {},
1834
+ "foreignKeys": {},
1835
+ "compositePrimaryKeys": {},
1836
+ "uniqueConstraints": {},
1837
+ "policies": {},
1838
+ "checkConstraints": {
1839
+ "oauth_clients_auth_mac_check": {
1840
+ "name": "oauth_clients_auth_mac_check",
1841
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
1842
+ },
1843
+ "oauth_clients_redirect_uris_check": {
1844
+ "name": "oauth_clients_redirect_uris_check",
1845
+ "value": "\"oauth_clients\".\"redirect_uris\"::jsonb IS NOT NULL"
1846
+ }
1847
+ },
1848
+ "isRLSEnabled": false
1849
+ },
1850
+ "public.projects": {
1851
+ "name": "projects",
1852
+ "schema": "",
1853
+ "columns": {
1854
+ "id": {
1855
+ "name": "id",
1856
+ "type": "uuid",
1857
+ "primaryKey": true,
1858
+ "notNull": true,
1859
+ "default": "gen_random_uuid()"
1860
+ },
1861
+ "slug": {
1862
+ "name": "slug",
1863
+ "type": "text",
1864
+ "primaryKey": false,
1865
+ "notNull": true
1866
+ },
1867
+ "name": {
1868
+ "name": "name",
1869
+ "type": "text",
1870
+ "primaryKey": false,
1871
+ "notNull": true
1872
+ },
1873
+ "created_at": {
1874
+ "name": "created_at",
1875
+ "type": "timestamp with time zone",
1876
+ "primaryKey": false,
1877
+ "notNull": true,
1878
+ "default": "now()"
1879
+ },
1880
+ "archived_at": {
1881
+ "name": "archived_at",
1882
+ "type": "timestamp with time zone",
1883
+ "primaryKey": false,
1884
+ "notNull": false
1885
+ },
1886
+ "folder": {
1887
+ "name": "folder",
1888
+ "type": "text",
1889
+ "primaryKey": false,
1890
+ "notNull": false
1891
+ }
1892
+ },
1893
+ "indexes": {},
1894
+ "foreignKeys": {},
1895
+ "compositePrimaryKeys": {},
1896
+ "uniqueConstraints": {
1897
+ "projects_slug_key": {
1898
+ "name": "projects_slug_key",
1899
+ "nullsNotDistinct": false,
1900
+ "columns": [
1901
+ "slug"
1902
+ ]
1903
+ }
1904
+ },
1905
+ "policies": {},
1906
+ "checkConstraints": {
1907
+ "projects_slug_check": {
1908
+ "name": "projects_slug_check",
1909
+ "value": "\"projects\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}(~[a-z0-9-]{1,40})?$'"
1910
+ },
1911
+ "projects_folder_check": {
1912
+ "name": "projects_folder_check",
1913
+ "value": "\"projects\".\"folder\" IS NULL OR (char_length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" !~ '[/[:cntrl:]]' AND \"projects\".\"folder\" = btrim(\"projects\".\"folder\"))"
1914
+ }
1915
+ },
1916
+ "isRLSEnabled": false
1917
+ },
1918
+ "public.secret_references": {
1919
+ "name": "secret_references",
1920
+ "schema": "",
1921
+ "columns": {
1922
+ "id": {
1923
+ "name": "id",
1924
+ "type": "uuid",
1925
+ "primaryKey": true,
1926
+ "notNull": true
1927
+ },
1928
+ "project_id": {
1929
+ "name": "project_id",
1930
+ "type": "uuid",
1931
+ "primaryKey": false,
1932
+ "notNull": true
1933
+ },
1934
+ "environment_id": {
1935
+ "name": "environment_id",
1936
+ "type": "uuid",
1937
+ "primaryKey": false,
1938
+ "notNull": true
1939
+ },
1940
+ "secret_id": {
1941
+ "name": "secret_id",
1942
+ "type": "uuid",
1943
+ "primaryKey": false,
1944
+ "notNull": true
1945
+ },
1946
+ "source_project_id": {
1947
+ "name": "source_project_id",
1948
+ "type": "uuid",
1949
+ "primaryKey": false,
1950
+ "notNull": true
1951
+ },
1952
+ "source_environment_id": {
1953
+ "name": "source_environment_id",
1954
+ "type": "uuid",
1955
+ "primaryKey": false,
1956
+ "notNull": true
1957
+ },
1958
+ "source_secret_id": {
1959
+ "name": "source_secret_id",
1960
+ "type": "uuid",
1961
+ "primaryKey": false,
1962
+ "notNull": true
1963
+ },
1964
+ "created_seq": {
1965
+ "name": "created_seq",
1966
+ "type": "bigint",
1967
+ "primaryKey": false,
1968
+ "notNull": true
1969
+ },
1970
+ "created_at": {
1971
+ "name": "created_at",
1972
+ "type": "timestamp with time zone",
1973
+ "primaryKey": false,
1974
+ "notNull": true,
1975
+ "default": "now()"
1976
+ },
1977
+ "created_by": {
1978
+ "name": "created_by",
1979
+ "type": "text",
1980
+ "primaryKey": false,
1981
+ "notNull": true
1982
+ }
1983
+ },
1984
+ "indexes": {
1985
+ "secret_references_holder_idx": {
1986
+ "name": "secret_references_holder_idx",
1987
+ "columns": [
1988
+ {
1989
+ "expression": "secret_id",
1990
+ "isExpression": false,
1991
+ "asc": true,
1992
+ "nulls": "last"
1993
+ },
1994
+ {
1995
+ "expression": "created_seq",
1996
+ "isExpression": false,
1997
+ "asc": true,
1998
+ "nulls": "last"
1999
+ }
2000
+ ],
2001
+ "isUnique": false,
2002
+ "concurrently": false,
2003
+ "method": "btree",
2004
+ "with": {}
2005
+ },
2006
+ "secret_references_source_idx": {
2007
+ "name": "secret_references_source_idx",
2008
+ "columns": [
2009
+ {
2010
+ "expression": "source_secret_id",
2011
+ "isExpression": false,
2012
+ "asc": true,
2013
+ "nulls": "last"
2014
+ }
2015
+ ],
2016
+ "isUnique": false,
2017
+ "concurrently": false,
2018
+ "method": "btree",
2019
+ "with": {}
2020
+ },
2021
+ "secret_references_project_idx": {
2022
+ "name": "secret_references_project_idx",
2023
+ "columns": [
2024
+ {
2025
+ "expression": "project_id",
2026
+ "isExpression": false,
2027
+ "asc": true,
2028
+ "nulls": "last"
2029
+ }
2030
+ ],
2031
+ "isUnique": false,
2032
+ "concurrently": false,
2033
+ "method": "btree",
2034
+ "with": {}
2035
+ },
2036
+ "secret_references_source_project_idx": {
2037
+ "name": "secret_references_source_project_idx",
2038
+ "columns": [
2039
+ {
2040
+ "expression": "source_project_id",
2041
+ "isExpression": false,
2042
+ "asc": true,
2043
+ "nulls": "last"
2044
+ }
2045
+ ],
2046
+ "isUnique": false,
2047
+ "concurrently": false,
2048
+ "method": "btree",
2049
+ "with": {}
2050
+ },
2051
+ "secret_references_created_by_idx": {
2052
+ "name": "secret_references_created_by_idx",
2053
+ "columns": [
2054
+ {
2055
+ "expression": "created_by",
2056
+ "isExpression": false,
2057
+ "asc": true,
2058
+ "nulls": "last"
2059
+ }
2060
+ ],
2061
+ "isUnique": false,
2062
+ "concurrently": false,
2063
+ "method": "btree",
2064
+ "with": {}
2065
+ }
2066
+ },
2067
+ "foreignKeys": {
2068
+ "secret_references_secret_id_fkey": {
2069
+ "name": "secret_references_secret_id_fkey",
2070
+ "tableFrom": "secret_references",
2071
+ "tableTo": "secrets",
2072
+ "columnsFrom": [
2073
+ "secret_id"
2074
+ ],
2075
+ "columnsTo": [
2076
+ "id"
2077
+ ],
2078
+ "onDelete": "restrict",
2079
+ "onUpdate": "no action"
2080
+ },
2081
+ "secret_references_source_secret_id_fkey": {
2082
+ "name": "secret_references_source_secret_id_fkey",
2083
+ "tableFrom": "secret_references",
2084
+ "tableTo": "secrets",
2085
+ "columnsFrom": [
2086
+ "source_secret_id"
2087
+ ],
2088
+ "columnsTo": [
2089
+ "id"
2090
+ ],
2091
+ "onDelete": "restrict",
2092
+ "onUpdate": "no action"
2093
+ },
2094
+ "secret_references_created_seq_fkey": {
2095
+ "name": "secret_references_created_seq_fkey",
2096
+ "tableFrom": "secret_references",
2097
+ "tableTo": "audit_log",
2098
+ "columnsFrom": [
2099
+ "created_seq"
2100
+ ],
2101
+ "columnsTo": [
2102
+ "seq"
2103
+ ],
2104
+ "onDelete": "restrict",
2105
+ "onUpdate": "no action"
2106
+ }
2107
+ },
2108
+ "compositePrimaryKeys": {},
2109
+ "uniqueConstraints": {
2110
+ "secret_references_created_seq_key": {
2111
+ "name": "secret_references_created_seq_key",
2112
+ "nullsNotDistinct": false,
2113
+ "columns": [
2114
+ "created_seq"
2115
+ ]
2116
+ }
2117
+ },
2118
+ "policies": {},
2119
+ "checkConstraints": {},
2120
+ "isRLSEnabled": false
2121
+ },
2122
+ "public.secret_versions": {
2123
+ "name": "secret_versions",
2124
+ "schema": "",
2125
+ "columns": {
2126
+ "id": {
2127
+ "name": "id",
2128
+ "type": "uuid",
2129
+ "primaryKey": true,
2130
+ "notNull": true,
2131
+ "default": "gen_random_uuid()"
2132
+ },
2133
+ "secret_id": {
2134
+ "name": "secret_id",
2135
+ "type": "uuid",
2136
+ "primaryKey": false,
2137
+ "notNull": true
2138
+ },
2139
+ "version": {
2140
+ "name": "version",
2141
+ "type": "integer",
2142
+ "primaryKey": false,
2143
+ "notNull": true
2144
+ },
2145
+ "envelope_version": {
2146
+ "name": "envelope_version",
2147
+ "type": "integer",
2148
+ "primaryKey": false,
2149
+ "notNull": true
2150
+ },
2151
+ "ciphertext": {
2152
+ "name": "ciphertext",
2153
+ "type": "bytea",
2154
+ "primaryKey": false,
2155
+ "notNull": true
2156
+ },
2157
+ "iv": {
2158
+ "name": "iv",
2159
+ "type": "bytea",
2160
+ "primaryKey": false,
2161
+ "notNull": true
2162
+ },
2163
+ "auth_tag": {
2164
+ "name": "auth_tag",
2165
+ "type": "bytea",
2166
+ "primaryKey": false,
2167
+ "notNull": true
2168
+ },
2169
+ "wrapped_dek": {
2170
+ "name": "wrapped_dek",
2171
+ "type": "bytea",
2172
+ "primaryKey": false,
2173
+ "notNull": true
2174
+ },
2175
+ "kek_provider": {
2176
+ "name": "kek_provider",
2177
+ "type": "text",
2178
+ "primaryKey": false,
2179
+ "notNull": true
2180
+ },
2181
+ "kek_id": {
2182
+ "name": "kek_id",
2183
+ "type": "text",
2184
+ "primaryKey": false,
2185
+ "notNull": true
2186
+ },
2187
+ "kek_version": {
2188
+ "name": "kek_version",
2189
+ "type": "text",
2190
+ "primaryKey": false,
2191
+ "notNull": true
2192
+ },
2193
+ "created_at": {
2194
+ "name": "created_at",
2195
+ "type": "timestamp with time zone",
2196
+ "primaryKey": false,
2197
+ "notNull": true,
2198
+ "default": "now()"
2199
+ },
2200
+ "created_by": {
2201
+ "name": "created_by",
2202
+ "type": "text",
2203
+ "primaryKey": false,
2204
+ "notNull": true
2205
+ }
2206
+ },
2207
+ "indexes": {
2208
+ "secret_versions_secret_idx": {
2209
+ "name": "secret_versions_secret_idx",
2210
+ "columns": [
2211
+ {
2212
+ "expression": "secret_id",
2213
+ "isExpression": false,
2214
+ "asc": true,
2215
+ "nulls": "last"
2216
+ },
2217
+ {
2218
+ "expression": "version",
2219
+ "isExpression": false,
2220
+ "asc": false,
2221
+ "nulls": "last"
2222
+ }
2223
+ ],
2224
+ "isUnique": false,
2225
+ "concurrently": false,
2226
+ "method": "btree",
2227
+ "with": {}
2228
+ }
2229
+ },
2230
+ "foreignKeys": {
2231
+ "secret_versions_secret_id_fkey": {
2232
+ "name": "secret_versions_secret_id_fkey",
2233
+ "tableFrom": "secret_versions",
2234
+ "tableTo": "secrets",
2235
+ "columnsFrom": [
2236
+ "secret_id"
2237
+ ],
2238
+ "columnsTo": [
2239
+ "id"
2240
+ ],
2241
+ "onDelete": "restrict",
2242
+ "onUpdate": "no action"
2243
+ }
2244
+ },
2245
+ "compositePrimaryKeys": {},
2246
+ "uniqueConstraints": {
2247
+ "secret_versions_secret_id_version_key": {
2248
+ "name": "secret_versions_secret_id_version_key",
2249
+ "nullsNotDistinct": false,
2250
+ "columns": [
2251
+ "secret_id",
2252
+ "version"
2253
+ ]
2254
+ }
2255
+ },
2256
+ "policies": {},
2257
+ "checkConstraints": {
2258
+ "secret_versions_version_check": {
2259
+ "name": "secret_versions_version_check",
2260
+ "value": "\"secret_versions\".\"version\" > 0"
2261
+ },
2262
+ "secret_versions_iv_check": {
2263
+ "name": "secret_versions_iv_check",
2264
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
2265
+ },
2266
+ "secret_versions_auth_tag_check": {
2267
+ "name": "secret_versions_auth_tag_check",
2268
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
2269
+ }
2270
+ },
2271
+ "isRLSEnabled": false
2272
+ },
2273
+ "public.secrets": {
2274
+ "name": "secrets",
2275
+ "schema": "",
2276
+ "columns": {
2277
+ "id": {
2278
+ "name": "id",
2279
+ "type": "uuid",
2280
+ "primaryKey": true,
2281
+ "notNull": true,
2282
+ "default": "gen_random_uuid()"
2283
+ },
2284
+ "project_id": {
2285
+ "name": "project_id",
2286
+ "type": "uuid",
2287
+ "primaryKey": false,
2288
+ "notNull": true
2289
+ },
2290
+ "environment_id": {
2291
+ "name": "environment_id",
2292
+ "type": "uuid",
2293
+ "primaryKey": false,
2294
+ "notNull": true
2295
+ },
2296
+ "key": {
2297
+ "name": "key",
2298
+ "type": "text",
2299
+ "primaryKey": false,
2300
+ "notNull": true
2301
+ },
2302
+ "created_at": {
2303
+ "name": "created_at",
2304
+ "type": "timestamp with time zone",
2305
+ "primaryKey": false,
2306
+ "notNull": true,
2307
+ "default": "now()"
2308
+ },
2309
+ "updated_at": {
2310
+ "name": "updated_at",
2311
+ "type": "timestamp with time zone",
2312
+ "primaryKey": false,
2313
+ "notNull": true,
2314
+ "default": "now()"
2315
+ },
2316
+ "current_version_id": {
2317
+ "name": "current_version_id",
2318
+ "type": "uuid",
2319
+ "primaryKey": false,
2320
+ "notNull": false
2321
+ },
2322
+ "current_version": {
2323
+ "name": "current_version",
2324
+ "type": "integer",
2325
+ "primaryKey": false,
2326
+ "notNull": true,
2327
+ "default": 0
2328
+ },
2329
+ "archived_at": {
2330
+ "name": "archived_at",
2331
+ "type": "timestamp with time zone",
2332
+ "primaryKey": false,
2333
+ "notNull": false
2334
+ },
2335
+ "folder": {
2336
+ "name": "folder",
2337
+ "type": "text",
2338
+ "primaryKey": false,
2339
+ "notNull": false
2340
+ }
2341
+ },
2342
+ "indexes": {
2343
+ "secrets_lookup_idx": {
2344
+ "name": "secrets_lookup_idx",
2345
+ "columns": [
2346
+ {
2347
+ "expression": "project_id",
2348
+ "isExpression": false,
2349
+ "asc": true,
2350
+ "nulls": "last"
2351
+ },
2352
+ {
2353
+ "expression": "environment_id",
2354
+ "isExpression": false,
2355
+ "asc": true,
2356
+ "nulls": "last"
2357
+ },
2358
+ {
2359
+ "expression": "key",
2360
+ "isExpression": false,
2361
+ "asc": true,
2362
+ "nulls": "last"
2363
+ }
2364
+ ],
2365
+ "isUnique": false,
2366
+ "concurrently": false,
2367
+ "method": "btree",
2368
+ "with": {}
2369
+ }
2370
+ },
2371
+ "foreignKeys": {
2372
+ "secrets_current_version_id_secret_versions_id_fk": {
2373
+ "name": "secrets_current_version_id_secret_versions_id_fk",
2374
+ "tableFrom": "secrets",
2375
+ "tableTo": "secret_versions",
2376
+ "columnsFrom": [
2377
+ "current_version_id"
2378
+ ],
2379
+ "columnsTo": [
2380
+ "id"
2381
+ ],
2382
+ "onDelete": "no action",
2383
+ "onUpdate": "no action"
2384
+ },
2385
+ "secrets_project_id_fkey": {
2386
+ "name": "secrets_project_id_fkey",
2387
+ "tableFrom": "secrets",
2388
+ "tableTo": "projects",
2389
+ "columnsFrom": [
2390
+ "project_id"
2391
+ ],
2392
+ "columnsTo": [
2393
+ "id"
2394
+ ],
2395
+ "onDelete": "restrict",
2396
+ "onUpdate": "no action"
2397
+ },
2398
+ "secrets_environment_id_fkey": {
2399
+ "name": "secrets_environment_id_fkey",
2400
+ "tableFrom": "secrets",
2401
+ "tableTo": "environments",
2402
+ "columnsFrom": [
2403
+ "environment_id"
2404
+ ],
2405
+ "columnsTo": [
2406
+ "id"
2407
+ ],
2408
+ "onDelete": "restrict",
2409
+ "onUpdate": "no action"
2410
+ },
2411
+ "secrets_environment_in_project": {
2412
+ "name": "secrets_environment_in_project",
2413
+ "tableFrom": "secrets",
2414
+ "tableTo": "environments",
2415
+ "columnsFrom": [
2416
+ "environment_id",
2417
+ "project_id"
2418
+ ],
2419
+ "columnsTo": [
2420
+ "id",
2421
+ "project_id"
2422
+ ],
2423
+ "onDelete": "no action",
2424
+ "onUpdate": "no action"
2425
+ }
2426
+ },
2427
+ "compositePrimaryKeys": {},
2428
+ "uniqueConstraints": {
2429
+ "secrets_project_id_environment_id_key_key": {
2430
+ "name": "secrets_project_id_environment_id_key_key",
2431
+ "nullsNotDistinct": false,
2432
+ "columns": [
2433
+ "project_id",
2434
+ "environment_id",
2435
+ "key"
2436
+ ]
2437
+ }
2438
+ },
2439
+ "policies": {},
2440
+ "checkConstraints": {
2441
+ "secrets_key_check": {
2442
+ "name": "secrets_key_check",
2443
+ "value": "\"secrets\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
2444
+ },
2445
+ "secrets_folder_check": {
2446
+ "name": "secrets_folder_check",
2447
+ "value": "\"secrets\".\"folder\" IS NULL OR (char_length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" !~ '[/[:cntrl:]]' AND \"secrets\".\"folder\" = btrim(\"secrets\".\"folder\"))"
2448
+ }
2449
+ },
2450
+ "isRLSEnabled": false
2451
+ },
2452
+ "public.service_bindings": {
2453
+ "name": "service_bindings",
2454
+ "schema": "",
2455
+ "columns": {
2456
+ "id": {
2457
+ "name": "id",
2458
+ "type": "uuid",
2459
+ "primaryKey": true,
2460
+ "notNull": true
2461
+ },
2462
+ "auth_mac": {
2463
+ "name": "auth_mac",
2464
+ "type": "bytea",
2465
+ "primaryKey": false,
2466
+ "notNull": true
2467
+ },
2468
+ "principal": {
2469
+ "name": "principal",
2470
+ "type": "text",
2471
+ "primaryKey": false,
2472
+ "notNull": true
2473
+ },
2474
+ "generation": {
2475
+ "name": "generation",
2476
+ "type": "integer",
2477
+ "primaryKey": false,
2478
+ "notNull": true
2479
+ },
2480
+ "profile": {
2481
+ "name": "profile",
2482
+ "type": "text",
2483
+ "primaryKey": false,
2484
+ "notNull": true
2485
+ },
2486
+ "issuer": {
2487
+ "name": "issuer",
2488
+ "type": "text",
2489
+ "primaryKey": false,
2490
+ "notNull": true
2491
+ },
2492
+ "jwks_uri": {
2493
+ "name": "jwks_uri",
2494
+ "type": "text",
2495
+ "primaryKey": false,
2496
+ "notNull": true
2497
+ },
2498
+ "jwks": {
2499
+ "name": "jwks",
2500
+ "type": "text",
2501
+ "primaryKey": false,
2502
+ "notNull": false
2503
+ },
2504
+ "claims": {
2505
+ "name": "claims",
2506
+ "type": "text",
2507
+ "primaryKey": false,
2508
+ "notNull": true
2509
+ },
2510
+ "scope": {
2511
+ "name": "scope",
2512
+ "type": "text",
2513
+ "primaryKey": false,
2514
+ "notNull": false
2515
+ },
2516
+ "label": {
2517
+ "name": "label",
2518
+ "type": "text",
2519
+ "primaryKey": false,
2520
+ "notNull": false
2521
+ },
2522
+ "created_at": {
2523
+ "name": "created_at",
2524
+ "type": "timestamp with time zone",
2525
+ "primaryKey": false,
2526
+ "notNull": true,
2527
+ "default": "now()"
2528
+ },
2529
+ "created_by": {
2530
+ "name": "created_by",
2531
+ "type": "text",
2532
+ "primaryKey": false,
2533
+ "notNull": true
2534
+ },
2535
+ "last_used_at": {
2536
+ "name": "last_used_at",
2537
+ "type": "timestamp with time zone",
2538
+ "primaryKey": false,
2539
+ "notNull": false
2540
+ },
2541
+ "revoked_at": {
2542
+ "name": "revoked_at",
2543
+ "type": "timestamp with time zone",
2544
+ "primaryKey": false,
2545
+ "notNull": false
2546
+ },
2547
+ "revoked_by": {
2548
+ "name": "revoked_by",
2549
+ "type": "text",
2550
+ "primaryKey": false,
2551
+ "notNull": false
2552
+ }
2553
+ },
2554
+ "indexes": {
2555
+ "service_bindings_principal_idx": {
2556
+ "name": "service_bindings_principal_idx",
2557
+ "columns": [
2558
+ {
2559
+ "expression": "principal",
2560
+ "isExpression": false,
2561
+ "asc": true,
2562
+ "nulls": "last"
2563
+ },
2564
+ {
2565
+ "expression": "issuer",
2566
+ "isExpression": false,
2567
+ "asc": true,
2568
+ "nulls": "last"
2569
+ }
2570
+ ],
2571
+ "isUnique": false,
2572
+ "concurrently": false,
2573
+ "method": "btree",
2574
+ "with": {}
2575
+ },
2576
+ "service_bindings_live_idx": {
2577
+ "name": "service_bindings_live_idx",
2578
+ "columns": [
2579
+ {
2580
+ "expression": "principal",
2581
+ "isExpression": false,
2582
+ "asc": true,
2583
+ "nulls": "last"
2584
+ },
2585
+ {
2586
+ "expression": "issuer",
2587
+ "isExpression": false,
2588
+ "asc": true,
2589
+ "nulls": "last"
2590
+ },
2591
+ {
2592
+ "expression": "generation",
2593
+ "isExpression": false,
2594
+ "asc": true,
2595
+ "nulls": "last"
2596
+ },
2597
+ {
2598
+ "expression": "created_at",
2599
+ "isExpression": false,
2600
+ "asc": true,
2601
+ "nulls": "last"
2602
+ },
2603
+ {
2604
+ "expression": "id",
2605
+ "isExpression": false,
2606
+ "asc": true,
2607
+ "nulls": "last"
2608
+ }
2609
+ ],
2610
+ "isUnique": false,
2611
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL",
2612
+ "concurrently": false,
2613
+ "method": "btree",
2614
+ "with": {}
2615
+ }
2616
+ },
2617
+ "foreignKeys": {
2618
+ "service_bindings_principal_fkey": {
2619
+ "name": "service_bindings_principal_fkey",
2620
+ "tableFrom": "service_bindings",
2621
+ "tableTo": "vault_members",
2622
+ "columnsFrom": [
2623
+ "principal"
2624
+ ],
2625
+ "columnsTo": [
2626
+ "principal"
2627
+ ],
2628
+ "onDelete": "restrict",
2629
+ "onUpdate": "no action"
2630
+ }
2631
+ },
2632
+ "compositePrimaryKeys": {},
2633
+ "uniqueConstraints": {},
2634
+ "policies": {},
2635
+ "checkConstraints": {
2636
+ "service_bindings_principal_check": {
2637
+ "name": "service_bindings_principal_check",
2638
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
2639
+ },
2640
+ "service_bindings_auth_mac_check": {
2641
+ "name": "service_bindings_auth_mac_check",
2642
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
2643
+ },
2644
+ "service_bindings_claims_check": {
2645
+ "name": "service_bindings_claims_check",
2646
+ "value": "\"service_bindings\".\"claims\"::jsonb IS NOT NULL"
2647
+ }
2648
+ },
2649
+ "isRLSEnabled": false
2650
+ },
2651
+ "public.vault_grants": {
2652
+ "name": "vault_grants",
2653
+ "schema": "",
2654
+ "columns": {
2655
+ "principal": {
2656
+ "name": "principal",
2657
+ "type": "text",
2658
+ "primaryKey": false,
2659
+ "notNull": true
2660
+ },
2661
+ "project_id": {
2662
+ "name": "project_id",
2663
+ "type": "uuid",
2664
+ "primaryKey": false,
2665
+ "notNull": false
2666
+ },
2667
+ "environment_id": {
2668
+ "name": "environment_id",
2669
+ "type": "uuid",
2670
+ "primaryKey": false,
2671
+ "notNull": false
2672
+ },
2673
+ "environment_slug": {
2674
+ "name": "environment_slug",
2675
+ "type": "text",
2676
+ "primaryKey": false,
2677
+ "notNull": false
2678
+ },
2679
+ "role": {
2680
+ "name": "role",
2681
+ "type": "text",
2682
+ "primaryKey": false,
2683
+ "notNull": true
2684
+ },
2685
+ "expires_at": {
2686
+ "name": "expires_at",
2687
+ "type": "bigint",
2688
+ "primaryKey": false,
2689
+ "notNull": false
2690
+ },
2691
+ "granted_at": {
2692
+ "name": "granted_at",
2693
+ "type": "bigint",
2694
+ "primaryKey": false,
2695
+ "notNull": true
2696
+ },
2697
+ "granted_by": {
2698
+ "name": "granted_by",
2699
+ "type": "text",
2700
+ "primaryKey": false,
2701
+ "notNull": true
2702
+ }
2703
+ },
2704
+ "indexes": {
2705
+ "vault_grants_on_every_project": {
2706
+ "name": "vault_grants_on_every_project",
2707
+ "columns": [
2708
+ {
2709
+ "expression": "principal",
2710
+ "isExpression": false,
2711
+ "asc": true,
2712
+ "nulls": "last"
2713
+ }
2714
+ ],
2715
+ "isUnique": true,
2716
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL",
2717
+ "concurrently": false,
2718
+ "method": "btree",
2719
+ "with": {}
2720
+ }
2721
+ },
2722
+ "foreignKeys": {
2723
+ "vault_grants_principal_fkey": {
2724
+ "name": "vault_grants_principal_fkey",
2725
+ "tableFrom": "vault_grants",
2726
+ "tableTo": "vault_members",
2727
+ "columnsFrom": [
2728
+ "principal"
2729
+ ],
2730
+ "columnsTo": [
2731
+ "principal"
2732
+ ],
2733
+ "onDelete": "restrict",
2734
+ "onUpdate": "no action"
2735
+ },
2736
+ "vault_grants_project_id_fkey": {
2737
+ "name": "vault_grants_project_id_fkey",
2738
+ "tableFrom": "vault_grants",
2739
+ "tableTo": "projects",
2740
+ "columnsFrom": [
2741
+ "project_id"
2742
+ ],
2743
+ "columnsTo": [
2744
+ "id"
2745
+ ],
2746
+ "onDelete": "restrict",
2747
+ "onUpdate": "no action"
2748
+ },
2749
+ "vault_grants_environment_id_fkey": {
2750
+ "name": "vault_grants_environment_id_fkey",
2751
+ "tableFrom": "vault_grants",
2752
+ "tableTo": "environments",
2753
+ "columnsFrom": [
2754
+ "environment_id"
2755
+ ],
2756
+ "columnsTo": [
2757
+ "id"
2758
+ ],
2759
+ "onDelete": "restrict",
2760
+ "onUpdate": "no action"
2761
+ }
2762
+ },
2763
+ "compositePrimaryKeys": {},
2764
+ "uniqueConstraints": {
2765
+ "vault_grants_on_project": {
2766
+ "name": "vault_grants_on_project",
2767
+ "nullsNotDistinct": false,
2768
+ "columns": [
2769
+ "principal",
2770
+ "project_id"
2771
+ ]
2772
+ },
2773
+ "vault_grants_on_environment": {
2774
+ "name": "vault_grants_on_environment",
2775
+ "nullsNotDistinct": false,
2776
+ "columns": [
2777
+ "principal",
2778
+ "environment_id"
2779
+ ]
2780
+ },
2781
+ "vault_grants_on_environment_slug": {
2782
+ "name": "vault_grants_on_environment_slug",
2783
+ "nullsNotDistinct": false,
2784
+ "columns": [
2785
+ "principal",
2786
+ "environment_slug"
2787
+ ]
2788
+ }
2789
+ },
2790
+ "policies": {},
2791
+ "checkConstraints": {
2792
+ "vault_grants_one_place": {
2793
+ "name": "vault_grants_one_place",
2794
+ "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)"
2795
+ },
2796
+ "vault_grants_environment_slug_check": {
2797
+ "name": "vault_grants_environment_slug_check",
2798
+ "value": "\"vault_grants\".\"environment_slug\" IS NULL OR \"vault_grants\".\"environment_slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
2799
+ },
2800
+ "vault_grants_role_check": {
2801
+ "name": "vault_grants_role_check",
2802
+ "value": "\"vault_grants\".\"role\" IN ('viewer', 'developer', 'maintainer', 'access-manager', 'auditor', 'owner')"
2803
+ },
2804
+ "vault_grants_environment_role_check": {
2805
+ "name": "vault_grants_environment_role_check",
2806
+ "value": "(\"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL) OR \"vault_grants\".\"role\" IN ('viewer', 'developer', 'auditor')"
2807
+ }
2808
+ },
2809
+ "isRLSEnabled": false
2810
+ },
2811
+ "public.vault_members": {
2812
+ "name": "vault_members",
2813
+ "schema": "",
2814
+ "columns": {
2815
+ "principal": {
2816
+ "name": "principal",
2817
+ "type": "text",
2818
+ "primaryKey": true,
2819
+ "notNull": true
2820
+ },
2821
+ "status": {
2822
+ "name": "status",
2823
+ "type": "text",
2824
+ "primaryKey": false,
2825
+ "notNull": true
2826
+ },
2827
+ "owner": {
2828
+ "name": "owner",
2829
+ "type": "boolean",
2830
+ "primaryKey": false,
2831
+ "notNull": true,
2832
+ "default": false
2833
+ },
2834
+ "role": {
2835
+ "name": "role",
2836
+ "type": "text",
2837
+ "primaryKey": false,
2838
+ "notNull": false
2839
+ },
2840
+ "scope": {
2841
+ "name": "scope",
2842
+ "type": "text",
2843
+ "primaryKey": false,
2844
+ "notNull": false
2845
+ },
2846
+ "generation": {
2847
+ "name": "generation",
2848
+ "type": "integer",
2849
+ "primaryKey": false,
2850
+ "notNull": true,
2851
+ "default": 0
2852
+ },
2853
+ "created_at": {
2854
+ "name": "created_at",
2855
+ "type": "bigint",
2856
+ "primaryKey": false,
2857
+ "notNull": true
2858
+ },
2859
+ "created_by": {
2860
+ "name": "created_by",
2861
+ "type": "text",
2862
+ "primaryKey": false,
2863
+ "notNull": true
2864
+ },
2865
+ "status_changed_at": {
2866
+ "name": "status_changed_at",
2867
+ "type": "bigint",
2868
+ "primaryKey": false,
2869
+ "notNull": true
2870
+ },
2871
+ "status_changed_by": {
2872
+ "name": "status_changed_by",
2873
+ "type": "text",
2874
+ "primaryKey": false,
2875
+ "notNull": true
2876
+ },
2877
+ "access_seq": {
2878
+ "name": "access_seq",
2879
+ "type": "bigint",
2880
+ "primaryKey": false,
2881
+ "notNull": true
2882
+ },
2883
+ "mac": {
2884
+ "name": "mac",
2885
+ "type": "bytea",
2886
+ "primaryKey": false,
2887
+ "notNull": true
2888
+ }
2889
+ },
2890
+ "indexes": {},
2891
+ "foreignKeys": {},
2892
+ "compositePrimaryKeys": {},
2893
+ "uniqueConstraints": {},
2894
+ "policies": {},
2895
+ "checkConstraints": {
2896
+ "vault_members_mac_check": {
2897
+ "name": "vault_members_mac_check",
2898
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
2899
+ },
2900
+ "vault_members_principal_check": {
2901
+ "name": "vault_members_principal_check",
2902
+ "value": "\"vault_members\".\"principal\" ~ '^(user|token):[^[:space:]:][^[:space:]]*$'"
2903
+ },
2904
+ "vault_members_user_lowercase": {
2905
+ "name": "vault_members_user_lowercase",
2906
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
2907
+ },
2908
+ "vault_members_status_check": {
2909
+ "name": "vault_members_status_check",
2910
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
2911
+ },
2912
+ "vault_members_owner_check": {
2913
+ "name": "vault_members_owner_check",
2914
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
2915
+ },
2916
+ "vault_members_generation_check": {
2917
+ "name": "vault_members_generation_check",
2918
+ "value": "\"vault_members\".\"generation\" >= 0"
2919
+ }
2920
+ },
2921
+ "isRLSEnabled": false
2922
+ }
2923
+ },
2924
+ "enums": {},
2925
+ "schemas": {},
2926
+ "sequences": {},
2927
+ "roles": {},
2928
+ "policies": {},
2929
+ "views": {},
2930
+ "_meta": {
2931
+ "columns": {},
2932
+ "schemas": {},
2933
+ "tables": {}
2934
+ }
2935
+ }