@coffre/db 0.1.15 → 0.1.16

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 (47) hide show
  1. package/dist/connect.d.ts +1 -1
  2. package/dist/{database-CNMfHZwF.d.ts → database-Cq_52uUo.d.ts} +1 -1
  3. package/dist/dialect.d.ts +1 -1
  4. package/dist/hyperdrive.d.ts +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +8 -4
  7. package/dist/log.d.ts +1 -1
  8. package/dist/migrations/postgres/0002_service_bindings.sql +28 -0
  9. package/dist/migrations/postgres/0003_exchanges.sql +10 -0
  10. package/dist/migrations/postgres/0004_live_indexes.sql +3 -0
  11. package/dist/migrations/postgres/meta/0002_snapshot.json +1870 -0
  12. package/dist/migrations/postgres/meta/0003_snapshot.json +1917 -0
  13. package/dist/migrations/postgres/meta/0004_snapshot.json +2006 -0
  14. package/dist/migrations/postgres/meta/_journal.json +21 -0
  15. package/dist/migrations/sqlite/0002_service_bindings.sql +23 -0
  16. package/dist/migrations/sqlite/0003_exchanges.sql +7 -0
  17. package/dist/migrations/sqlite/0004_live_indexes.sql +3 -0
  18. package/dist/migrations/sqlite/meta/0002_snapshot.json +1736 -0
  19. package/dist/migrations/sqlite/meta/0003_snapshot.json +1781 -0
  20. package/dist/migrations/sqlite/meta/0004_snapshot.json +1811 -0
  21. package/dist/migrations/sqlite/meta/_journal.json +21 -0
  22. package/dist/portable.d.ts +2 -2
  23. package/dist/{schema-AmvM6w0D.d.ts → schema-Wt-p8AOh.d.ts} +305 -2
  24. package/dist/schema-sqlite.d.ts +305 -1
  25. package/dist/schema-sqlite.js +38 -3
  26. package/dist/schema-version.d.ts +1 -1
  27. package/dist/schema-version.js +74 -26
  28. package/dist/schema.d.ts +2 -2
  29. package/dist/schema.js +53 -3
  30. package/package.json +2 -2
  31. package/src/database.ts +15 -5
  32. package/src/migrations/postgres/0002_service_bindings.sql +28 -0
  33. package/src/migrations/postgres/0003_exchanges.sql +10 -0
  34. package/src/migrations/postgres/0004_live_indexes.sql +3 -0
  35. package/src/migrations/postgres/meta/0002_snapshot.json +1870 -0
  36. package/src/migrations/postgres/meta/0003_snapshot.json +1917 -0
  37. package/src/migrations/postgres/meta/0004_snapshot.json +2006 -0
  38. package/src/migrations/postgres/meta/_journal.json +21 -0
  39. package/src/migrations/sqlite/0002_service_bindings.sql +23 -0
  40. package/src/migrations/sqlite/0003_exchanges.sql +7 -0
  41. package/src/migrations/sqlite/0004_live_indexes.sql +3 -0
  42. package/src/migrations/sqlite/meta/0002_snapshot.json +1736 -0
  43. package/src/migrations/sqlite/meta/0003_snapshot.json +1781 -0
  44. package/src/migrations/sqlite/meta/0004_snapshot.json +1811 -0
  45. package/src/migrations/sqlite/meta/_journal.json +21 -0
  46. package/src/schema.sqlite.ts +61 -0
  47. package/src/schema.ts +74 -0
