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