@coffre/db 0.4.6 → 0.5.1

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