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