@coffre/db 0.10.2 → 0.11.0

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