@@ -0,0 +1,1917 @@
1
+ {
2
+ "id": "84bd3c31-4e3e-4b7b-8740-1ceccd44541a",
3
+ "prevId": "2f0996c8-a3b8-4028-b018-2eaa38d02705",
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_exchange_idx": {
401
+ "name": "audit_log_exchange_idx",
402
+ "columns": [
403
+ {
404
+ "expression": "((\"metadata\")::jsonb ->> 'credentialId')",
405
+ "asc": true,
406
+ "isExpression": true,
407
+ "nulls": "last"
408
+ }
409
+ ],
410
+ "isUnique": false,
411
+ "where": "\"audit_log\".\"author\" = 'app' AND \"audit_log\".\"action\" = 'token.exchange' AND \"audit_log\".\"decision\" = 'allow'",
412
+ "concurrently": false,
413
+ "method": "btree",
414
+ "with": {}
415
+ }
416
+ },
417
+ "foreignKeys": {
418
+ "audit_log_project_id_fkey": {
419
+ "name": "audit_log_project_id_fkey",
420
+ "tableFrom": "audit_log",
421
+ "tableTo": "projects",
422
+ "columnsFrom": [
423
+ "project_id"
424
+ ],
425
+ "columnsTo": [
426
+ "id"
427
+ ],
428
+ "onDelete": "restrict",
429
+ "onUpdate": "no action"
430
+ },
431
+ "audit_log_environment_id_fkey": {
432
+ "name": "audit_log_environment_id_fkey",
433
+ "tableFrom": "audit_log",
434
+ "tableTo": "environments",
435
+ "columnsFrom": [
436
+ "environment_id"
437
+ ],
438
+ "columnsTo": [
439
+ "id"
440
+ ],
441
+ "onDelete": "restrict",
442
+ "onUpdate": "no action"
443
+ },
444
+ "audit_log_secret_id_fkey": {
445
+ "name": "audit_log_secret_id_fkey",
446
+ "tableFrom": "audit_log",
447
+ "tableTo": "secrets",
448
+ "columnsFrom": [
449
+ "secret_id"
450
+ ],
451
+ "columnsTo": [
452
+ "id"
453
+ ],
454
+ "onDelete": "restrict",
455
+ "onUpdate": "no action"
456
+ },
457
+ "audit_log_secret_version_id_fkey": {
458
+ "name": "audit_log_secret_version_id_fkey",
459
+ "tableFrom": "audit_log",
460
+ "tableTo": "secret_versions",
461
+ "columnsFrom": [
462
+ "secret_version_id"
463
+ ],
464
+ "columnsTo": [
465
+ "id"
466
+ ],
467
+ "onDelete": "restrict",
468
+ "onUpdate": "no action"
469
+ },
470
+ "audit_log_related_seq_fkey": {
471
+ "name": "audit_log_related_seq_fkey",
472
+ "tableFrom": "audit_log",
473
+ "tableTo": "audit_log",
474
+ "columnsFrom": [
475
+ "related_seq"
476
+ ],
477
+ "columnsTo": [
478
+ "seq"
479
+ ],
480
+ "onDelete": "restrict",
481
+ "onUpdate": "no action"
482
+ }
483
+ },
484
+ "compositePrimaryKeys": {},
485
+ "uniqueConstraints": {},
486
+ "policies": {},
487
+ "checkConstraints": {
488
+ "audit_log_author_check": {
489
+ "name": "audit_log_author_check",
490
+ "value": "\"audit_log\".\"author\" IN ('app', 'vault')"
491
+ },
492
+ "audit_log_actor_check": {
493
+ "name": "audit_log_actor_check",
494
+ "value": "\"audit_log\".\"actor\" ~ '^(user|token|sync|system):.+$'"
495
+ },
496
+ "audit_log_decision_check": {
497
+ "name": "audit_log_decision_check",
498
+ "value": "\"audit_log\".\"decision\" IN ('allow', 'deny')"
499
+ },
500
+ "audit_log_metadata_check": {
501
+ "name": "audit_log_metadata_check",
502
+ "value": "\"audit_log\".\"metadata\"::jsonb IS NOT NULL"
503
+ },
504
+ "audit_log_prev_hash_check": {
505
+ "name": "audit_log_prev_hash_check",
506
+ "value": "octet_length(\"audit_log\".\"prev_hash\") = 32"
507
+ },
508
+ "audit_log_mac_check": {
509
+ "name": "audit_log_mac_check",
510
+ "value": "octet_length(\"audit_log\".\"mac\") = 32"
511
+ },
512
+ "audit_log_hash_check": {
513
+ "name": "audit_log_hash_check",
514
+ "value": "octet_length(\"audit_log\".\"hash\") = 32"
515
+ }
516
+ },
517
+ "isRLSEnabled": false
518
+ },
519
+ "public.consumed_tokens": {
520
+ "name": "consumed_tokens",
521
+ "schema": "",
522
+ "columns": {
523
+ "hash": {
524
+ "name": "hash",
525
+ "type": "bytea",
526
+ "primaryKey": true,
527
+ "notNull": true
528
+ },
529
+ "consumed_at": {
530
+ "name": "consumed_at",
531
+ "type": "timestamp with time zone",
532
+ "primaryKey": false,
533
+ "notNull": true,
534
+ "default": "now()"
535
+ }
536
+ },
537
+ "indexes": {},
538
+ "foreignKeys": {},
539
+ "compositePrimaryKeys": {},
540
+ "uniqueConstraints": {},
541
+ "policies": {},
542
+ "checkConstraints": {
543
+ "consumed_tokens_hash_check": {
544
+ "name": "consumed_tokens_hash_check",
545
+ "value": "octet_length(\"consumed_tokens\".\"hash\") = 32"
546
+ }
547
+ },
548
+ "isRLSEnabled": false
549
+ },
550
+ "public.credentials": {
551
+ "name": "credentials",
552
+ "schema": "",
553
+ "columns": {
554
+ "id": {
555
+ "name": "id",
556
+ "type": "uuid",
557
+ "primaryKey": true,
558
+ "notNull": true,
559
+ "default": "gen_random_uuid()"
560
+ },
561
+ "kind": {
562
+ "name": "kind",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": true
566
+ },
567
+ "auth_mac": {
568
+ "name": "auth_mac",
569
+ "type": "bytea",
570
+ "primaryKey": false,
571
+ "notNull": true
572
+ },
573
+ "token_hash": {
574
+ "name": "token_hash",
575
+ "type": "bytea",
576
+ "primaryKey": false,
577
+ "notNull": true
578
+ },
579
+ "token_hint": {
580
+ "name": "token_hint",
581
+ "type": "text",
582
+ "primaryKey": false,
583
+ "notNull": true
584
+ },
585
+ "generation": {
586
+ "name": "generation",
587
+ "type": "integer",
588
+ "primaryKey": false,
589
+ "notNull": true
590
+ },
591
+ "principal": {
592
+ "name": "principal",
593
+ "type": "text",
594
+ "primaryKey": false,
595
+ "notNull": true
596
+ },
597
+ "identity_id": {
598
+ "name": "identity_id",
599
+ "type": "uuid",
600
+ "primaryKey": false,
601
+ "notNull": false
602
+ },
603
+ "label": {
604
+ "name": "label",
605
+ "type": "text",
606
+ "primaryKey": false,
607
+ "notNull": false
608
+ },
609
+ "created_at": {
610
+ "name": "created_at",
611
+ "type": "timestamp with time zone",
612
+ "primaryKey": false,
613
+ "notNull": true,
614
+ "default": "now()"
615
+ },
616
+ "created_by": {
617
+ "name": "created_by",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": true
621
+ },
622
+ "expires_at": {
623
+ "name": "expires_at",
624
+ "type": "timestamp with time zone",
625
+ "primaryKey": false,
626
+ "notNull": true
627
+ },
628
+ "last_used_at": {
629
+ "name": "last_used_at",
630
+ "type": "timestamp with time zone",
631
+ "primaryKey": false,
632
+ "notNull": false
633
+ },
634
+ "last_used_ip": {
635
+ "name": "last_used_ip",
636
+ "type": "text",
637
+ "primaryKey": false,
638
+ "notNull": false
639
+ },
640
+ "revoked_at": {
641
+ "name": "revoked_at",
642
+ "type": "timestamp with time zone",
643
+ "primaryKey": false,
644
+ "notNull": false
645
+ },
646
+ "revoked_by": {
647
+ "name": "revoked_by",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": false
651
+ }
652
+ },
653
+ "indexes": {
654
+ "credentials_principal_idx": {
655
+ "name": "credentials_principal_idx",
656
+ "columns": [
657
+ {
658
+ "expression": "principal",
659
+ "isExpression": false,
660
+ "asc": true,
661
+ "nulls": "last"
662
+ },
663
+ {
664
+ "expression": "generation",
665
+ "isExpression": false,
666
+ "asc": true,
667
+ "nulls": "last"
668
+ }
669
+ ],
670
+ "isUnique": false,
671
+ "concurrently": false,
672
+ "method": "btree",
673
+ "with": {}
674
+ }
675
+ },
676
+ "foreignKeys": {
677
+ "credentials_principal_fkey": {
678
+ "name": "credentials_principal_fkey",
679
+ "tableFrom": "credentials",
680
+ "tableTo": "vault_members",
681
+ "columnsFrom": [
682
+ "principal"
683
+ ],
684
+ "columnsTo": [
685
+ "principal"
686
+ ],
687
+ "onDelete": "restrict",
688
+ "onUpdate": "no action"
689
+ },
690
+ "credentials_identity_id_fkey": {
691
+ "name": "credentials_identity_id_fkey",
692
+ "tableFrom": "credentials",
693
+ "tableTo": "identities",
694
+ "columnsFrom": [
695
+ "identity_id",
696
+ "principal",
697
+ "generation"
698
+ ],
699
+ "columnsTo": [
700
+ "id",
701
+ "principal",
702
+ "generation"
703
+ ],
704
+ "onDelete": "restrict",
705
+ "onUpdate": "no action"
706
+ }
707
+ },
708
+ "compositePrimaryKeys": {},
709
+ "uniqueConstraints": {
710
+ "credentials_token_hash_key": {
711
+ "name": "credentials_token_hash_key",
712
+ "nullsNotDistinct": false,
713
+ "columns": [
714
+ "token_hash"
715
+ ]
716
+ }
717
+ },
718
+ "policies": {},
719
+ "checkConstraints": {
720
+ "credentials_kind_check": {
721
+ "name": "credentials_kind_check",
722
+ "value": "\"credentials\".\"kind\" IN ('browser', 'cli', 'service')"
723
+ },
724
+ "credentials_principal_check": {
725
+ "name": "credentials_principal_check",
726
+ "value": "\"credentials\".\"principal\" LIKE 'user:%' OR \"credentials\".\"principal\" LIKE 'token:%'"
727
+ },
728
+ "credentials_kind_matches_principal": {
729
+ "name": "credentials_kind_matches_principal",
730
+ "value": "(\"credentials\".\"kind\" = 'service') = (\"credentials\".\"principal\" LIKE 'token:%')"
731
+ },
732
+ "credentials_token_hash_check": {
733
+ "name": "credentials_token_hash_check",
734
+ "value": "octet_length(\"credentials\".\"token_hash\") = 32"
735
+ },
736
+ "credentials_auth_mac_check": {
737
+ "name": "credentials_auth_mac_check",
738
+ "value": "octet_length(\"credentials\".\"auth_mac\") = 32"
739
+ }
740
+ },
741
+ "isRLSEnabled": false
742
+ },
743
+ "public.device_authorizations": {
744
+ "name": "device_authorizations",
745
+ "schema": "",
746
+ "columns": {
747
+ "id": {
748
+ "name": "id",
749
+ "type": "uuid",
750
+ "primaryKey": true,
751
+ "notNull": true,
752
+ "default": "gen_random_uuid()"
753
+ },
754
+ "device_code_hash": {
755
+ "name": "device_code_hash",
756
+ "type": "bytea",
757
+ "primaryKey": false,
758
+ "notNull": true
759
+ },
760
+ "auth_mac": {
761
+ "name": "auth_mac",
762
+ "type": "bytea",
763
+ "primaryKey": false,
764
+ "notNull": true
765
+ },
766
+ "user_code": {
767
+ "name": "user_code",
768
+ "type": "text",
769
+ "primaryKey": false,
770
+ "notNull": true
771
+ },
772
+ "client_label": {
773
+ "name": "client_label",
774
+ "type": "text",
775
+ "primaryKey": false,
776
+ "notNull": false
777
+ },
778
+ "client_ip": {
779
+ "name": "client_ip",
780
+ "type": "text",
781
+ "primaryKey": false,
782
+ "notNull": false
783
+ },
784
+ "created_at": {
785
+ "name": "created_at",
786
+ "type": "timestamp with time zone",
787
+ "primaryKey": false,
788
+ "notNull": true,
789
+ "default": "now()"
790
+ },
791
+ "expires_at": {
792
+ "name": "expires_at",
793
+ "type": "timestamp with time zone",
794
+ "primaryKey": false,
795
+ "notNull": true
796
+ },
797
+ "decided_at": {
798
+ "name": "decided_at",
799
+ "type": "timestamp with time zone",
800
+ "primaryKey": false,
801
+ "notNull": false
802
+ },
803
+ "decision": {
804
+ "name": "decision",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": false
808
+ },
809
+ "generation": {
810
+ "name": "generation",
811
+ "type": "integer",
812
+ "primaryKey": false,
813
+ "notNull": true,
814
+ "default": 0
815
+ },
816
+ "principal": {
817
+ "name": "principal",
818
+ "type": "text",
819
+ "primaryKey": false,
820
+ "notNull": false
821
+ },
822
+ "consumed_at": {
823
+ "name": "consumed_at",
824
+ "type": "timestamp with time zone",
825
+ "primaryKey": false,
826
+ "notNull": false
827
+ }
828
+ },
829
+ "indexes": {},
830
+ "foreignKeys": {
831
+ "device_authorizations_principal_fkey": {
832
+ "name": "device_authorizations_principal_fkey",
833
+ "tableFrom": "device_authorizations",
834
+ "tableTo": "vault_members",
835
+ "columnsFrom": [
836
+ "principal"
837
+ ],
838
+ "columnsTo": [
839
+ "principal"
840
+ ],
841
+ "onDelete": "restrict",
842
+ "onUpdate": "no action"
843
+ }
844
+ },
845
+ "compositePrimaryKeys": {},
846
+ "uniqueConstraints": {
847
+ "device_authorizations_device_code_hash_key": {
848
+ "name": "device_authorizations_device_code_hash_key",
849
+ "nullsNotDistinct": false,
850
+ "columns": [
851
+ "device_code_hash"
852
+ ]
853
+ },
854
+ "device_authorizations_user_code_key": {
855
+ "name": "device_authorizations_user_code_key",
856
+ "nullsNotDistinct": false,
857
+ "columns": [
858
+ "user_code"
859
+ ]
860
+ }
861
+ },
862
+ "policies": {},
863
+ "checkConstraints": {
864
+ "device_authorizations_auth_mac_check": {
865
+ "name": "device_authorizations_auth_mac_check",
866
+ "value": "octet_length(\"device_authorizations\".\"auth_mac\") = 32"
867
+ },
868
+ "device_authorizations_decision_check": {
869
+ "name": "device_authorizations_decision_check",
870
+ "value": "\"device_authorizations\".\"decision\" IS NULL OR \"device_authorizations\".\"decision\" IN ('approved', 'denied')"
871
+ },
872
+ "device_authorizations_approval_names_principal": {
873
+ "name": "device_authorizations_approval_names_principal",
874
+ "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 ))"
875
+ }
876
+ },
877
+ "isRLSEnabled": false
878
+ },
879
+ "public.environments": {
880
+ "name": "environments",
881
+ "schema": "",
882
+ "columns": {
883
+ "id": {
884
+ "name": "id",
885
+ "type": "uuid",
886
+ "primaryKey": true,
887
+ "notNull": true,
888
+ "default": "gen_random_uuid()"
889
+ },
890
+ "project_id": {
891
+ "name": "project_id",
892
+ "type": "uuid",
893
+ "primaryKey": false,
894
+ "notNull": true
895
+ },
896
+ "slug": {
897
+ "name": "slug",
898
+ "type": "text",
899
+ "primaryKey": false,
900
+ "notNull": true
901
+ },
902
+ "name": {
903
+ "name": "name",
904
+ "type": "text",
905
+ "primaryKey": false,
906
+ "notNull": true
907
+ },
908
+ "created_at": {
909
+ "name": "created_at",
910
+ "type": "timestamp with time zone",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "default": "now()"
914
+ },
915
+ "archived_at": {
916
+ "name": "archived_at",
917
+ "type": "timestamp with time zone",
918
+ "primaryKey": false,
919
+ "notNull": false
920
+ }
921
+ },
922
+ "indexes": {},
923
+ "foreignKeys": {
924
+ "environments_project_id_fkey": {
925
+ "name": "environments_project_id_fkey",
926
+ "tableFrom": "environments",
927
+ "tableTo": "projects",
928
+ "columnsFrom": [
929
+ "project_id"
930
+ ],
931
+ "columnsTo": [
932
+ "id"
933
+ ],
934
+ "onDelete": "restrict",
935
+ "onUpdate": "no action"
936
+ }
937
+ },
938
+ "compositePrimaryKeys": {},
939
+ "uniqueConstraints": {
940
+ "environments_project_id_slug_key": {
941
+ "name": "environments_project_id_slug_key",
942
+ "nullsNotDistinct": false,
943
+ "columns": [
944
+ "project_id",
945
+ "slug"
946
+ ]
947
+ },
948
+ "environments_project_scoped": {
949
+ "name": "environments_project_scoped",
950
+ "nullsNotDistinct": false,
951
+ "columns": [
952
+ "id",
953
+ "project_id"
954
+ ]
955
+ }
956
+ },
957
+ "policies": {},
958
+ "checkConstraints": {
959
+ "environments_slug_check": {
960
+ "name": "environments_slug_check",
961
+ "value": "\"environments\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
962
+ }
963
+ },
964
+ "isRLSEnabled": false
965
+ },
966
+ "public.identities": {
967
+ "name": "identities",
968
+ "schema": "",
969
+ "columns": {
970
+ "id": {
971
+ "name": "id",
972
+ "type": "uuid",
973
+ "primaryKey": true,
974
+ "notNull": true,
975
+ "default": "gen_random_uuid()"
976
+ },
977
+ "provider": {
978
+ "name": "provider",
979
+ "type": "text",
980
+ "primaryKey": false,
981
+ "notNull": true
982
+ },
983
+ "auth_mac": {
984
+ "name": "auth_mac",
985
+ "type": "bytea",
986
+ "primaryKey": false,
987
+ "notNull": true
988
+ },
989
+ "subject": {
990
+ "name": "subject",
991
+ "type": "text",
992
+ "primaryKey": false,
993
+ "notNull": true
994
+ },
995
+ "issuer_hash": {
996
+ "name": "issuer_hash",
997
+ "type": "text",
998
+ "primaryKey": false,
999
+ "notNull": true
1000
+ },
1001
+ "generation": {
1002
+ "name": "generation",
1003
+ "type": "integer",
1004
+ "primaryKey": false,
1005
+ "notNull": true
1006
+ },
1007
+ "principal": {
1008
+ "name": "principal",
1009
+ "type": "text",
1010
+ "primaryKey": false,
1011
+ "notNull": true
1012
+ },
1013
+ "email": {
1014
+ "name": "email",
1015
+ "type": "text",
1016
+ "primaryKey": false,
1017
+ "notNull": false
1018
+ },
1019
+ "created_at": {
1020
+ "name": "created_at",
1021
+ "type": "timestamp with time zone",
1022
+ "primaryKey": false,
1023
+ "notNull": true,
1024
+ "default": "now()"
1025
+ },
1026
+ "created_by": {
1027
+ "name": "created_by",
1028
+ "type": "text",
1029
+ "primaryKey": false,
1030
+ "notNull": true
1031
+ },
1032
+ "last_sign_in_at": {
1033
+ "name": "last_sign_in_at",
1034
+ "type": "timestamp with time zone",
1035
+ "primaryKey": false,
1036
+ "notNull": false
1037
+ },
1038
+ "revoked_at": {
1039
+ "name": "revoked_at",
1040
+ "type": "timestamp with time zone",
1041
+ "primaryKey": false,
1042
+ "notNull": false
1043
+ },
1044
+ "revoked_by": {
1045
+ "name": "revoked_by",
1046
+ "type": "text",
1047
+ "primaryKey": false,
1048
+ "notNull": false
1049
+ },
1050
+ "active_subject": {
1051
+ "name": "active_subject",
1052
+ "type": "text",
1053
+ "primaryKey": false,
1054
+ "notNull": false,
1055
+ "generated": {
1056
+ "as": "CASE WHEN revoked_at IS NULL THEN subject END",
1057
+ "type": "stored"
1058
+ }
1059
+ }
1060
+ },
1061
+ "indexes": {
1062
+ "identities_active_subject": {
1063
+ "name": "identities_active_subject",
1064
+ "columns": [
1065
+ {
1066
+ "expression": "provider",
1067
+ "isExpression": false,
1068
+ "asc": true,
1069
+ "nulls": "last"
1070
+ },
1071
+ {
1072
+ "expression": "issuer_hash",
1073
+ "isExpression": false,
1074
+ "asc": true,
1075
+ "nulls": "last"
1076
+ },
1077
+ {
1078
+ "expression": "active_subject",
1079
+ "isExpression": false,
1080
+ "asc": true,
1081
+ "nulls": "last"
1082
+ }
1083
+ ],
1084
+ "isUnique": true,
1085
+ "concurrently": false,
1086
+ "method": "btree",
1087
+ "with": {}
1088
+ },
1089
+ "identities_principal_idx": {
1090
+ "name": "identities_principal_idx",
1091
+ "columns": [
1092
+ {
1093
+ "expression": "principal",
1094
+ "isExpression": false,
1095
+ "asc": true,
1096
+ "nulls": "last"
1097
+ },
1098
+ {
1099
+ "expression": "generation",
1100
+ "isExpression": false,
1101
+ "asc": true,
1102
+ "nulls": "last"
1103
+ }
1104
+ ],
1105
+ "isUnique": false,
1106
+ "concurrently": false,
1107
+ "method": "btree",
1108
+ "with": {}
1109
+ }
1110
+ },
1111
+ "foreignKeys": {
1112
+ "identities_principal_fkey": {
1113
+ "name": "identities_principal_fkey",
1114
+ "tableFrom": "identities",
1115
+ "tableTo": "vault_members",
1116
+ "columnsFrom": [
1117
+ "principal"
1118
+ ],
1119
+ "columnsTo": [
1120
+ "principal"
1121
+ ],
1122
+ "onDelete": "restrict",
1123
+ "onUpdate": "no action"
1124
+ }
1125
+ },
1126
+ "compositePrimaryKeys": {},
1127
+ "uniqueConstraints": {
1128
+ "identities_member_generation_key": {
1129
+ "name": "identities_member_generation_key",
1130
+ "nullsNotDistinct": false,
1131
+ "columns": [
1132
+ "id",
1133
+ "principal",
1134
+ "generation"
1135
+ ]
1136
+ }
1137
+ },
1138
+ "policies": {},
1139
+ "checkConstraints": {
1140
+ "identities_principal_check": {
1141
+ "name": "identities_principal_check",
1142
+ "value": "\"identities\".\"principal\" LIKE 'user:%'"
1143
+ },
1144
+ "identities_provider_check": {
1145
+ "name": "identities_provider_check",
1146
+ "value": "\"identities\".\"provider\" ~ '^[a-z0-9][a-z0-9-]{0,31}$'"
1147
+ },
1148
+ "identities_auth_mac_check": {
1149
+ "name": "identities_auth_mac_check",
1150
+ "value": "octet_length(\"identities\".\"auth_mac\") = 32"
1151
+ }
1152
+ },
1153
+ "isRLSEnabled": false
1154
+ },
1155
+ "public.projects": {
1156
+ "name": "projects",
1157
+ "schema": "",
1158
+ "columns": {
1159
+ "id": {
1160
+ "name": "id",
1161
+ "type": "uuid",
1162
+ "primaryKey": true,
1163
+ "notNull": true,
1164
+ "default": "gen_random_uuid()"
1165
+ },
1166
+ "slug": {
1167
+ "name": "slug",
1168
+ "type": "text",
1169
+ "primaryKey": false,
1170
+ "notNull": true
1171
+ },
1172
+ "name": {
1173
+ "name": "name",
1174
+ "type": "text",
1175
+ "primaryKey": false,
1176
+ "notNull": true
1177
+ },
1178
+ "created_at": {
1179
+ "name": "created_at",
1180
+ "type": "timestamp with time zone",
1181
+ "primaryKey": false,
1182
+ "notNull": true,
1183
+ "default": "now()"
1184
+ },
1185
+ "archived_at": {
1186
+ "name": "archived_at",
1187
+ "type": "timestamp with time zone",
1188
+ "primaryKey": false,
1189
+ "notNull": false
1190
+ }
1191
+ },
1192
+ "indexes": {},
1193
+ "foreignKeys": {},
1194
+ "compositePrimaryKeys": {},
1195
+ "uniqueConstraints": {
1196
+ "projects_slug_key": {
1197
+ "name": "projects_slug_key",
1198
+ "nullsNotDistinct": false,
1199
+ "columns": [
1200
+ "slug"
1201
+ ]
1202
+ }
1203
+ },
1204
+ "policies": {},
1205
+ "checkConstraints": {
1206
+ "projects_slug_check": {
1207
+ "name": "projects_slug_check",
1208
+ "value": "\"projects\".\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'"
1209
+ }
1210
+ },
1211
+ "isRLSEnabled": false
1212
+ },
1213
+ "public.secret_versions": {
1214
+ "name": "secret_versions",
1215
+ "schema": "",
1216
+ "columns": {
1217
+ "id": {
1218
+ "name": "id",
1219
+ "type": "uuid",
1220
+ "primaryKey": true,
1221
+ "notNull": true,
1222
+ "default": "gen_random_uuid()"
1223
+ },
1224
+ "secret_id": {
1225
+ "name": "secret_id",
1226
+ "type": "uuid",
1227
+ "primaryKey": false,
1228
+ "notNull": true
1229
+ },
1230
+ "version": {
1231
+ "name": "version",
1232
+ "type": "integer",
1233
+ "primaryKey": false,
1234
+ "notNull": true
1235
+ },
1236
+ "envelope_version": {
1237
+ "name": "envelope_version",
1238
+ "type": "integer",
1239
+ "primaryKey": false,
1240
+ "notNull": true
1241
+ },
1242
+ "ciphertext": {
1243
+ "name": "ciphertext",
1244
+ "type": "bytea",
1245
+ "primaryKey": false,
1246
+ "notNull": true
1247
+ },
1248
+ "iv": {
1249
+ "name": "iv",
1250
+ "type": "bytea",
1251
+ "primaryKey": false,
1252
+ "notNull": true
1253
+ },
1254
+ "auth_tag": {
1255
+ "name": "auth_tag",
1256
+ "type": "bytea",
1257
+ "primaryKey": false,
1258
+ "notNull": true
1259
+ },
1260
+ "wrapped_dek": {
1261
+ "name": "wrapped_dek",
1262
+ "type": "bytea",
1263
+ "primaryKey": false,
1264
+ "notNull": true
1265
+ },
1266
+ "kek_provider": {
1267
+ "name": "kek_provider",
1268
+ "type": "text",
1269
+ "primaryKey": false,
1270
+ "notNull": true
1271
+ },
1272
+ "kek_id": {
1273
+ "name": "kek_id",
1274
+ "type": "text",
1275
+ "primaryKey": false,
1276
+ "notNull": true
1277
+ },
1278
+ "kek_version": {
1279
+ "name": "kek_version",
1280
+ "type": "text",
1281
+ "primaryKey": false,
1282
+ "notNull": true
1283
+ },
1284
+ "created_at": {
1285
+ "name": "created_at",
1286
+ "type": "timestamp with time zone",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "default": "now()"
1290
+ },
1291
+ "created_by": {
1292
+ "name": "created_by",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": true
1296
+ }
1297
+ },
1298
+ "indexes": {
1299
+ "secret_versions_secret_idx": {
1300
+ "name": "secret_versions_secret_idx",
1301
+ "columns": [
1302
+ {
1303
+ "expression": "secret_id",
1304
+ "isExpression": false,
1305
+ "asc": true,
1306
+ "nulls": "last"
1307
+ },
1308
+ {
1309
+ "expression": "version",
1310
+ "isExpression": false,
1311
+ "asc": false,
1312
+ "nulls": "last"
1313
+ }
1314
+ ],
1315
+ "isUnique": false,
1316
+ "concurrently": false,
1317
+ "method": "btree",
1318
+ "with": {}
1319
+ }
1320
+ },
1321
+ "foreignKeys": {
1322
+ "secret_versions_secret_id_fkey": {
1323
+ "name": "secret_versions_secret_id_fkey",
1324
+ "tableFrom": "secret_versions",
1325
+ "tableTo": "secrets",
1326
+ "columnsFrom": [
1327
+ "secret_id"
1328
+ ],
1329
+ "columnsTo": [
1330
+ "id"
1331
+ ],
1332
+ "onDelete": "restrict",
1333
+ "onUpdate": "no action"
1334
+ }
1335
+ },
1336
+ "compositePrimaryKeys": {},
1337
+ "uniqueConstraints": {
1338
+ "secret_versions_secret_id_version_key": {
1339
+ "name": "secret_versions_secret_id_version_key",
1340
+ "nullsNotDistinct": false,
1341
+ "columns": [
1342
+ "secret_id",
1343
+ "version"
1344
+ ]
1345
+ }
1346
+ },
1347
+ "policies": {},
1348
+ "checkConstraints": {
1349
+ "secret_versions_version_check": {
1350
+ "name": "secret_versions_version_check",
1351
+ "value": "\"secret_versions\".\"version\" > 0"
1352
+ },
1353
+ "secret_versions_iv_check": {
1354
+ "name": "secret_versions_iv_check",
1355
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
1356
+ },
1357
+ "secret_versions_auth_tag_check": {
1358
+ "name": "secret_versions_auth_tag_check",
1359
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
1360
+ }
1361
+ },
1362
+ "isRLSEnabled": false
1363
+ },
1364
+ "public.secrets": {
1365
+ "name": "secrets",
1366
+ "schema": "",
1367
+ "columns": {
1368
+ "id": {
1369
+ "name": "id",
1370
+ "type": "uuid",
1371
+ "primaryKey": true,
1372
+ "notNull": true,
1373
+ "default": "gen_random_uuid()"
1374
+ },
1375
+ "project_id": {
1376
+ "name": "project_id",
1377
+ "type": "uuid",
1378
+ "primaryKey": false,
1379
+ "notNull": true
1380
+ },
1381
+ "environment_id": {
1382
+ "name": "environment_id",
1383
+ "type": "uuid",
1384
+ "primaryKey": false,
1385
+ "notNull": true
1386
+ },
1387
+ "key": {
1388
+ "name": "key",
1389
+ "type": "text",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "created_at": {
1394
+ "name": "created_at",
1395
+ "type": "timestamp with time zone",
1396
+ "primaryKey": false,
1397
+ "notNull": true,
1398
+ "default": "now()"
1399
+ },
1400
+ "updated_at": {
1401
+ "name": "updated_at",
1402
+ "type": "timestamp with time zone",
1403
+ "primaryKey": false,
1404
+ "notNull": true,
1405
+ "default": "now()"
1406
+ },
1407
+ "current_version_id": {
1408
+ "name": "current_version_id",
1409
+ "type": "uuid",
1410
+ "primaryKey": false,
1411
+ "notNull": false
1412
+ },
1413
+ "current_version": {
1414
+ "name": "current_version",
1415
+ "type": "integer",
1416
+ "primaryKey": false,
1417
+ "notNull": true,
1418
+ "default": 0
1419
+ },
1420
+ "archived_at": {
1421
+ "name": "archived_at",
1422
+ "type": "timestamp with time zone",
1423
+ "primaryKey": false,
1424
+ "notNull": false
1425
+ }
1426
+ },
1427
+ "indexes": {
1428
+ "secrets_lookup_idx": {
1429
+ "name": "secrets_lookup_idx",
1430
+ "columns": [
1431
+ {
1432
+ "expression": "project_id",
1433
+ "isExpression": false,
1434
+ "asc": true,
1435
+ "nulls": "last"
1436
+ },
1437
+ {
1438
+ "expression": "environment_id",
1439
+ "isExpression": false,
1440
+ "asc": true,
1441
+ "nulls": "last"
1442
+ },
1443
+ {
1444
+ "expression": "key",
1445
+ "isExpression": false,
1446
+ "asc": true,
1447
+ "nulls": "last"
1448
+ }
1449
+ ],
1450
+ "isUnique": false,
1451
+ "concurrently": false,
1452
+ "method": "btree",
1453
+ "with": {}
1454
+ }
1455
+ },
1456
+ "foreignKeys": {
1457
+ "secrets_current_version_id_secret_versions_id_fk": {
1458
+ "name": "secrets_current_version_id_secret_versions_id_fk",
1459
+ "tableFrom": "secrets",
1460
+ "tableTo": "secret_versions",
1461
+ "columnsFrom": [
1462
+ "current_version_id"
1463
+ ],
1464
+ "columnsTo": [
1465
+ "id"
1466
+ ],
1467
+ "onDelete": "no action",
1468
+ "onUpdate": "no action"
1469
+ },
1470
+ "secrets_project_id_fkey": {
1471
+ "name": "secrets_project_id_fkey",
1472
+ "tableFrom": "secrets",
1473
+ "tableTo": "projects",
1474
+ "columnsFrom": [
1475
+ "project_id"
1476
+ ],
1477
+ "columnsTo": [
1478
+ "id"
1479
+ ],
1480
+ "onDelete": "restrict",
1481
+ "onUpdate": "no action"
1482
+ },
1483
+ "secrets_environment_id_fkey": {
1484
+ "name": "secrets_environment_id_fkey",
1485
+ "tableFrom": "secrets",
1486
+ "tableTo": "environments",
1487
+ "columnsFrom": [
1488
+ "environment_id"
1489
+ ],
1490
+ "columnsTo": [
1491
+ "id"
1492
+ ],
1493
+ "onDelete": "restrict",
1494
+ "onUpdate": "no action"
1495
+ },
1496
+ "secrets_environment_in_project": {
1497
+ "name": "secrets_environment_in_project",
1498
+ "tableFrom": "secrets",
1499
+ "tableTo": "environments",
1500
+ "columnsFrom": [
1501
+ "environment_id",
1502
+ "project_id"
1503
+ ],
1504
+ "columnsTo": [
1505
+ "id",
1506
+ "project_id"
1507
+ ],
1508
+ "onDelete": "no action",
1509
+ "onUpdate": "no action"
1510
+ }
1511
+ },
1512
+ "compositePrimaryKeys": {},
1513
+ "uniqueConstraints": {
1514
+ "secrets_project_id_environment_id_key_key": {
1515
+ "name": "secrets_project_id_environment_id_key_key",
1516
+ "nullsNotDistinct": false,
1517
+ "columns": [
1518
+ "project_id",
1519
+ "environment_id",
1520
+ "key"
1521
+ ]
1522
+ }
1523
+ },
1524
+ "policies": {},
1525
+ "checkConstraints": {
1526
+ "secrets_key_check": {
1527
+ "name": "secrets_key_check",
1528
+ "value": "\"secrets\".\"key\" ~ '^[A-Za-z_][A-Za-z0-9_]{0,127}$'"
1529
+ }
1530
+ },
1531
+ "isRLSEnabled": false
1532
+ },
1533
+ "public.service_bindings": {
1534
+ "name": "service_bindings",
1535
+ "schema": "",
1536
+ "columns": {
1537
+ "id": {
1538
+ "name": "id",
1539
+ "type": "uuid",
1540
+ "primaryKey": true,
1541
+ "notNull": true
1542
+ },
1543
+ "auth_mac": {
1544
+ "name": "auth_mac",
1545
+ "type": "bytea",
1546
+ "primaryKey": false,
1547
+ "notNull": true
1548
+ },
1549
+ "principal": {
1550
+ "name": "principal",
1551
+ "type": "text",
1552
+ "primaryKey": false,
1553
+ "notNull": true
1554
+ },
1555
+ "generation": {
1556
+ "name": "generation",
1557
+ "type": "integer",
1558
+ "primaryKey": false,
1559
+ "notNull": true
1560
+ },
1561
+ "profile": {
1562
+ "name": "profile",
1563
+ "type": "text",
1564
+ "primaryKey": false,
1565
+ "notNull": true
1566
+ },
1567
+ "issuer": {
1568
+ "name": "issuer",
1569
+ "type": "text",
1570
+ "primaryKey": false,
1571
+ "notNull": true
1572
+ },
1573
+ "jwks_uri": {
1574
+ "name": "jwks_uri",
1575
+ "type": "text",
1576
+ "primaryKey": false,
1577
+ "notNull": true
1578
+ },
1579
+ "claims": {
1580
+ "name": "claims",
1581
+ "type": "text",
1582
+ "primaryKey": false,
1583
+ "notNull": true
1584
+ },
1585
+ "label": {
1586
+ "name": "label",
1587
+ "type": "text",
1588
+ "primaryKey": false,
1589
+ "notNull": false
1590
+ },
1591
+ "created_at": {
1592
+ "name": "created_at",
1593
+ "type": "timestamp with time zone",
1594
+ "primaryKey": false,
1595
+ "notNull": true,
1596
+ "default": "now()"
1597
+ },
1598
+ "created_by": {
1599
+ "name": "created_by",
1600
+ "type": "text",
1601
+ "primaryKey": false,
1602
+ "notNull": true
1603
+ },
1604
+ "last_used_at": {
1605
+ "name": "last_used_at",
1606
+ "type": "timestamp with time zone",
1607
+ "primaryKey": false,
1608
+ "notNull": false
1609
+ },
1610
+ "revoked_at": {
1611
+ "name": "revoked_at",
1612
+ "type": "timestamp with time zone",
1613
+ "primaryKey": false,
1614
+ "notNull": false
1615
+ },
1616
+ "revoked_by": {
1617
+ "name": "revoked_by",
1618
+ "type": "text",
1619
+ "primaryKey": false,
1620
+ "notNull": false
1621
+ }
1622
+ },
1623
+ "indexes": {
1624
+ "service_bindings_principal_idx": {
1625
+ "name": "service_bindings_principal_idx",
1626
+ "columns": [
1627
+ {
1628
+ "expression": "principal",
1629
+ "isExpression": false,
1630
+ "asc": true,
1631
+ "nulls": "last"
1632
+ },
1633
+ {
1634
+ "expression": "issuer",
1635
+ "isExpression": false,
1636
+ "asc": true,
1637
+ "nulls": "last"
1638
+ }
1639
+ ],
1640
+ "isUnique": false,
1641
+ "concurrently": false,
1642
+ "method": "btree",
1643
+ "with": {}
1644
+ }
1645
+ },
1646
+ "foreignKeys": {
1647
+ "service_bindings_principal_fkey": {
1648
+ "name": "service_bindings_principal_fkey",
1649
+ "tableFrom": "service_bindings",
1650
+ "tableTo": "vault_members",
1651
+ "columnsFrom": [
1652
+ "principal"
1653
+ ],
1654
+ "columnsTo": [
1655
+ "principal"
1656
+ ],
1657
+ "onDelete": "restrict",
1658
+ "onUpdate": "no action"
1659
+ }
1660
+ },
1661
+ "compositePrimaryKeys": {},
1662
+ "uniqueConstraints": {},
1663
+ "policies": {},
1664
+ "checkConstraints": {
1665
+ "service_bindings_principal_check": {
1666
+ "name": "service_bindings_principal_check",
1667
+ "value": "\"service_bindings\".\"principal\" LIKE 'token:%'"
1668
+ },
1669
+ "service_bindings_auth_mac_check": {
1670
+ "name": "service_bindings_auth_mac_check",
1671
+ "value": "octet_length(\"service_bindings\".\"auth_mac\") = 32"
1672
+ },
1673
+ "service_bindings_claims_check": {
1674
+ "name": "service_bindings_claims_check",
1675
+ "value": "\"service_bindings\".\"claims\"::jsonb IS NOT NULL"
1676
+ }
1677
+ },
1678
+ "isRLSEnabled": false
1679
+ },
1680
+ "public.vault_grants": {
1681
+ "name": "vault_grants",
1682
+ "schema": "",
1683
+ "columns": {
1684
+ "principal": {
1685
+ "name": "principal",
1686
+ "type": "text",
1687
+ "primaryKey": false,
1688
+ "notNull": true
1689
+ },
1690
+ "project_id": {
1691
+ "name": "project_id",
1692
+ "type": "uuid",
1693
+ "primaryKey": false,
1694
+ "notNull": false
1695
+ },
1696
+ "environment_id": {
1697
+ "name": "environment_id",
1698
+ "type": "uuid",
1699
+ "primaryKey": false,
1700
+ "notNull": false
1701
+ },
1702
+ "role": {
1703
+ "name": "role",
1704
+ "type": "text",
1705
+ "primaryKey": false,
1706
+ "notNull": true
1707
+ },
1708
+ "expires_at": {
1709
+ "name": "expires_at",
1710
+ "type": "bigint",
1711
+ "primaryKey": false,
1712
+ "notNull": false
1713
+ },
1714
+ "granted_at": {
1715
+ "name": "granted_at",
1716
+ "type": "bigint",
1717
+ "primaryKey": false,
1718
+ "notNull": true
1719
+ },
1720
+ "granted_by": {
1721
+ "name": "granted_by",
1722
+ "type": "text",
1723
+ "primaryKey": false,
1724
+ "notNull": true
1725
+ }
1726
+ },
1727
+ "indexes": {},
1728
+ "foreignKeys": {
1729
+ "vault_grants_principal_fkey": {
1730
+ "name": "vault_grants_principal_fkey",
1731
+ "tableFrom": "vault_grants",
1732
+ "tableTo": "vault_members",
1733
+ "columnsFrom": [
1734
+ "principal"
1735
+ ],
1736
+ "columnsTo": [
1737
+ "principal"
1738
+ ],
1739
+ "onDelete": "restrict",
1740
+ "onUpdate": "no action"
1741
+ },
1742
+ "vault_grants_project_id_fkey": {
1743
+ "name": "vault_grants_project_id_fkey",
1744
+ "tableFrom": "vault_grants",
1745
+ "tableTo": "projects",
1746
+ "columnsFrom": [
1747
+ "project_id"
1748
+ ],
1749
+ "columnsTo": [
1750
+ "id"
1751
+ ],
1752
+ "onDelete": "restrict",
1753
+ "onUpdate": "no action"
1754
+ },
1755
+ "vault_grants_environment_id_fkey": {
1756
+ "name": "vault_grants_environment_id_fkey",
1757
+ "tableFrom": "vault_grants",
1758
+ "tableTo": "environments",
1759
+ "columnsFrom": [
1760
+ "environment_id"
1761
+ ],
1762
+ "columnsTo": [
1763
+ "id"
1764
+ ],
1765
+ "onDelete": "restrict",
1766
+ "onUpdate": "no action"
1767
+ }
1768
+ },
1769
+ "compositePrimaryKeys": {},
1770
+ "uniqueConstraints": {
1771
+ "vault_grants_on_project": {
1772
+ "name": "vault_grants_on_project",
1773
+ "nullsNotDistinct": false,
1774
+ "columns": [
1775
+ "principal",
1776
+ "project_id"
1777
+ ]
1778
+ },
1779
+ "vault_grants_on_environment": {
1780
+ "name": "vault_grants_on_environment",
1781
+ "nullsNotDistinct": false,
1782
+ "columns": [
1783
+ "principal",
1784
+ "environment_id"
1785
+ ]
1786
+ }
1787
+ },
1788
+ "policies": {},
1789
+ "checkConstraints": {
1790
+ "vault_grants_one_place": {
1791
+ "name": "vault_grants_one_place",
1792
+ "value": "(\"vault_grants\".\"project_id\" IS NULL) <> (\"vault_grants\".\"environment_id\" IS NULL)"
1793
+ },
1794
+ "vault_grants_role_check": {
1795
+ "name": "vault_grants_role_check",
1796
+ "value": "\"vault_grants\".\"role\" IN ('viewer', 'developer', 'maintainer', 'access-manager', 'auditor', 'owner')"
1797
+ },
1798
+ "vault_grants_environment_role_check": {
1799
+ "name": "vault_grants_environment_role_check",
1800
+ "value": "\"vault_grants\".\"environment_id\" IS NULL OR \"vault_grants\".\"role\" IN ('viewer', 'developer', 'auditor')"
1801
+ }
1802
+ },
1803
+ "isRLSEnabled": false
1804
+ },
1805
+ "public.vault_members": {
1806
+ "name": "vault_members",
1807
+ "schema": "",
1808
+ "columns": {
1809
+ "principal": {
1810
+ "name": "principal",
1811
+ "type": "text",
1812
+ "primaryKey": true,
1813
+ "notNull": true
1814
+ },
1815
+ "status": {
1816
+ "name": "status",
1817
+ "type": "text",
1818
+ "primaryKey": false,
1819
+ "notNull": true
1820
+ },
1821
+ "owner": {
1822
+ "name": "owner",
1823
+ "type": "boolean",
1824
+ "primaryKey": false,
1825
+ "notNull": true,
1826
+ "default": false
1827
+ },
1828
+ "generation": {
1829
+ "name": "generation",
1830
+ "type": "integer",
1831
+ "primaryKey": false,
1832
+ "notNull": true,
1833
+ "default": 0
1834
+ },
1835
+ "created_at": {
1836
+ "name": "created_at",
1837
+ "type": "bigint",
1838
+ "primaryKey": false,
1839
+ "notNull": true
1840
+ },
1841
+ "created_by": {
1842
+ "name": "created_by",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": true
1846
+ },
1847
+ "status_changed_at": {
1848
+ "name": "status_changed_at",
1849
+ "type": "bigint",
1850
+ "primaryKey": false,
1851
+ "notNull": true
1852
+ },
1853
+ "status_changed_by": {
1854
+ "name": "status_changed_by",
1855
+ "type": "text",
1856
+ "primaryKey": false,
1857
+ "notNull": true
1858
+ },
1859
+ "access_seq": {
1860
+ "name": "access_seq",
1861
+ "type": "bigint",
1862
+ "primaryKey": false,
1863
+ "notNull": true
1864
+ },
1865
+ "mac": {
1866
+ "name": "mac",
1867
+ "type": "bytea",
1868
+ "primaryKey": false,
1869
+ "notNull": true
1870
+ }
1871
+ },
1872
+ "indexes": {},
1873
+ "foreignKeys": {},
1874
+ "compositePrimaryKeys": {},
1875
+ "uniqueConstraints": {},
1876
+ "policies": {},
1877
+ "checkConstraints": {
1878
+ "vault_members_mac_check": {
1879
+ "name": "vault_members_mac_check",
1880
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
1881
+ },
1882
+ "vault_members_principal_check": {
1883
+ "name": "vault_members_principal_check",
1884
+ "value": "\"vault_members\".\"principal\" ~ '^(user|token|sync):[^[:space:]:][^[:space:]]*$'"
1885
+ },
1886
+ "vault_members_user_lowercase": {
1887
+ "name": "vault_members_user_lowercase",
1888
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
1889
+ },
1890
+ "vault_members_status_check": {
1891
+ "name": "vault_members_status_check",
1892
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
1893
+ },
1894
+ "vault_members_owner_check": {
1895
+ "name": "vault_members_owner_check",
1896
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
1897
+ },
1898
+ "vault_members_generation_check": {
1899
+ "name": "vault_members_generation_check",
1900
+ "value": "\"vault_members\".\"generation\" >= 0"
1901
+ }
1902
+ },
1903
+ "isRLSEnabled": false
1904
+ }
1905
+ },
1906
+ "enums": {},
1907
+ "schemas": {},
1908
+ "sequences": {},
1909
+ "roles": {},
1910
+ "policies": {},
1911
+ "views": {},
1912
+ "_meta": {
1913
+ "columns": {},
1914
+ "schemas": {},
1915
+ "tables": {}
1916
+ }
1917
+ }