@coffre/db 0.3.0 → 0.4.1

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