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