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