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