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