@coffre/db 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2704 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "a234798f-ad95-43b1-9a74-e4adfaf29f8d",
5
+ "prevId": "ba318337-19e0-48cc-b1e8-a462a67f1cf5",
6
+ "tables": {
7
+ "audit_chain_head": {
8
+ "name": "audit_chain_head",
9
+ "columns": {
10
+ "only_row": {
11
+ "name": "only_row",
12
+ "type": "integer",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false,
16
+ "default": true
17
+ },
18
+ "next_seq": {
19
+ "name": "next_seq",
20
+ "type": "integer",
21
+ "primaryKey": false,
22
+ "notNull": true,
23
+ "autoincrement": false,
24
+ "default": "0"
25
+ },
26
+ "head_hash": {
27
+ "name": "head_hash",
28
+ "type": "blob",
29
+ "primaryKey": false,
30
+ "notNull": true,
31
+ "autoincrement": false
32
+ }
33
+ },
34
+ "indexes": {},
35
+ "foreignKeys": {},
36
+ "compositePrimaryKeys": {},
37
+ "uniqueConstraints": {},
38
+ "checkConstraints": {
39
+ "audit_chain_head_only_row_check": {
40
+ "name": "audit_chain_head_only_row_check",
41
+ "value": "\"audit_chain_head\".\"only_row\""
42
+ },
43
+ "audit_chain_head_next_seq_check": {
44
+ "name": "audit_chain_head_next_seq_check",
45
+ "value": "\"audit_chain_head\".\"next_seq\" >= 0"
46
+ },
47
+ "audit_chain_head_head_hash_check": {
48
+ "name": "audit_chain_head_head_hash_check",
49
+ "value": "octet_length(\"audit_chain_head\".\"head_hash\") = 32"
50
+ }
51
+ }
52
+ },
53
+ "audit_log": {
54
+ "name": "audit_log",
55
+ "columns": {
56
+ "seq": {
57
+ "name": "seq",
58
+ "type": "integer",
59
+ "primaryKey": true,
60
+ "notNull": true,
61
+ "autoincrement": false
62
+ },
63
+ "author": {
64
+ "name": "author",
65
+ "type": "text",
66
+ "primaryKey": false,
67
+ "notNull": true,
68
+ "autoincrement": false
69
+ },
70
+ "key_id": {
71
+ "name": "key_id",
72
+ "type": "text",
73
+ "primaryKey": false,
74
+ "notNull": true,
75
+ "autoincrement": false
76
+ },
77
+ "occurred_at": {
78
+ "name": "occurred_at",
79
+ "type": "integer",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "autoincrement": false
83
+ },
84
+ "actor": {
85
+ "name": "actor",
86
+ "type": "text",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "autoincrement": false
90
+ },
91
+ "action": {
92
+ "name": "action",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": true,
96
+ "autoincrement": false
97
+ },
98
+ "decision": {
99
+ "name": "decision",
100
+ "type": "text",
101
+ "primaryKey": false,
102
+ "notNull": true,
103
+ "autoincrement": false
104
+ },
105
+ "code": {
106
+ "name": "code",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": false,
110
+ "autoincrement": false
111
+ },
112
+ "subject_principal": {
113
+ "name": "subject_principal",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": false,
117
+ "autoincrement": false
118
+ },
119
+ "project_id": {
120
+ "name": "project_id",
121
+ "type": "text",
122
+ "primaryKey": false,
123
+ "notNull": false,
124
+ "autoincrement": false
125
+ },
126
+ "environment_id": {
127
+ "name": "environment_id",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": false,
131
+ "autoincrement": false
132
+ },
133
+ "secret_id": {
134
+ "name": "secret_id",
135
+ "type": "text",
136
+ "primaryKey": false,
137
+ "notNull": false,
138
+ "autoincrement": false
139
+ },
140
+ "secret_version_id": {
141
+ "name": "secret_version_id",
142
+ "type": "text",
143
+ "primaryKey": false,
144
+ "notNull": false,
145
+ "autoincrement": false
146
+ },
147
+ "operation_id": {
148
+ "name": "operation_id",
149
+ "type": "text",
150
+ "primaryKey": false,
151
+ "notNull": false,
152
+ "autoincrement": false
153
+ },
154
+ "request_id": {
155
+ "name": "request_id",
156
+ "type": "text",
157
+ "primaryKey": false,
158
+ "notNull": false,
159
+ "autoincrement": false
160
+ },
161
+ "source_ip": {
162
+ "name": "source_ip",
163
+ "type": "text",
164
+ "primaryKey": false,
165
+ "notNull": false,
166
+ "autoincrement": false
167
+ },
168
+ "related_seq": {
169
+ "name": "related_seq",
170
+ "type": "integer",
171
+ "primaryKey": false,
172
+ "notNull": false,
173
+ "autoincrement": false
174
+ },
175
+ "metadata": {
176
+ "name": "metadata",
177
+ "type": "text",
178
+ "primaryKey": false,
179
+ "notNull": true,
180
+ "autoincrement": false,
181
+ "default": "'{}'"
182
+ },
183
+ "prev_hash": {
184
+ "name": "prev_hash",
185
+ "type": "blob",
186
+ "primaryKey": false,
187
+ "notNull": true,
188
+ "autoincrement": false
189
+ },
190
+ "mac": {
191
+ "name": "mac",
192
+ "type": "blob",
193
+ "primaryKey": false,
194
+ "notNull": true,
195
+ "autoincrement": false
196
+ },
197
+ "hash": {
198
+ "name": "hash",
199
+ "type": "blob",
200
+ "primaryKey": false,
201
+ "notNull": true,
202
+ "autoincrement": false
203
+ }
204
+ },
205
+ "indexes": {
206
+ "audit_log_project_idx": {
207
+ "name": "audit_log_project_idx",
208
+ "columns": [
209
+ "project_id",
210
+ "seq"
211
+ ],
212
+ "isUnique": false
213
+ },
214
+ "audit_log_environment_idx": {
215
+ "name": "audit_log_environment_idx",
216
+ "columns": [
217
+ "environment_id",
218
+ "seq"
219
+ ],
220
+ "isUnique": false
221
+ },
222
+ "audit_log_secret_idx": {
223
+ "name": "audit_log_secret_idx",
224
+ "columns": [
225
+ "secret_id",
226
+ "seq"
227
+ ],
228
+ "isUnique": false
229
+ },
230
+ "audit_log_actor_idx": {
231
+ "name": "audit_log_actor_idx",
232
+ "columns": [
233
+ "actor",
234
+ "seq"
235
+ ],
236
+ "isUnique": false
237
+ },
238
+ "audit_log_operation_idx": {
239
+ "name": "audit_log_operation_idx",
240
+ "columns": [
241
+ "operation_id",
242
+ "seq"
243
+ ],
244
+ "isUnique": false
245
+ },
246
+ "audit_log_action_idx": {
247
+ "name": "audit_log_action_idx",
248
+ "columns": [
249
+ "author",
250
+ "action",
251
+ "seq"
252
+ ],
253
+ "isUnique": false
254
+ },
255
+ "audit_log_releases_idx": {
256
+ "name": "audit_log_releases_idx",
257
+ "columns": [
258
+ "author",
259
+ "actor",
260
+ "action",
261
+ "decision",
262
+ "occurred_at"
263
+ ],
264
+ "isUnique": false
265
+ },
266
+ "audit_log_subject_idx": {
267
+ "name": "audit_log_subject_idx",
268
+ "columns": [
269
+ "author",
270
+ "subject_principal",
271
+ "seq"
272
+ ],
273
+ "isUnique": false
274
+ },
275
+ "audit_log_unbind_idx": {
276
+ "name": "audit_log_unbind_idx",
277
+ "columns": [
278
+ "json_extract(\"metadata\", '$.bindingId')"
279
+ ],
280
+ "isUnique": false,
281
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.unbind' AND \"audit_log\".\"decision\" = 'allow'"
282
+ },
283
+ "audit_log_exchange_idx": {
284
+ "name": "audit_log_exchange_idx",
285
+ "columns": [
286
+ "json_extract(\"metadata\", '$.credentialId')"
287
+ ],
288
+ "isUnique": false,
289
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.exchange' AND \"audit_log\".\"decision\" = 'allow'"
290
+ },
291
+ "audit_log_token_create_idx": {
292
+ "name": "audit_log_token_create_idx",
293
+ "columns": [
294
+ "json_extract(\"metadata\", '$.targetCredentialId')"
295
+ ],
296
+ "isUnique": false,
297
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.create' AND \"audit_log\".\"decision\" = 'allow'"
298
+ },
299
+ "audit_log_reference_end_idx": {
300
+ "name": "audit_log_reference_end_idx",
301
+ "columns": [
302
+ "related_seq"
303
+ ],
304
+ "isUnique": false,
305
+ "where": "\"audit_log\".\"author\" = 'vault' AND \"audit_log\".\"action\" = 'reference.end' AND \"audit_log\".\"decision\" = 'allow'"
306
+ },
307
+ "audit_log_also_project_idx": {
308
+ "name": "audit_log_also_project_idx",
309
+ "columns": [
310
+ "json_extract(\"metadata\", '$.also.projectId')",
311
+ "seq"
312
+ ],
313
+ "isUnique": false,
314
+ "where": "json_extract(\"audit_log\".\"metadata\", '$.also') IS NOT NULL"
315
+ },
316
+ "audit_log_also_environment_idx": {
317
+ "name": "audit_log_also_environment_idx",
318
+ "columns": [
319
+ "json_extract(\"metadata\", '$.also.environmentId')",
320
+ "seq"
321
+ ],
322
+ "isUnique": false,
323
+ "where": "json_extract(\"audit_log\".\"metadata\", '$.also') IS NOT NULL"
324
+ },
325
+ "audit_log_also_secret_idx": {
326
+ "name": "audit_log_also_secret_idx",
327
+ "columns": [
328
+ "json_extract(\"metadata\", '$.also.secretId')",
329
+ "seq"
330
+ ],
331
+ "isUnique": false,
332
+ "where": "json_extract(\"audit_log\".\"metadata\", '$.also') IS NOT NULL"
333
+ }
334
+ },
335
+ "foreignKeys": {
336
+ "audit_log_project_id_fkey": {
337
+ "name": "audit_log_project_id_fkey",
338
+ "tableFrom": "audit_log",
339
+ "tableTo": "projects",
340
+ "columnsFrom": [
341
+ "project_id"
342
+ ],
343
+ "columnsTo": [
344
+ "id"
345
+ ],
346
+ "onDelete": "restrict",
347
+ "onUpdate": "no action"
348
+ },
349
+ "audit_log_environment_id_fkey": {
350
+ "name": "audit_log_environment_id_fkey",
351
+ "tableFrom": "audit_log",
352
+ "tableTo": "environments",
353
+ "columnsFrom": [
354
+ "environment_id"
355
+ ],
356
+ "columnsTo": [
357
+ "id"
358
+ ],
359
+ "onDelete": "restrict",
360
+ "onUpdate": "no action"
361
+ },
362
+ "audit_log_secret_id_fkey": {
363
+ "name": "audit_log_secret_id_fkey",
364
+ "tableFrom": "audit_log",
365
+ "tableTo": "secrets",
366
+ "columnsFrom": [
367
+ "secret_id"
368
+ ],
369
+ "columnsTo": [
370
+ "id"
371
+ ],
372
+ "onDelete": "restrict",
373
+ "onUpdate": "no action"
374
+ },
375
+ "audit_log_secret_version_id_fkey": {
376
+ "name": "audit_log_secret_version_id_fkey",
377
+ "tableFrom": "audit_log",
378
+ "tableTo": "secret_versions",
379
+ "columnsFrom": [
380
+ "secret_version_id"
381
+ ],
382
+ "columnsTo": [
383
+ "id"
384
+ ],
385
+ "onDelete": "restrict",
386
+ "onUpdate": "no action"
387
+ },
388
+ "audit_log_related_seq_fkey": {
389
+ "name": "audit_log_related_seq_fkey",
390
+ "tableFrom": "audit_log",
391
+ "tableTo": "audit_log",
392
+ "columnsFrom": [
393
+ "related_seq"
394
+ ],
395
+ "columnsTo": [
396
+ "seq"
397
+ ],
398
+ "onDelete": "restrict",
399
+ "onUpdate": "no action"
400
+ }
401
+ },
402
+ "compositePrimaryKeys": {},
403
+ "uniqueConstraints": {},
404
+ "checkConstraints": {
405
+ "audit_log_author_check": {
406
+ "name": "audit_log_author_check",
407
+ "value": "\"audit_log\".\"author\" IN ('app', 'vault')"
408
+ },
409
+ "audit_log_actor_check": {
410
+ "name": "audit_log_actor_check",
411
+ "value": "\"audit_log\".\"actor\" GLOB 'user:?*' OR \"audit_log\".\"actor\" GLOB 'token:?*' OR \"audit_log\".\"actor\" GLOB 'system:?*'"
412
+ },
413
+ "audit_log_decision_check": {
414
+ "name": "audit_log_decision_check",
415
+ "value": "\"audit_log\".\"decision\" IN ('allow', 'deny')"
416
+ },
417
+ "audit_log_metadata_check": {
418
+ "name": "audit_log_metadata_check",
419
+ "value": "json_valid(\"audit_log\".\"metadata\")"
420
+ },
421
+ "audit_log_prev_hash_check": {
422
+ "name": "audit_log_prev_hash_check",
423
+ "value": "octet_length(\"audit_log\".\"prev_hash\") = 32"
424
+ },
425
+ "audit_log_mac_check": {
426
+ "name": "audit_log_mac_check",
427
+ "value": "octet_length(\"audit_log\".\"mac\") = 32"
428
+ },
429
+ "audit_log_hash_check": {
430
+ "name": "audit_log_hash_check",
431
+ "value": "octet_length(\"audit_log\".\"hash\") = 32"
432
+ }
433
+ }
434
+ },
435
+ "consumed_tokens": {
436
+ "name": "consumed_tokens",
437
+ "columns": {
438
+ "hash": {
439
+ "name": "hash",
440
+ "type": "blob",
441
+ "primaryKey": true,
442
+ "notNull": true,
443
+ "autoincrement": false
444
+ },
445
+ "consumed_at": {
446
+ "name": "consumed_at",
447
+ "type": "integer",
448
+ "primaryKey": false,
449
+ "notNull": true,
450
+ "autoincrement": false,
451
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
452
+ }
453
+ },
454
+ "indexes": {},
455
+ "foreignKeys": {},
456
+ "compositePrimaryKeys": {},
457
+ "uniqueConstraints": {},
458
+ "checkConstraints": {
459
+ "consumed_tokens_hash_check": {
460
+ "name": "consumed_tokens_hash_check",
461
+ "value": "octet_length(\"consumed_tokens\".\"hash\") = 32"
462
+ }
463
+ }
464
+ },
465
+ "credentials": {
466
+ "name": "credentials",
467
+ "columns": {
468
+ "id": {
469
+ "name": "id",
470
+ "type": "text",
471
+ "primaryKey": true,
472
+ "notNull": true,
473
+ "autoincrement": false
474
+ },
475
+ "kind": {
476
+ "name": "kind",
477
+ "type": "text",
478
+ "primaryKey": false,
479
+ "notNull": true,
480
+ "autoincrement": false
481
+ },
482
+ "auth_mac": {
483
+ "name": "auth_mac",
484
+ "type": "blob",
485
+ "primaryKey": false,
486
+ "notNull": true,
487
+ "autoincrement": false
488
+ },
489
+ "token_hash": {
490
+ "name": "token_hash",
491
+ "type": "blob",
492
+ "primaryKey": false,
493
+ "notNull": true,
494
+ "autoincrement": false
495
+ },
496
+ "token_hint": {
497
+ "name": "token_hint",
498
+ "type": "text",
499
+ "primaryKey": false,
500
+ "notNull": true,
501
+ "autoincrement": false
502
+ },
503
+ "generation": {
504
+ "name": "generation",
505
+ "type": "integer",
506
+ "primaryKey": false,
507
+ "notNull": true,
508
+ "autoincrement": false
509
+ },
510
+ "principal": {
511
+ "name": "principal",
512
+ "type": "text",
513
+ "primaryKey": false,
514
+ "notNull": true,
515
+ "autoincrement": false
516
+ },
517
+ "identity_id": {
518
+ "name": "identity_id",
519
+ "type": "text",
520
+ "primaryKey": false,
521
+ "notNull": false,
522
+ "autoincrement": false
523
+ },
524
+ "scope": {
525
+ "name": "scope",
526
+ "type": "text",
527
+ "primaryKey": false,
528
+ "notNull": false,
529
+ "autoincrement": false
530
+ },
531
+ "label": {
532
+ "name": "label",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": false,
536
+ "autoincrement": false
537
+ },
538
+ "created_at": {
539
+ "name": "created_at",
540
+ "type": "integer",
541
+ "primaryKey": false,
542
+ "notNull": true,
543
+ "autoincrement": false,
544
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
545
+ },
546
+ "created_by": {
547
+ "name": "created_by",
548
+ "type": "text",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "autoincrement": false
552
+ },
553
+ "expires_at": {
554
+ "name": "expires_at",
555
+ "type": "integer",
556
+ "primaryKey": false,
557
+ "notNull": true,
558
+ "autoincrement": false
559
+ },
560
+ "last_used_at": {
561
+ "name": "last_used_at",
562
+ "type": "integer",
563
+ "primaryKey": false,
564
+ "notNull": false,
565
+ "autoincrement": false
566
+ },
567
+ "last_used_ip": {
568
+ "name": "last_used_ip",
569
+ "type": "text",
570
+ "primaryKey": false,
571
+ "notNull": false,
572
+ "autoincrement": false
573
+ },
574
+ "revoked_at": {
575
+ "name": "revoked_at",
576
+ "type": "integer",
577
+ "primaryKey": false,
578
+ "notNull": false,
579
+ "autoincrement": false
580
+ },
581
+ "revoked_by": {
582
+ "name": "revoked_by",
583
+ "type": "text",
584
+ "primaryKey": false,
585
+ "notNull": false,
586
+ "autoincrement": false
587
+ }
588
+ },
589
+ "indexes": {
590
+ "credentials_principal_idx": {
591
+ "name": "credentials_principal_idx",
592
+ "columns": [
593
+ "principal",
594
+ "generation"
595
+ ],
596
+ "isUnique": false
597
+ },
598
+ "credentials_live_idx": {
599
+ "name": "credentials_live_idx",
600
+ "columns": [
601
+ "principal",
602
+ "expires_at"
603
+ ],
604
+ "isUnique": false,
605
+ "where": "\"credentials\".\"revoked_at\" IS NULL"
606
+ },
607
+ "credentials_issued_by_idx": {
608
+ "name": "credentials_issued_by_idx",
609
+ "columns": [
610
+ "principal",
611
+ "created_by",
612
+ "created_at"
613
+ ],
614
+ "isUnique": false
615
+ },
616
+ "credentials_token_hash_key": {
617
+ "name": "credentials_token_hash_key",
618
+ "columns": [
619
+ "token_hash"
620
+ ],
621
+ "isUnique": true
622
+ }
623
+ },
624
+ "foreignKeys": {
625
+ "credentials_principal_fkey": {
626
+ "name": "credentials_principal_fkey",
627
+ "tableFrom": "credentials",
628
+ "tableTo": "vault_members",
629
+ "columnsFrom": [
630
+ "principal"
631
+ ],
632
+ "columnsTo": [
633
+ "principal"
634
+ ],
635
+ "onDelete": "restrict",
636
+ "onUpdate": "no action"
637
+ },
638
+ "credentials_identity_id_fkey": {
639
+ "name": "credentials_identity_id_fkey",
640
+ "tableFrom": "credentials",
641
+ "tableTo": "identities",
642
+ "columnsFrom": [
643
+ "identity_id",
644
+ "principal",
645
+ "generation"
646
+ ],
647
+ "columnsTo": [
648
+ "id",
649
+ "principal",
650
+ "generation"
651
+ ],
652
+ "onDelete": "restrict",
653
+ "onUpdate": "no action"
654
+ }
655
+ },
656
+ "compositePrimaryKeys": {},
657
+ "uniqueConstraints": {},
658
+ "checkConstraints": {
659
+ "credentials_kind_check": {
660
+ "name": "credentials_kind_check",
661
+ "value": "\"credentials\".\"kind\" IN ('browser', 'cli', 'service', 'personal', 'handle')"
662
+ },
663
+ "credentials_principal_check": {
664
+ "name": "credentials_principal_check",
665
+ "value": "\"credentials\".\"principal\" LIKE 'user:%' OR \"credentials\".\"principal\" LIKE 'token:%'"
666
+ },
667
+ "credentials_kind_matches_principal": {
668
+ "name": "credentials_kind_matches_principal",
669
+ "value": "(\"credentials\".\"kind\" = 'service') = (\"credentials\".\"principal\" LIKE 'token:%')"
670
+ },
671
+ "credentials_token_hash_check": {
672
+ "name": "credentials_token_hash_check",
673
+ "value": "octet_length(\"credentials\".\"token_hash\") = 32"
674
+ },
675
+ "credentials_auth_mac_check": {
676
+ "name": "credentials_auth_mac_check",
677
+ "value": "octet_length(\"credentials\".\"auth_mac\") = 32"
678
+ }
679
+ }
680
+ },
681
+ "device_authorizations": {
682
+ "name": "device_authorizations",
683
+ "columns": {
684
+ "id": {
685
+ "name": "id",
686
+ "type": "text",
687
+ "primaryKey": true,
688
+ "notNull": true,
689
+ "autoincrement": false
690
+ },
691
+ "device_code_hash": {
692
+ "name": "device_code_hash",
693
+ "type": "blob",
694
+ "primaryKey": false,
695
+ "notNull": true,
696
+ "autoincrement": false
697
+ },
698
+ "auth_mac": {
699
+ "name": "auth_mac",
700
+ "type": "blob",
701
+ "primaryKey": false,
702
+ "notNull": true,
703
+ "autoincrement": false
704
+ },
705
+ "user_code": {
706
+ "name": "user_code",
707
+ "type": "text",
708
+ "primaryKey": false,
709
+ "notNull": true,
710
+ "autoincrement": false
711
+ },
712
+ "client_label": {
713
+ "name": "client_label",
714
+ "type": "text",
715
+ "primaryKey": false,
716
+ "notNull": false,
717
+ "autoincrement": false
718
+ },
719
+ "client_ip": {
720
+ "name": "client_ip",
721
+ "type": "text",
722
+ "primaryKey": false,
723
+ "notNull": false,
724
+ "autoincrement": false
725
+ },
726
+ "created_at": {
727
+ "name": "created_at",
728
+ "type": "integer",
729
+ "primaryKey": false,
730
+ "notNull": true,
731
+ "autoincrement": false,
732
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
733
+ },
734
+ "expires_at": {
735
+ "name": "expires_at",
736
+ "type": "integer",
737
+ "primaryKey": false,
738
+ "notNull": true,
739
+ "autoincrement": false
740
+ },
741
+ "decided_at": {
742
+ "name": "decided_at",
743
+ "type": "integer",
744
+ "primaryKey": false,
745
+ "notNull": false,
746
+ "autoincrement": false
747
+ },
748
+ "decision": {
749
+ "name": "decision",
750
+ "type": "text",
751
+ "primaryKey": false,
752
+ "notNull": false,
753
+ "autoincrement": false
754
+ },
755
+ "generation": {
756
+ "name": "generation",
757
+ "type": "integer",
758
+ "primaryKey": false,
759
+ "notNull": true,
760
+ "autoincrement": false,
761
+ "default": 0
762
+ },
763
+ "principal": {
764
+ "name": "principal",
765
+ "type": "text",
766
+ "primaryKey": false,
767
+ "notNull": false,
768
+ "autoincrement": false
769
+ },
770
+ "consumed_at": {
771
+ "name": "consumed_at",
772
+ "type": "integer",
773
+ "primaryKey": false,
774
+ "notNull": false,
775
+ "autoincrement": false
776
+ }
777
+ },
778
+ "indexes": {
779
+ "device_authorizations_device_code_hash_key": {
780
+ "name": "device_authorizations_device_code_hash_key",
781
+ "columns": [
782
+ "device_code_hash"
783
+ ],
784
+ "isUnique": true
785
+ },
786
+ "device_authorizations_user_code_key": {
787
+ "name": "device_authorizations_user_code_key",
788
+ "columns": [
789
+ "user_code"
790
+ ],
791
+ "isUnique": true
792
+ }
793
+ },
794
+ "foreignKeys": {
795
+ "device_authorizations_principal_fkey": {
796
+ "name": "device_authorizations_principal_fkey",
797
+ "tableFrom": "device_authorizations",
798
+ "tableTo": "vault_members",
799
+ "columnsFrom": [
800
+ "principal"
801
+ ],
802
+ "columnsTo": [
803
+ "principal"
804
+ ],
805
+ "onDelete": "restrict",
806
+ "onUpdate": "no action"
807
+ }
808
+ },
809
+ "compositePrimaryKeys": {},
810
+ "uniqueConstraints": {},
811
+ "checkConstraints": {
812
+ "device_authorizations_auth_mac_check": {
813
+ "name": "device_authorizations_auth_mac_check",
814
+ "value": "octet_length(\"device_authorizations\".\"auth_mac\") = 32"
815
+ },
816
+ "device_authorizations_decision_check": {
817
+ "name": "device_authorizations_decision_check",
818
+ "value": "\"device_authorizations\".\"decision\" IS NULL OR \"device_authorizations\".\"decision\" IN ('approved', 'denied')"
819
+ },
820
+ "device_authorizations_approval_names_principal": {
821
+ "name": "device_authorizations_approval_names_principal",
822
+ "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 ))"
823
+ }
824
+ }
825
+ },
826
+ "dismissed_keys": {
827
+ "name": "dismissed_keys",
828
+ "columns": {
829
+ "environment_id": {
830
+ "name": "environment_id",
831
+ "type": "text",
832
+ "primaryKey": false,
833
+ "notNull": true,
834
+ "autoincrement": false
835
+ },
836
+ "key": {
837
+ "name": "key",
838
+ "type": "text",
839
+ "primaryKey": false,
840
+ "notNull": true,
841
+ "autoincrement": false
842
+ },
843
+ "dismissed_at": {
844
+ "name": "dismissed_at",
845
+ "type": "integer",
846
+ "primaryKey": false,
847
+ "notNull": true,
848
+ "autoincrement": false,
849
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
850
+ },
851
+ "dismissed_by": {
852
+ "name": "dismissed_by",
853
+ "type": "text",
854
+ "primaryKey": false,
855
+ "notNull": true,
856
+ "autoincrement": false
857
+ },
858
+ "restored_at": {
859
+ "name": "restored_at",
860
+ "type": "integer",
861
+ "primaryKey": false,
862
+ "notNull": false,
863
+ "autoincrement": false
864
+ },
865
+ "restored_by": {
866
+ "name": "restored_by",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": false,
870
+ "autoincrement": false
871
+ }
872
+ },
873
+ "indexes": {},
874
+ "foreignKeys": {
875
+ "dismissed_keys_environment_id_fkey": {
876
+ "name": "dismissed_keys_environment_id_fkey",
877
+ "tableFrom": "dismissed_keys",
878
+ "tableTo": "environments",
879
+ "columnsFrom": [
880
+ "environment_id"
881
+ ],
882
+ "columnsTo": [
883
+ "id"
884
+ ],
885
+ "onDelete": "restrict",
886
+ "onUpdate": "no action"
887
+ }
888
+ },
889
+ "compositePrimaryKeys": {
890
+ "dismissed_keys_pkey": {
891
+ "columns": [
892
+ "environment_id",
893
+ "key"
894
+ ],
895
+ "name": "dismissed_keys_pkey"
896
+ }
897
+ },
898
+ "uniqueConstraints": {},
899
+ "checkConstraints": {
900
+ "dismissed_keys_key_check": {
901
+ "name": "dismissed_keys_key_check",
902
+ "value": "length(\"dismissed_keys\".\"key\") BETWEEN 1 AND 128 AND \"dismissed_keys\".\"key\" GLOB '[A-Za-z_]*' AND \"dismissed_keys\".\"key\" NOT GLOB '*[^A-Za-z0-9_]*'"
903
+ }
904
+ }
905
+ },
906
+ "environments": {
907
+ "name": "environments",
908
+ "columns": {
909
+ "id": {
910
+ "name": "id",
911
+ "type": "text",
912
+ "primaryKey": true,
913
+ "notNull": true,
914
+ "autoincrement": false
915
+ },
916
+ "project_id": {
917
+ "name": "project_id",
918
+ "type": "text",
919
+ "primaryKey": false,
920
+ "notNull": true,
921
+ "autoincrement": false
922
+ },
923
+ "slug": {
924
+ "name": "slug",
925
+ "type": "text",
926
+ "primaryKey": false,
927
+ "notNull": true,
928
+ "autoincrement": false
929
+ },
930
+ "name": {
931
+ "name": "name",
932
+ "type": "text",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "autoincrement": false
936
+ },
937
+ "created_at": {
938
+ "name": "created_at",
939
+ "type": "integer",
940
+ "primaryKey": false,
941
+ "notNull": true,
942
+ "autoincrement": false,
943
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
944
+ },
945
+ "archived_at": {
946
+ "name": "archived_at",
947
+ "type": "integer",
948
+ "primaryKey": false,
949
+ "notNull": false,
950
+ "autoincrement": false
951
+ },
952
+ "parent_id": {
953
+ "name": "parent_id",
954
+ "type": "text",
955
+ "primaryKey": false,
956
+ "notNull": false,
957
+ "autoincrement": false
958
+ },
959
+ "owner": {
960
+ "name": "owner",
961
+ "type": "text",
962
+ "primaryKey": false,
963
+ "notNull": false,
964
+ "autoincrement": false
965
+ }
966
+ },
967
+ "indexes": {
968
+ "environments_parent_id_owner_key": {
969
+ "name": "environments_parent_id_owner_key",
970
+ "columns": [
971
+ "parent_id",
972
+ "owner"
973
+ ],
974
+ "isUnique": true,
975
+ "where": "instr(\"environments\".\"slug\", '~') = 0"
976
+ },
977
+ "environments_parent_idx": {
978
+ "name": "environments_parent_idx",
979
+ "columns": [
980
+ "parent_id"
981
+ ],
982
+ "isUnique": false
983
+ },
984
+ "environments_project_id_slug_key": {
985
+ "name": "environments_project_id_slug_key",
986
+ "columns": [
987
+ "project_id",
988
+ "slug"
989
+ ],
990
+ "isUnique": true
991
+ },
992
+ "environments_project_scoped": {
993
+ "name": "environments_project_scoped",
994
+ "columns": [
995
+ "id",
996
+ "project_id"
997
+ ],
998
+ "isUnique": true
999
+ }
1000
+ },
1001
+ "foreignKeys": {
1002
+ "environments_project_id_fkey": {
1003
+ "name": "environments_project_id_fkey",
1004
+ "tableFrom": "environments",
1005
+ "tableTo": "projects",
1006
+ "columnsFrom": [
1007
+ "project_id"
1008
+ ],
1009
+ "columnsTo": [
1010
+ "id"
1011
+ ],
1012
+ "onDelete": "restrict",
1013
+ "onUpdate": "no action"
1014
+ },
1015
+ "environments_parent_in_project": {
1016
+ "name": "environments_parent_in_project",
1017
+ "tableFrom": "environments",
1018
+ "tableTo": "environments",
1019
+ "columnsFrom": [
1020
+ "parent_id",
1021
+ "project_id"
1022
+ ],
1023
+ "columnsTo": [
1024
+ "id",
1025
+ "project_id"
1026
+ ],
1027
+ "onDelete": "no action",
1028
+ "onUpdate": "no action"
1029
+ }
1030
+ },
1031
+ "compositePrimaryKeys": {},
1032
+ "uniqueConstraints": {},
1033
+ "checkConstraints": {
1034
+ "environments_slug_check": {
1035
+ "name": "environments_slug_check",
1036
+ "value": "(length(\"environments\".\"slug\") BETWEEN 1 AND 63 AND \"environments\".\"slug\" GLOB '[a-z0-9]*' AND \"environments\".\"slug\" NOT GLOB '*[^a-z0-9-]*') OR (instr(\"environments\".\"slug\", '~') BETWEEN 2 AND 64 AND substr(\"environments\".\"slug\", 1, instr(\"environments\".\"slug\", '~') - 1) GLOB '[a-z0-9]*' AND substr(\"environments\".\"slug\", 1, instr(\"environments\".\"slug\", '~') - 1) NOT GLOB '*[^a-z0-9-]*' AND length(substr(\"environments\".\"slug\", instr(\"environments\".\"slug\", '~') + 1)) BETWEEN 1 AND 40 AND substr(\"environments\".\"slug\", instr(\"environments\".\"slug\", '~') + 1) NOT GLOB '*[^a-z0-9-]*')"
1037
+ },
1038
+ "environments_parent_check": {
1039
+ "name": "environments_parent_check",
1040
+ "value": "\"environments\".\"parent_id\" IS NULL OR \"environments\".\"parent_id\" <> \"environments\".\"id\""
1041
+ },
1042
+ "environments_owner_check": {
1043
+ "name": "environments_owner_check",
1044
+ "value": "\"environments\".\"owner\" IS NULL OR (\"environments\".\"parent_id\" IS NOT NULL AND \"environments\".\"owner\" LIKE 'user:_%')"
1045
+ }
1046
+ }
1047
+ },
1048
+ "identities": {
1049
+ "name": "identities",
1050
+ "columns": {
1051
+ "id": {
1052
+ "name": "id",
1053
+ "type": "text",
1054
+ "primaryKey": true,
1055
+ "notNull": true,
1056
+ "autoincrement": false
1057
+ },
1058
+ "provider": {
1059
+ "name": "provider",
1060
+ "type": "text",
1061
+ "primaryKey": false,
1062
+ "notNull": true,
1063
+ "autoincrement": false
1064
+ },
1065
+ "auth_mac": {
1066
+ "name": "auth_mac",
1067
+ "type": "blob",
1068
+ "primaryKey": false,
1069
+ "notNull": true,
1070
+ "autoincrement": false
1071
+ },
1072
+ "subject": {
1073
+ "name": "subject",
1074
+ "type": "text",
1075
+ "primaryKey": false,
1076
+ "notNull": true,
1077
+ "autoincrement": false
1078
+ },
1079
+ "issuer_hash": {
1080
+ "name": "issuer_hash",
1081
+ "type": "text",
1082
+ "primaryKey": false,
1083
+ "notNull": true,
1084
+ "autoincrement": false
1085
+ },
1086
+ "generation": {
1087
+ "name": "generation",
1088
+ "type": "integer",
1089
+ "primaryKey": false,
1090
+ "notNull": true,
1091
+ "autoincrement": false
1092
+ },
1093
+ "principal": {
1094
+ "name": "principal",
1095
+ "type": "text",
1096
+ "primaryKey": false,
1097
+ "notNull": true,
1098
+ "autoincrement": false
1099
+ },
1100
+ "email": {
1101
+ "name": "email",
1102
+ "type": "text",
1103
+ "primaryKey": false,
1104
+ "notNull": false,
1105
+ "autoincrement": false
1106
+ },
1107
+ "created_at": {
1108
+ "name": "created_at",
1109
+ "type": "integer",
1110
+ "primaryKey": false,
1111
+ "notNull": true,
1112
+ "autoincrement": false,
1113
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1114
+ },
1115
+ "created_by": {
1116
+ "name": "created_by",
1117
+ "type": "text",
1118
+ "primaryKey": false,
1119
+ "notNull": true,
1120
+ "autoincrement": false
1121
+ },
1122
+ "last_sign_in_at": {
1123
+ "name": "last_sign_in_at",
1124
+ "type": "integer",
1125
+ "primaryKey": false,
1126
+ "notNull": false,
1127
+ "autoincrement": false
1128
+ },
1129
+ "revoked_at": {
1130
+ "name": "revoked_at",
1131
+ "type": "integer",
1132
+ "primaryKey": false,
1133
+ "notNull": false,
1134
+ "autoincrement": false
1135
+ },
1136
+ "revoked_by": {
1137
+ "name": "revoked_by",
1138
+ "type": "text",
1139
+ "primaryKey": false,
1140
+ "notNull": false,
1141
+ "autoincrement": false
1142
+ },
1143
+ "active_subject": {
1144
+ "name": "active_subject",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": false,
1148
+ "autoincrement": false,
1149
+ "generated": {
1150
+ "as": "(CASE WHEN revoked_at IS NULL THEN subject END)",
1151
+ "type": "stored"
1152
+ }
1153
+ }
1154
+ },
1155
+ "indexes": {
1156
+ "identities_active_subject": {
1157
+ "name": "identities_active_subject",
1158
+ "columns": [
1159
+ "provider",
1160
+ "issuer_hash",
1161
+ "active_subject"
1162
+ ],
1163
+ "isUnique": true
1164
+ },
1165
+ "identities_principal_idx": {
1166
+ "name": "identities_principal_idx",
1167
+ "columns": [
1168
+ "principal",
1169
+ "generation"
1170
+ ],
1171
+ "isUnique": false
1172
+ },
1173
+ "identities_member_generation_key": {
1174
+ "name": "identities_member_generation_key",
1175
+ "columns": [
1176
+ "id",
1177
+ "principal",
1178
+ "generation"
1179
+ ],
1180
+ "isUnique": true
1181
+ }
1182
+ },
1183
+ "foreignKeys": {
1184
+ "identities_principal_fkey": {
1185
+ "name": "identities_principal_fkey",
1186
+ "tableFrom": "identities",
1187
+ "tableTo": "vault_members",
1188
+ "columnsFrom": [
1189
+ "principal"
1190
+ ],
1191
+ "columnsTo": [
1192
+ "principal"
1193
+ ],
1194
+ "onDelete": "restrict",
1195
+ "onUpdate": "no action"
1196
+ }
1197
+ },
1198
+ "compositePrimaryKeys": {},
1199
+ "uniqueConstraints": {},
1200
+ "checkConstraints": {
1201
+ "identities_principal_check": {
1202
+ "name": "identities_principal_check",
1203
+ "value": "\"identities\".\"principal\" LIKE 'user:%'"
1204
+ },
1205
+ "identities_provider_check": {
1206
+ "name": "identities_provider_check",
1207
+ "value": "length(\"identities\".\"provider\") BETWEEN 1 AND 32 AND \"identities\".\"provider\" GLOB '[a-z0-9]*' AND \"identities\".\"provider\" NOT GLOB '*[^a-z0-9-]*'"
1208
+ },
1209
+ "identities_auth_mac_check": {
1210
+ "name": "identities_auth_mac_check",
1211
+ "value": "octet_length(\"identities\".\"auth_mac\") = 32"
1212
+ }
1213
+ }
1214
+ },
1215
+ "mcp_approvals": {
1216
+ "name": "mcp_approvals",
1217
+ "columns": {
1218
+ "id": {
1219
+ "name": "id",
1220
+ "type": "text",
1221
+ "primaryKey": true,
1222
+ "notNull": true,
1223
+ "autoincrement": false
1224
+ },
1225
+ "connection_id": {
1226
+ "name": "connection_id",
1227
+ "type": "text",
1228
+ "primaryKey": false,
1229
+ "notNull": true,
1230
+ "autoincrement": false
1231
+ },
1232
+ "tool": {
1233
+ "name": "tool",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true,
1237
+ "autoincrement": false
1238
+ },
1239
+ "arguments": {
1240
+ "name": "arguments",
1241
+ "type": "text",
1242
+ "primaryKey": false,
1243
+ "notNull": true,
1244
+ "autoincrement": false
1245
+ },
1246
+ "digest": {
1247
+ "name": "digest",
1248
+ "type": "blob",
1249
+ "primaryKey": false,
1250
+ "notNull": true,
1251
+ "autoincrement": false
1252
+ },
1253
+ "status": {
1254
+ "name": "status",
1255
+ "type": "text",
1256
+ "primaryKey": false,
1257
+ "notNull": true,
1258
+ "autoincrement": false,
1259
+ "default": "'pending'"
1260
+ },
1261
+ "outcome": {
1262
+ "name": "outcome",
1263
+ "type": "text",
1264
+ "primaryKey": false,
1265
+ "notNull": false,
1266
+ "autoincrement": false
1267
+ },
1268
+ "created_at": {
1269
+ "name": "created_at",
1270
+ "type": "integer",
1271
+ "primaryKey": false,
1272
+ "notNull": true,
1273
+ "autoincrement": false,
1274
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1275
+ },
1276
+ "expires_at": {
1277
+ "name": "expires_at",
1278
+ "type": "integer",
1279
+ "primaryKey": false,
1280
+ "notNull": true,
1281
+ "autoincrement": false
1282
+ },
1283
+ "decided_at": {
1284
+ "name": "decided_at",
1285
+ "type": "integer",
1286
+ "primaryKey": false,
1287
+ "notNull": false,
1288
+ "autoincrement": false
1289
+ },
1290
+ "reported_at": {
1291
+ "name": "reported_at",
1292
+ "type": "integer",
1293
+ "primaryKey": false,
1294
+ "notNull": false,
1295
+ "autoincrement": false
1296
+ }
1297
+ },
1298
+ "indexes": {
1299
+ "mcp_approvals_open_idx": {
1300
+ "name": "mcp_approvals_open_idx",
1301
+ "columns": [
1302
+ "connection_id",
1303
+ "digest"
1304
+ ],
1305
+ "isUnique": false,
1306
+ "where": "\"mcp_approvals\".\"reported_at\" IS NULL"
1307
+ }
1308
+ },
1309
+ "foreignKeys": {
1310
+ "mcp_approvals_connection_fkey": {
1311
+ "name": "mcp_approvals_connection_fkey",
1312
+ "tableFrom": "mcp_approvals",
1313
+ "tableTo": "mcp_connections",
1314
+ "columnsFrom": [
1315
+ "connection_id"
1316
+ ],
1317
+ "columnsTo": [
1318
+ "id"
1319
+ ],
1320
+ "onDelete": "restrict",
1321
+ "onUpdate": "no action"
1322
+ }
1323
+ },
1324
+ "compositePrimaryKeys": {},
1325
+ "uniqueConstraints": {},
1326
+ "checkConstraints": {
1327
+ "mcp_approvals_status_check": {
1328
+ "name": "mcp_approvals_status_check",
1329
+ "value": "\"mcp_approvals\".\"status\" IN ('pending', 'approved', 'denied', 'cancelled', 'failed')"
1330
+ },
1331
+ "mcp_approvals_digest_check": {
1332
+ "name": "mcp_approvals_digest_check",
1333
+ "value": "octet_length(\"mcp_approvals\".\"digest\") = 32"
1334
+ },
1335
+ "mcp_approvals_arguments_check": {
1336
+ "name": "mcp_approvals_arguments_check",
1337
+ "value": "json_valid(\"mcp_approvals\".\"arguments\")"
1338
+ }
1339
+ }
1340
+ },
1341
+ "mcp_connections": {
1342
+ "name": "mcp_connections",
1343
+ "columns": {
1344
+ "id": {
1345
+ "name": "id",
1346
+ "type": "text",
1347
+ "primaryKey": true,
1348
+ "notNull": true,
1349
+ "autoincrement": false
1350
+ },
1351
+ "auth_mac": {
1352
+ "name": "auth_mac",
1353
+ "type": "blob",
1354
+ "primaryKey": false,
1355
+ "notNull": true,
1356
+ "autoincrement": false
1357
+ },
1358
+ "principal": {
1359
+ "name": "principal",
1360
+ "type": "text",
1361
+ "primaryKey": false,
1362
+ "notNull": true,
1363
+ "autoincrement": false
1364
+ },
1365
+ "generation": {
1366
+ "name": "generation",
1367
+ "type": "integer",
1368
+ "primaryKey": false,
1369
+ "notNull": true,
1370
+ "autoincrement": false
1371
+ },
1372
+ "client_id": {
1373
+ "name": "client_id",
1374
+ "type": "text",
1375
+ "primaryKey": false,
1376
+ "notNull": true,
1377
+ "autoincrement": false
1378
+ },
1379
+ "client_name": {
1380
+ "name": "client_name",
1381
+ "type": "text",
1382
+ "primaryKey": false,
1383
+ "notNull": true,
1384
+ "autoincrement": false
1385
+ },
1386
+ "client_host": {
1387
+ "name": "client_host",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": false,
1391
+ "autoincrement": false
1392
+ },
1393
+ "registration": {
1394
+ "name": "registration",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": true,
1398
+ "autoincrement": false
1399
+ },
1400
+ "scopes": {
1401
+ "name": "scopes",
1402
+ "type": "text",
1403
+ "primaryKey": false,
1404
+ "notNull": true,
1405
+ "autoincrement": false
1406
+ },
1407
+ "redirect_uri": {
1408
+ "name": "redirect_uri",
1409
+ "type": "text",
1410
+ "primaryKey": false,
1411
+ "notNull": true,
1412
+ "autoincrement": false
1413
+ },
1414
+ "code_hash": {
1415
+ "name": "code_hash",
1416
+ "type": "blob",
1417
+ "primaryKey": false,
1418
+ "notNull": false,
1419
+ "autoincrement": false
1420
+ },
1421
+ "code_challenge": {
1422
+ "name": "code_challenge",
1423
+ "type": "text",
1424
+ "primaryKey": false,
1425
+ "notNull": false,
1426
+ "autoincrement": false
1427
+ },
1428
+ "code_expires_at": {
1429
+ "name": "code_expires_at",
1430
+ "type": "integer",
1431
+ "primaryKey": false,
1432
+ "notNull": false,
1433
+ "autoincrement": false
1434
+ },
1435
+ "refresh_hash": {
1436
+ "name": "refresh_hash",
1437
+ "type": "blob",
1438
+ "primaryKey": false,
1439
+ "notNull": false,
1440
+ "autoincrement": false
1441
+ },
1442
+ "refresh_previous_hash": {
1443
+ "name": "refresh_previous_hash",
1444
+ "type": "blob",
1445
+ "primaryKey": false,
1446
+ "notNull": false,
1447
+ "autoincrement": false
1448
+ },
1449
+ "expires_at": {
1450
+ "name": "expires_at",
1451
+ "type": "integer",
1452
+ "primaryKey": false,
1453
+ "notNull": true,
1454
+ "autoincrement": false
1455
+ },
1456
+ "created_at": {
1457
+ "name": "created_at",
1458
+ "type": "integer",
1459
+ "primaryKey": false,
1460
+ "notNull": true,
1461
+ "autoincrement": false,
1462
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1463
+ },
1464
+ "last_used_at": {
1465
+ "name": "last_used_at",
1466
+ "type": "integer",
1467
+ "primaryKey": false,
1468
+ "notNull": false,
1469
+ "autoincrement": false
1470
+ },
1471
+ "last_used_ip": {
1472
+ "name": "last_used_ip",
1473
+ "type": "text",
1474
+ "primaryKey": false,
1475
+ "notNull": false,
1476
+ "autoincrement": false
1477
+ },
1478
+ "revoked_at": {
1479
+ "name": "revoked_at",
1480
+ "type": "integer",
1481
+ "primaryKey": false,
1482
+ "notNull": false,
1483
+ "autoincrement": false
1484
+ },
1485
+ "revoked_by": {
1486
+ "name": "revoked_by",
1487
+ "type": "text",
1488
+ "primaryKey": false,
1489
+ "notNull": false,
1490
+ "autoincrement": false
1491
+ }
1492
+ },
1493
+ "indexes": {
1494
+ "mcp_connections_refresh_previous_idx": {
1495
+ "name": "mcp_connections_refresh_previous_idx",
1496
+ "columns": [
1497
+ "refresh_previous_hash"
1498
+ ],
1499
+ "isUnique": false
1500
+ },
1501
+ "mcp_connections_live_idx": {
1502
+ "name": "mcp_connections_live_idx",
1503
+ "columns": [
1504
+ "principal",
1505
+ "expires_at"
1506
+ ],
1507
+ "isUnique": false,
1508
+ "where": "\"mcp_connections\".\"revoked_at\" IS NULL"
1509
+ },
1510
+ "mcp_connections_code_hash_key": {
1511
+ "name": "mcp_connections_code_hash_key",
1512
+ "columns": [
1513
+ "code_hash"
1514
+ ],
1515
+ "isUnique": true
1516
+ },
1517
+ "mcp_connections_refresh_hash_key": {
1518
+ "name": "mcp_connections_refresh_hash_key",
1519
+ "columns": [
1520
+ "refresh_hash"
1521
+ ],
1522
+ "isUnique": true
1523
+ }
1524
+ },
1525
+ "foreignKeys": {
1526
+ "mcp_connections_principal_fkey": {
1527
+ "name": "mcp_connections_principal_fkey",
1528
+ "tableFrom": "mcp_connections",
1529
+ "tableTo": "vault_members",
1530
+ "columnsFrom": [
1531
+ "principal"
1532
+ ],
1533
+ "columnsTo": [
1534
+ "principal"
1535
+ ],
1536
+ "onDelete": "restrict",
1537
+ "onUpdate": "no action"
1538
+ }
1539
+ },
1540
+ "compositePrimaryKeys": {},
1541
+ "uniqueConstraints": {},
1542
+ "checkConstraints": {
1543
+ "mcp_connections_principal_check": {
1544
+ "name": "mcp_connections_principal_check",
1545
+ "value": "\"mcp_connections\".\"principal\" LIKE 'user:%'"
1546
+ },
1547
+ "mcp_connections_registration_check": {
1548
+ "name": "mcp_connections_registration_check",
1549
+ "value": "\"mcp_connections\".\"registration\" IN ('cimd', 'dcr')"
1550
+ },
1551
+ "mcp_connections_auth_mac_check": {
1552
+ "name": "mcp_connections_auth_mac_check",
1553
+ "value": "octet_length(\"mcp_connections\".\"auth_mac\") = 32"
1554
+ },
1555
+ "mcp_connections_code_hash_check": {
1556
+ "name": "mcp_connections_code_hash_check",
1557
+ "value": "\"mcp_connections\".\"code_hash\" IS NULL OR octet_length(\"mcp_connections\".\"code_hash\") = 32"
1558
+ },
1559
+ "mcp_connections_refresh_hash_check": {
1560
+ "name": "mcp_connections_refresh_hash_check",
1561
+ "value": "\"mcp_connections\".\"refresh_hash\" IS NULL OR octet_length(\"mcp_connections\".\"refresh_hash\") = 32"
1562
+ }
1563
+ }
1564
+ },
1565
+ "oauth_clients": {
1566
+ "name": "oauth_clients",
1567
+ "columns": {
1568
+ "id": {
1569
+ "name": "id",
1570
+ "type": "text",
1571
+ "primaryKey": true,
1572
+ "notNull": true,
1573
+ "autoincrement": false
1574
+ },
1575
+ "auth_mac": {
1576
+ "name": "auth_mac",
1577
+ "type": "blob",
1578
+ "primaryKey": false,
1579
+ "notNull": true,
1580
+ "autoincrement": false
1581
+ },
1582
+ "name": {
1583
+ "name": "name",
1584
+ "type": "text",
1585
+ "primaryKey": false,
1586
+ "notNull": true,
1587
+ "autoincrement": false
1588
+ },
1589
+ "redirect_uris": {
1590
+ "name": "redirect_uris",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": true,
1594
+ "autoincrement": false
1595
+ },
1596
+ "created_at": {
1597
+ "name": "created_at",
1598
+ "type": "integer",
1599
+ "primaryKey": false,
1600
+ "notNull": true,
1601
+ "autoincrement": false,
1602
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1603
+ },
1604
+ "created_ip": {
1605
+ "name": "created_ip",
1606
+ "type": "text",
1607
+ "primaryKey": false,
1608
+ "notNull": false,
1609
+ "autoincrement": false
1610
+ },
1611
+ "revoked_at": {
1612
+ "name": "revoked_at",
1613
+ "type": "integer",
1614
+ "primaryKey": false,
1615
+ "notNull": false,
1616
+ "autoincrement": false
1617
+ }
1618
+ },
1619
+ "indexes": {},
1620
+ "foreignKeys": {},
1621
+ "compositePrimaryKeys": {},
1622
+ "uniqueConstraints": {},
1623
+ "checkConstraints": {
1624
+ "oauth_clients_auth_mac_check": {
1625
+ "name": "oauth_clients_auth_mac_check",
1626
+ "value": "octet_length(\"oauth_clients\".\"auth_mac\") = 32"
1627
+ },
1628
+ "oauth_clients_redirect_uris_check": {
1629
+ "name": "oauth_clients_redirect_uris_check",
1630
+ "value": "json_valid(\"oauth_clients\".\"redirect_uris\")"
1631
+ }
1632
+ }
1633
+ },
1634
+ "projects": {
1635
+ "name": "projects",
1636
+ "columns": {
1637
+ "id": {
1638
+ "name": "id",
1639
+ "type": "text",
1640
+ "primaryKey": true,
1641
+ "notNull": true,
1642
+ "autoincrement": false
1643
+ },
1644
+ "slug": {
1645
+ "name": "slug",
1646
+ "type": "text",
1647
+ "primaryKey": false,
1648
+ "notNull": true,
1649
+ "autoincrement": false
1650
+ },
1651
+ "name": {
1652
+ "name": "name",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": true,
1656
+ "autoincrement": false
1657
+ },
1658
+ "created_at": {
1659
+ "name": "created_at",
1660
+ "type": "integer",
1661
+ "primaryKey": false,
1662
+ "notNull": true,
1663
+ "autoincrement": false,
1664
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1665
+ },
1666
+ "archived_at": {
1667
+ "name": "archived_at",
1668
+ "type": "integer",
1669
+ "primaryKey": false,
1670
+ "notNull": false,
1671
+ "autoincrement": false
1672
+ },
1673
+ "folder": {
1674
+ "name": "folder",
1675
+ "type": "text",
1676
+ "primaryKey": false,
1677
+ "notNull": false,
1678
+ "autoincrement": false
1679
+ }
1680
+ },
1681
+ "indexes": {
1682
+ "projects_slug_key": {
1683
+ "name": "projects_slug_key",
1684
+ "columns": [
1685
+ "slug"
1686
+ ],
1687
+ "isUnique": true
1688
+ }
1689
+ },
1690
+ "foreignKeys": {},
1691
+ "compositePrimaryKeys": {},
1692
+ "uniqueConstraints": {},
1693
+ "checkConstraints": {
1694
+ "projects_slug_check": {
1695
+ "name": "projects_slug_check",
1696
+ "value": "(length(\"projects\".\"slug\") BETWEEN 1 AND 63 AND \"projects\".\"slug\" GLOB '[a-z0-9]*' AND \"projects\".\"slug\" NOT GLOB '*[^a-z0-9-]*') OR (instr(\"projects\".\"slug\", '~') BETWEEN 2 AND 64 AND substr(\"projects\".\"slug\", 1, instr(\"projects\".\"slug\", '~') - 1) GLOB '[a-z0-9]*' AND substr(\"projects\".\"slug\", 1, instr(\"projects\".\"slug\", '~') - 1) NOT GLOB '*[^a-z0-9-]*' AND length(substr(\"projects\".\"slug\", instr(\"projects\".\"slug\", '~') + 1)) BETWEEN 1 AND 40 AND substr(\"projects\".\"slug\", instr(\"projects\".\"slug\", '~') + 1) NOT GLOB '*[^a-z0-9-]*')"
1697
+ },
1698
+ "projects_folder_check": {
1699
+ "name": "projects_folder_check",
1700
+ "value": "\"projects\".\"folder\" IS NULL OR (length(\"projects\".\"folder\") BETWEEN 1 AND 64 AND \"projects\".\"folder\" NOT GLOB '*/*' AND \"projects\".\"folder\" = trim(\"projects\".\"folder\"))"
1701
+ }
1702
+ }
1703
+ },
1704
+ "secret_references": {
1705
+ "name": "secret_references",
1706
+ "columns": {
1707
+ "id": {
1708
+ "name": "id",
1709
+ "type": "text",
1710
+ "primaryKey": true,
1711
+ "notNull": true,
1712
+ "autoincrement": false
1713
+ },
1714
+ "project_id": {
1715
+ "name": "project_id",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true,
1719
+ "autoincrement": false
1720
+ },
1721
+ "environment_id": {
1722
+ "name": "environment_id",
1723
+ "type": "text",
1724
+ "primaryKey": false,
1725
+ "notNull": true,
1726
+ "autoincrement": false
1727
+ },
1728
+ "secret_id": {
1729
+ "name": "secret_id",
1730
+ "type": "text",
1731
+ "primaryKey": false,
1732
+ "notNull": true,
1733
+ "autoincrement": false
1734
+ },
1735
+ "source_project_id": {
1736
+ "name": "source_project_id",
1737
+ "type": "text",
1738
+ "primaryKey": false,
1739
+ "notNull": true,
1740
+ "autoincrement": false
1741
+ },
1742
+ "source_environment_id": {
1743
+ "name": "source_environment_id",
1744
+ "type": "text",
1745
+ "primaryKey": false,
1746
+ "notNull": true,
1747
+ "autoincrement": false
1748
+ },
1749
+ "source_secret_id": {
1750
+ "name": "source_secret_id",
1751
+ "type": "text",
1752
+ "primaryKey": false,
1753
+ "notNull": true,
1754
+ "autoincrement": false
1755
+ },
1756
+ "created_seq": {
1757
+ "name": "created_seq",
1758
+ "type": "integer",
1759
+ "primaryKey": false,
1760
+ "notNull": true,
1761
+ "autoincrement": false
1762
+ },
1763
+ "created_at": {
1764
+ "name": "created_at",
1765
+ "type": "integer",
1766
+ "primaryKey": false,
1767
+ "notNull": true,
1768
+ "autoincrement": false,
1769
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1770
+ },
1771
+ "created_by": {
1772
+ "name": "created_by",
1773
+ "type": "text",
1774
+ "primaryKey": false,
1775
+ "notNull": true,
1776
+ "autoincrement": false
1777
+ }
1778
+ },
1779
+ "indexes": {
1780
+ "secret_references_holder_idx": {
1781
+ "name": "secret_references_holder_idx",
1782
+ "columns": [
1783
+ "secret_id",
1784
+ "created_seq"
1785
+ ],
1786
+ "isUnique": false
1787
+ },
1788
+ "secret_references_source_idx": {
1789
+ "name": "secret_references_source_idx",
1790
+ "columns": [
1791
+ "source_secret_id"
1792
+ ],
1793
+ "isUnique": false
1794
+ },
1795
+ "secret_references_project_idx": {
1796
+ "name": "secret_references_project_idx",
1797
+ "columns": [
1798
+ "project_id"
1799
+ ],
1800
+ "isUnique": false
1801
+ },
1802
+ "secret_references_source_project_idx": {
1803
+ "name": "secret_references_source_project_idx",
1804
+ "columns": [
1805
+ "source_project_id"
1806
+ ],
1807
+ "isUnique": false
1808
+ },
1809
+ "secret_references_created_by_idx": {
1810
+ "name": "secret_references_created_by_idx",
1811
+ "columns": [
1812
+ "created_by"
1813
+ ],
1814
+ "isUnique": false
1815
+ },
1816
+ "secret_references_created_seq_key": {
1817
+ "name": "secret_references_created_seq_key",
1818
+ "columns": [
1819
+ "created_seq"
1820
+ ],
1821
+ "isUnique": true
1822
+ }
1823
+ },
1824
+ "foreignKeys": {
1825
+ "secret_references_secret_id_fkey": {
1826
+ "name": "secret_references_secret_id_fkey",
1827
+ "tableFrom": "secret_references",
1828
+ "tableTo": "secrets",
1829
+ "columnsFrom": [
1830
+ "secret_id"
1831
+ ],
1832
+ "columnsTo": [
1833
+ "id"
1834
+ ],
1835
+ "onDelete": "restrict",
1836
+ "onUpdate": "no action"
1837
+ },
1838
+ "secret_references_source_secret_id_fkey": {
1839
+ "name": "secret_references_source_secret_id_fkey",
1840
+ "tableFrom": "secret_references",
1841
+ "tableTo": "secrets",
1842
+ "columnsFrom": [
1843
+ "source_secret_id"
1844
+ ],
1845
+ "columnsTo": [
1846
+ "id"
1847
+ ],
1848
+ "onDelete": "restrict",
1849
+ "onUpdate": "no action"
1850
+ },
1851
+ "secret_references_created_seq_fkey": {
1852
+ "name": "secret_references_created_seq_fkey",
1853
+ "tableFrom": "secret_references",
1854
+ "tableTo": "audit_log",
1855
+ "columnsFrom": [
1856
+ "created_seq"
1857
+ ],
1858
+ "columnsTo": [
1859
+ "seq"
1860
+ ],
1861
+ "onDelete": "restrict",
1862
+ "onUpdate": "no action"
1863
+ }
1864
+ },
1865
+ "compositePrimaryKeys": {},
1866
+ "uniqueConstraints": {},
1867
+ "checkConstraints": {}
1868
+ },
1869
+ "secret_versions": {
1870
+ "name": "secret_versions",
1871
+ "columns": {
1872
+ "id": {
1873
+ "name": "id",
1874
+ "type": "text",
1875
+ "primaryKey": true,
1876
+ "notNull": true,
1877
+ "autoincrement": false
1878
+ },
1879
+ "secret_id": {
1880
+ "name": "secret_id",
1881
+ "type": "text",
1882
+ "primaryKey": false,
1883
+ "notNull": true,
1884
+ "autoincrement": false
1885
+ },
1886
+ "version": {
1887
+ "name": "version",
1888
+ "type": "integer",
1889
+ "primaryKey": false,
1890
+ "notNull": true,
1891
+ "autoincrement": false
1892
+ },
1893
+ "envelope_version": {
1894
+ "name": "envelope_version",
1895
+ "type": "integer",
1896
+ "primaryKey": false,
1897
+ "notNull": true,
1898
+ "autoincrement": false
1899
+ },
1900
+ "ciphertext": {
1901
+ "name": "ciphertext",
1902
+ "type": "blob",
1903
+ "primaryKey": false,
1904
+ "notNull": true,
1905
+ "autoincrement": false
1906
+ },
1907
+ "iv": {
1908
+ "name": "iv",
1909
+ "type": "blob",
1910
+ "primaryKey": false,
1911
+ "notNull": true,
1912
+ "autoincrement": false
1913
+ },
1914
+ "auth_tag": {
1915
+ "name": "auth_tag",
1916
+ "type": "blob",
1917
+ "primaryKey": false,
1918
+ "notNull": true,
1919
+ "autoincrement": false
1920
+ },
1921
+ "wrapped_dek": {
1922
+ "name": "wrapped_dek",
1923
+ "type": "blob",
1924
+ "primaryKey": false,
1925
+ "notNull": true,
1926
+ "autoincrement": false
1927
+ },
1928
+ "kek_provider": {
1929
+ "name": "kek_provider",
1930
+ "type": "text",
1931
+ "primaryKey": false,
1932
+ "notNull": true,
1933
+ "autoincrement": false
1934
+ },
1935
+ "kek_id": {
1936
+ "name": "kek_id",
1937
+ "type": "text",
1938
+ "primaryKey": false,
1939
+ "notNull": true,
1940
+ "autoincrement": false
1941
+ },
1942
+ "kek_version": {
1943
+ "name": "kek_version",
1944
+ "type": "text",
1945
+ "primaryKey": false,
1946
+ "notNull": true,
1947
+ "autoincrement": false
1948
+ },
1949
+ "created_at": {
1950
+ "name": "created_at",
1951
+ "type": "integer",
1952
+ "primaryKey": false,
1953
+ "notNull": true,
1954
+ "autoincrement": false,
1955
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1956
+ },
1957
+ "created_by": {
1958
+ "name": "created_by",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "autoincrement": false
1963
+ },
1964
+ "recipe": {
1965
+ "name": "recipe",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": false,
1969
+ "autoincrement": false
1970
+ },
1971
+ "pair_id": {
1972
+ "name": "pair_id",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": false,
1976
+ "autoincrement": false
1977
+ },
1978
+ "pair_half": {
1979
+ "name": "pair_half",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": false,
1983
+ "autoincrement": false
1984
+ }
1985
+ },
1986
+ "indexes": {
1987
+ "secret_versions_secret_idx": {
1988
+ "name": "secret_versions_secret_idx",
1989
+ "columns": [
1990
+ "secret_id",
1991
+ "version"
1992
+ ],
1993
+ "isUnique": false
1994
+ },
1995
+ "secret_versions_secret_id_version_key": {
1996
+ "name": "secret_versions_secret_id_version_key",
1997
+ "columns": [
1998
+ "secret_id",
1999
+ "version"
2000
+ ],
2001
+ "isUnique": true
2002
+ }
2003
+ },
2004
+ "foreignKeys": {
2005
+ "secret_versions_secret_id_fkey": {
2006
+ "name": "secret_versions_secret_id_fkey",
2007
+ "tableFrom": "secret_versions",
2008
+ "tableTo": "secrets",
2009
+ "columnsFrom": [
2010
+ "secret_id"
2011
+ ],
2012
+ "columnsTo": [
2013
+ "id"
2014
+ ],
2015
+ "onDelete": "restrict",
2016
+ "onUpdate": "no action"
2017
+ }
2018
+ },
2019
+ "compositePrimaryKeys": {},
2020
+ "uniqueConstraints": {},
2021
+ "checkConstraints": {
2022
+ "secret_versions_version_check": {
2023
+ "name": "secret_versions_version_check",
2024
+ "value": "\"secret_versions\".\"version\" > 0"
2025
+ },
2026
+ "secret_versions_iv_check": {
2027
+ "name": "secret_versions_iv_check",
2028
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
2029
+ },
2030
+ "secret_versions_auth_tag_check": {
2031
+ "name": "secret_versions_auth_tag_check",
2032
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
2033
+ }
2034
+ }
2035
+ },
2036
+ "secrets": {
2037
+ "name": "secrets",
2038
+ "columns": {
2039
+ "id": {
2040
+ "name": "id",
2041
+ "type": "text",
2042
+ "primaryKey": true,
2043
+ "notNull": true,
2044
+ "autoincrement": false
2045
+ },
2046
+ "project_id": {
2047
+ "name": "project_id",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": true,
2051
+ "autoincrement": false
2052
+ },
2053
+ "environment_id": {
2054
+ "name": "environment_id",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": true,
2058
+ "autoincrement": false
2059
+ },
2060
+ "key": {
2061
+ "name": "key",
2062
+ "type": "text",
2063
+ "primaryKey": false,
2064
+ "notNull": true,
2065
+ "autoincrement": false
2066
+ },
2067
+ "created_at": {
2068
+ "name": "created_at",
2069
+ "type": "integer",
2070
+ "primaryKey": false,
2071
+ "notNull": true,
2072
+ "autoincrement": false,
2073
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2074
+ },
2075
+ "updated_at": {
2076
+ "name": "updated_at",
2077
+ "type": "integer",
2078
+ "primaryKey": false,
2079
+ "notNull": true,
2080
+ "autoincrement": false,
2081
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2082
+ },
2083
+ "current_version_id": {
2084
+ "name": "current_version_id",
2085
+ "type": "text",
2086
+ "primaryKey": false,
2087
+ "notNull": false,
2088
+ "autoincrement": false
2089
+ },
2090
+ "current_version": {
2091
+ "name": "current_version",
2092
+ "type": "integer",
2093
+ "primaryKey": false,
2094
+ "notNull": true,
2095
+ "autoincrement": false,
2096
+ "default": 0
2097
+ },
2098
+ "archived_at": {
2099
+ "name": "archived_at",
2100
+ "type": "integer",
2101
+ "primaryKey": false,
2102
+ "notNull": false,
2103
+ "autoincrement": false
2104
+ },
2105
+ "folder": {
2106
+ "name": "folder",
2107
+ "type": "text",
2108
+ "primaryKey": false,
2109
+ "notNull": false,
2110
+ "autoincrement": false
2111
+ }
2112
+ },
2113
+ "indexes": {
2114
+ "secrets_lookup_idx": {
2115
+ "name": "secrets_lookup_idx",
2116
+ "columns": [
2117
+ "project_id",
2118
+ "environment_id",
2119
+ "key"
2120
+ ],
2121
+ "isUnique": false
2122
+ },
2123
+ "secrets_project_id_environment_id_key_key": {
2124
+ "name": "secrets_project_id_environment_id_key_key",
2125
+ "columns": [
2126
+ "project_id",
2127
+ "environment_id",
2128
+ "key"
2129
+ ],
2130
+ "isUnique": true
2131
+ }
2132
+ },
2133
+ "foreignKeys": {
2134
+ "secrets_current_version_id_secret_versions_id_fk": {
2135
+ "name": "secrets_current_version_id_secret_versions_id_fk",
2136
+ "tableFrom": "secrets",
2137
+ "tableTo": "secret_versions",
2138
+ "columnsFrom": [
2139
+ "current_version_id"
2140
+ ],
2141
+ "columnsTo": [
2142
+ "id"
2143
+ ],
2144
+ "onDelete": "no action",
2145
+ "onUpdate": "no action"
2146
+ },
2147
+ "secrets_project_id_fkey": {
2148
+ "name": "secrets_project_id_fkey",
2149
+ "tableFrom": "secrets",
2150
+ "tableTo": "projects",
2151
+ "columnsFrom": [
2152
+ "project_id"
2153
+ ],
2154
+ "columnsTo": [
2155
+ "id"
2156
+ ],
2157
+ "onDelete": "restrict",
2158
+ "onUpdate": "no action"
2159
+ },
2160
+ "secrets_environment_id_fkey": {
2161
+ "name": "secrets_environment_id_fkey",
2162
+ "tableFrom": "secrets",
2163
+ "tableTo": "environments",
2164
+ "columnsFrom": [
2165
+ "environment_id"
2166
+ ],
2167
+ "columnsTo": [
2168
+ "id"
2169
+ ],
2170
+ "onDelete": "restrict",
2171
+ "onUpdate": "no action"
2172
+ },
2173
+ "secrets_environment_in_project": {
2174
+ "name": "secrets_environment_in_project",
2175
+ "tableFrom": "secrets",
2176
+ "tableTo": "environments",
2177
+ "columnsFrom": [
2178
+ "environment_id",
2179
+ "project_id"
2180
+ ],
2181
+ "columnsTo": [
2182
+ "id",
2183
+ "project_id"
2184
+ ],
2185
+ "onDelete": "no action",
2186
+ "onUpdate": "no action"
2187
+ }
2188
+ },
2189
+ "compositePrimaryKeys": {},
2190
+ "uniqueConstraints": {},
2191
+ "checkConstraints": {
2192
+ "secrets_key_check": {
2193
+ "name": "secrets_key_check",
2194
+ "value": "length(\"secrets\".\"key\") BETWEEN 1 AND 128 AND \"secrets\".\"key\" GLOB '[A-Za-z_]*' AND \"secrets\".\"key\" NOT GLOB '*[^A-Za-z0-9_]*'"
2195
+ },
2196
+ "secrets_folder_check": {
2197
+ "name": "secrets_folder_check",
2198
+ "value": "\"secrets\".\"folder\" IS NULL OR (length(\"secrets\".\"folder\") BETWEEN 1 AND 64 AND \"secrets\".\"folder\" NOT GLOB '*/*' AND \"secrets\".\"folder\" = trim(\"secrets\".\"folder\"))"
2199
+ }
2200
+ }
2201
+ },
2202
+ "service_bindings": {
2203
+ "name": "service_bindings",
2204
+ "columns": {
2205
+ "id": {
2206
+ "name": "id",
2207
+ "type": "text",
2208
+ "primaryKey": true,
2209
+ "notNull": true,
2210
+ "autoincrement": false
2211
+ },
2212
+ "auth_mac": {
2213
+ "name": "auth_mac",
2214
+ "type": "blob",
2215
+ "primaryKey": false,
2216
+ "notNull": true,
2217
+ "autoincrement": false
2218
+ },
2219
+ "principal": {
2220
+ "name": "principal",
2221
+ "type": "text",
2222
+ "primaryKey": false,
2223
+ "notNull": true,
2224
+ "autoincrement": false
2225
+ },
2226
+ "generation": {
2227
+ "name": "generation",
2228
+ "type": "integer",
2229
+ "primaryKey": false,
2230
+ "notNull": true,
2231
+ "autoincrement": false
2232
+ },
2233
+ "profile": {
2234
+ "name": "profile",
2235
+ "type": "text",
2236
+ "primaryKey": false,
2237
+ "notNull": true,
2238
+ "autoincrement": false
2239
+ },
2240
+ "issuer": {
2241
+ "name": "issuer",
2242
+ "type": "text",
2243
+ "primaryKey": false,
2244
+ "notNull": true,
2245
+ "autoincrement": false
2246
+ },
2247
+ "jwks_uri": {
2248
+ "name": "jwks_uri",
2249
+ "type": "text",
2250
+ "primaryKey": false,
2251
+ "notNull": true,
2252
+ "autoincrement": false
2253
+ },
2254
+ "jwks": {
2255
+ "name": "jwks",
2256
+ "type": "text",
2257
+ "primaryKey": false,
2258
+ "notNull": false,
2259
+ "autoincrement": false
2260
+ },
2261
+ "claims": {
2262
+ "name": "claims",
2263
+ "type": "text",
2264
+ "primaryKey": false,
2265
+ "notNull": true,
2266
+ "autoincrement": false
2267
+ },
2268
+ "scope": {
2269
+ "name": "scope",
2270
+ "type": "text",
2271
+ "primaryKey": false,
2272
+ "notNull": false,
2273
+ "autoincrement": false
2274
+ },
2275
+ "label": {
2276
+ "name": "label",
2277
+ "type": "text",
2278
+ "primaryKey": false,
2279
+ "notNull": false,
2280
+ "autoincrement": false
2281
+ },
2282
+ "created_at": {
2283
+ "name": "created_at",
2284
+ "type": "integer",
2285
+ "primaryKey": false,
2286
+ "notNull": true,
2287
+ "autoincrement": false,
2288
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
2289
+ },
2290
+ "created_by": {
2291
+ "name": "created_by",
2292
+ "type": "text",
2293
+ "primaryKey": false,
2294
+ "notNull": true,
2295
+ "autoincrement": false
2296
+ },
2297
+ "last_used_at": {
2298
+ "name": "last_used_at",
2299
+ "type": "integer",
2300
+ "primaryKey": false,
2301
+ "notNull": false,
2302
+ "autoincrement": false
2303
+ },
2304
+ "revoked_at": {
2305
+ "name": "revoked_at",
2306
+ "type": "integer",
2307
+ "primaryKey": false,
2308
+ "notNull": false,
2309
+ "autoincrement": false
2310
+ },
2311
+ "revoked_by": {
2312
+ "name": "revoked_by",
2313
+ "type": "text",
2314
+ "primaryKey": false,
2315
+ "notNull": false,
2316
+ "autoincrement": false
2317
+ }
2318
+ },
2319
+ "indexes": {
2320
+ "service_bindings_principal_idx": {
2321
+ "name": "service_bindings_principal_idx",
2322
+ "columns": [
2323
+ "principal",
2324
+ "issuer"
2325
+ ],
2326
+ "isUnique": false
2327
+ },
2328
+ "service_bindings_live_idx": {
2329
+ "name": "service_bindings_live_idx",
2330
+ "columns": [
2331
+ "principal",
2332
+ "issuer",
2333
+ "generation",
2334
+ "created_at",
2335
+ "id"
2336
+ ],
2337
+ "isUnique": false,
2338
+ "where": "\"service_bindings\".\"revoked_at\" IS NULL"
2339
+ }
2340
+ },
2341
+ "foreignKeys": {
2342
+ "service_bindings_principal_fkey": {
2343
+ "name": "service_bindings_principal_fkey",
2344
+ "tableFrom": "service_bindings",
2345
+ "tableTo": "vault_members",
2346
+ "columnsFrom": [
2347
+ "principal"
2348
+ ],
2349
+ "columnsTo": [
2350
+ "principal"
2351
+ ],
2352
+ "onDelete": "restrict",
2353
+ "onUpdate": "no action"
2354
+ }
2355
+ },
2356
+ "compositePrimaryKeys": {},
2357
+ "uniqueConstraints": {},
2358
+ "checkConstraints": {
2359
+ "service_bindings_principal_check": {
2360
+ "name": "service_bindings_principal_check",
2361
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
2362
+ },
2363
+ "service_bindings_auth_mac_check": {
2364
+ "name": "service_bindings_auth_mac_check",
2365
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
2366
+ },
2367
+ "service_bindings_claims_check": {
2368
+ "name": "service_bindings_claims_check",
2369
+ "value": "json_valid(\"service_bindings\".\"claims\")"
2370
+ }
2371
+ }
2372
+ },
2373
+ "vault_grants": {
2374
+ "name": "vault_grants",
2375
+ "columns": {
2376
+ "principal": {
2377
+ "name": "principal",
2378
+ "type": "text",
2379
+ "primaryKey": false,
2380
+ "notNull": true,
2381
+ "autoincrement": false
2382
+ },
2383
+ "project_id": {
2384
+ "name": "project_id",
2385
+ "type": "text",
2386
+ "primaryKey": false,
2387
+ "notNull": false,
2388
+ "autoincrement": false
2389
+ },
2390
+ "environment_id": {
2391
+ "name": "environment_id",
2392
+ "type": "text",
2393
+ "primaryKey": false,
2394
+ "notNull": false,
2395
+ "autoincrement": false
2396
+ },
2397
+ "environment_slug": {
2398
+ "name": "environment_slug",
2399
+ "type": "text",
2400
+ "primaryKey": false,
2401
+ "notNull": false,
2402
+ "autoincrement": false
2403
+ },
2404
+ "role": {
2405
+ "name": "role",
2406
+ "type": "text",
2407
+ "primaryKey": false,
2408
+ "notNull": true,
2409
+ "autoincrement": false
2410
+ },
2411
+ "expires_at": {
2412
+ "name": "expires_at",
2413
+ "type": "integer",
2414
+ "primaryKey": false,
2415
+ "notNull": false,
2416
+ "autoincrement": false
2417
+ },
2418
+ "granted_at": {
2419
+ "name": "granted_at",
2420
+ "type": "integer",
2421
+ "primaryKey": false,
2422
+ "notNull": true,
2423
+ "autoincrement": false
2424
+ },
2425
+ "granted_by": {
2426
+ "name": "granted_by",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true,
2430
+ "autoincrement": false
2431
+ }
2432
+ },
2433
+ "indexes": {
2434
+ "vault_grants_on_every_project": {
2435
+ "name": "vault_grants_on_every_project",
2436
+ "columns": [
2437
+ "principal"
2438
+ ],
2439
+ "isUnique": true,
2440
+ "where": "\"vault_grants\".\"project_id\" IS NULL AND \"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL"
2441
+ },
2442
+ "vault_grants_on_project": {
2443
+ "name": "vault_grants_on_project",
2444
+ "columns": [
2445
+ "principal",
2446
+ "project_id"
2447
+ ],
2448
+ "isUnique": true
2449
+ },
2450
+ "vault_grants_on_environment": {
2451
+ "name": "vault_grants_on_environment",
2452
+ "columns": [
2453
+ "principal",
2454
+ "environment_id"
2455
+ ],
2456
+ "isUnique": true
2457
+ },
2458
+ "vault_grants_on_environment_slug": {
2459
+ "name": "vault_grants_on_environment_slug",
2460
+ "columns": [
2461
+ "principal",
2462
+ "environment_slug"
2463
+ ],
2464
+ "isUnique": true
2465
+ }
2466
+ },
2467
+ "foreignKeys": {
2468
+ "vault_grants_principal_fkey": {
2469
+ "name": "vault_grants_principal_fkey",
2470
+ "tableFrom": "vault_grants",
2471
+ "tableTo": "vault_members",
2472
+ "columnsFrom": [
2473
+ "principal"
2474
+ ],
2475
+ "columnsTo": [
2476
+ "principal"
2477
+ ],
2478
+ "onDelete": "restrict",
2479
+ "onUpdate": "no action"
2480
+ },
2481
+ "vault_grants_project_id_fkey": {
2482
+ "name": "vault_grants_project_id_fkey",
2483
+ "tableFrom": "vault_grants",
2484
+ "tableTo": "projects",
2485
+ "columnsFrom": [
2486
+ "project_id"
2487
+ ],
2488
+ "columnsTo": [
2489
+ "id"
2490
+ ],
2491
+ "onDelete": "restrict",
2492
+ "onUpdate": "no action"
2493
+ },
2494
+ "vault_grants_environment_id_fkey": {
2495
+ "name": "vault_grants_environment_id_fkey",
2496
+ "tableFrom": "vault_grants",
2497
+ "tableTo": "environments",
2498
+ "columnsFrom": [
2499
+ "environment_id"
2500
+ ],
2501
+ "columnsTo": [
2502
+ "id"
2503
+ ],
2504
+ "onDelete": "restrict",
2505
+ "onUpdate": "no action"
2506
+ }
2507
+ },
2508
+ "compositePrimaryKeys": {},
2509
+ "uniqueConstraints": {},
2510
+ "checkConstraints": {
2511
+ "vault_grants_one_place": {
2512
+ "name": "vault_grants_one_place",
2513
+ "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)"
2514
+ },
2515
+ "vault_grants_environment_slug_check": {
2516
+ "name": "vault_grants_environment_slug_check",
2517
+ "value": "\"vault_grants\".\"environment_slug\" IS NULL OR (length(\"vault_grants\".\"environment_slug\") BETWEEN 1 AND 63 AND \"vault_grants\".\"environment_slug\" GLOB '[a-z0-9]*' AND \"vault_grants\".\"environment_slug\" NOT GLOB '*[^a-z0-9-]*')"
2518
+ },
2519
+ "vault_grants_role_check": {
2520
+ "name": "vault_grants_role_check",
2521
+ "value": "\"vault_grants\".\"role\" IN ('viewer', 'developer', 'maintainer', 'access-manager', 'auditor', 'owner')"
2522
+ },
2523
+ "vault_grants_environment_role_check": {
2524
+ "name": "vault_grants_environment_role_check",
2525
+ "value": "(\"vault_grants\".\"environment_id\" IS NULL AND \"vault_grants\".\"environment_slug\" IS NULL) OR \"vault_grants\".\"role\" IN ('viewer', 'developer', 'auditor')"
2526
+ }
2527
+ }
2528
+ },
2529
+ "vault_members": {
2530
+ "name": "vault_members",
2531
+ "columns": {
2532
+ "principal": {
2533
+ "name": "principal",
2534
+ "type": "text",
2535
+ "primaryKey": true,
2536
+ "notNull": true,
2537
+ "autoincrement": false
2538
+ },
2539
+ "status": {
2540
+ "name": "status",
2541
+ "type": "text",
2542
+ "primaryKey": false,
2543
+ "notNull": true,
2544
+ "autoincrement": false
2545
+ },
2546
+ "owner": {
2547
+ "name": "owner",
2548
+ "type": "integer",
2549
+ "primaryKey": false,
2550
+ "notNull": true,
2551
+ "autoincrement": false,
2552
+ "default": false
2553
+ },
2554
+ "role": {
2555
+ "name": "role",
2556
+ "type": "text",
2557
+ "primaryKey": false,
2558
+ "notNull": false,
2559
+ "autoincrement": false
2560
+ },
2561
+ "scope": {
2562
+ "name": "scope",
2563
+ "type": "text",
2564
+ "primaryKey": false,
2565
+ "notNull": false,
2566
+ "autoincrement": false
2567
+ },
2568
+ "generation": {
2569
+ "name": "generation",
2570
+ "type": "integer",
2571
+ "primaryKey": false,
2572
+ "notNull": true,
2573
+ "autoincrement": false,
2574
+ "default": 0
2575
+ },
2576
+ "created_at": {
2577
+ "name": "created_at",
2578
+ "type": "integer",
2579
+ "primaryKey": false,
2580
+ "notNull": true,
2581
+ "autoincrement": false
2582
+ },
2583
+ "created_by": {
2584
+ "name": "created_by",
2585
+ "type": "text",
2586
+ "primaryKey": false,
2587
+ "notNull": true,
2588
+ "autoincrement": false
2589
+ },
2590
+ "status_changed_at": {
2591
+ "name": "status_changed_at",
2592
+ "type": "integer",
2593
+ "primaryKey": false,
2594
+ "notNull": true,
2595
+ "autoincrement": false
2596
+ },
2597
+ "status_changed_by": {
2598
+ "name": "status_changed_by",
2599
+ "type": "text",
2600
+ "primaryKey": false,
2601
+ "notNull": true,
2602
+ "autoincrement": false
2603
+ },
2604
+ "access_seq": {
2605
+ "name": "access_seq",
2606
+ "type": "integer",
2607
+ "primaryKey": false,
2608
+ "notNull": true,
2609
+ "autoincrement": false
2610
+ },
2611
+ "mac": {
2612
+ "name": "mac",
2613
+ "type": "blob",
2614
+ "primaryKey": false,
2615
+ "notNull": true,
2616
+ "autoincrement": false
2617
+ }
2618
+ },
2619
+ "indexes": {},
2620
+ "foreignKeys": {},
2621
+ "compositePrimaryKeys": {},
2622
+ "uniqueConstraints": {},
2623
+ "checkConstraints": {
2624
+ "vault_members_mac_check": {
2625
+ "name": "vault_members_mac_check",
2626
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
2627
+ },
2628
+ "vault_members_principal_check": {
2629
+ "name": "vault_members_principal_check",
2630
+ "value": "(\"vault_members\".\"principal\" GLOB 'user:?*' OR \"vault_members\".\"principal\" GLOB 'token:?*')\n AND substr(\"vault_members\".\"principal\", instr(\"vault_members\".\"principal\", ':') + 1, 1) <> ':'\n AND instr(\"vault_members\".\"principal\", ' ') = 0 AND instr(\"vault_members\".\"principal\", char(9)) = 0\n AND instr(\"vault_members\".\"principal\", char(10)) = 0 AND instr(\"vault_members\".\"principal\", char(13)) = 0"
2631
+ },
2632
+ "vault_members_user_lowercase": {
2633
+ "name": "vault_members_user_lowercase",
2634
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
2635
+ },
2636
+ "vault_members_status_check": {
2637
+ "name": "vault_members_status_check",
2638
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
2639
+ },
2640
+ "vault_members_owner_check": {
2641
+ "name": "vault_members_owner_check",
2642
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
2643
+ },
2644
+ "vault_members_generation_check": {
2645
+ "name": "vault_members_generation_check",
2646
+ "value": "\"vault_members\".\"generation\" >= 0"
2647
+ }
2648
+ }
2649
+ }
2650
+ },
2651
+ "views": {},
2652
+ "enums": {},
2653
+ "_meta": {
2654
+ "schemas": {},
2655
+ "tables": {},
2656
+ "columns": {}
2657
+ },
2658
+ "internal": {
2659
+ "indexes": {
2660
+ "audit_log_unbind_idx": {
2661
+ "columns": {
2662
+ "json_extract(\"metadata\", '$.bindingId')": {
2663
+ "isExpression": true
2664
+ }
2665
+ }
2666
+ },
2667
+ "audit_log_exchange_idx": {
2668
+ "columns": {
2669
+ "json_extract(\"metadata\", '$.credentialId')": {
2670
+ "isExpression": true
2671
+ }
2672
+ }
2673
+ },
2674
+ "audit_log_token_create_idx": {
2675
+ "columns": {
2676
+ "json_extract(\"metadata\", '$.targetCredentialId')": {
2677
+ "isExpression": true
2678
+ }
2679
+ }
2680
+ },
2681
+ "audit_log_also_project_idx": {
2682
+ "columns": {
2683
+ "json_extract(\"metadata\", '$.also.projectId')": {
2684
+ "isExpression": true
2685
+ }
2686
+ }
2687
+ },
2688
+ "audit_log_also_environment_idx": {
2689
+ "columns": {
2690
+ "json_extract(\"metadata\", '$.also.environmentId')": {
2691
+ "isExpression": true
2692
+ }
2693
+ }
2694
+ },
2695
+ "audit_log_also_secret_idx": {
2696
+ "columns": {
2697
+ "json_extract(\"metadata\", '$.also.secretId')": {
2698
+ "isExpression": true
2699
+ }
2700
+ }
2701
+ }
2702
+ }
2703
+ }
2704
+ }