@coffre/db 0.1.11 → 0.1.12

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 (33) hide show
  1. package/dist/connect.d.ts +1 -1
  2. package/dist/{database-BhLco7OA.d.ts → database-CNMfHZwF.d.ts} +1 -1
  3. package/dist/dialect.d.ts +1 -1
  4. package/dist/hyperdrive.d.ts +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/log.d.ts +1 -1
  7. package/dist/migrations/postgres/0001_remove_syncs.sql +13 -0
  8. package/dist/migrations/postgres/meta/0001_snapshot.json +1707 -0
  9. package/dist/migrations/postgres/meta/_journal.json +7 -0
  10. package/dist/migrations/sqlite/0001_remove_syncs.sql +13 -0
  11. package/dist/migrations/sqlite/meta/0001_snapshot.json +1575 -0
  12. package/dist/migrations/sqlite/meta/_journal.json +7 -0
  13. package/dist/portable.d.ts +2 -2
  14. package/dist/{relations-DqgxtlKu.js → relations-BfR3JjT1.js} +2 -22
  15. package/dist/{schema-Cd4WOnB5.d.ts → schema-AmvM6w0D.d.ts} +2 -362
  16. package/dist/schema-sqlite.d.ts +1 -369
  17. package/dist/schema-sqlite.js +5 -59
  18. package/dist/schema-version.d.ts +5 -3
  19. package/dist/schema-version.js +4 -2
  20. package/dist/schema.d.ts +2 -2
  21. package/dist/schema.js +5 -79
  22. package/package.json +2 -2
  23. package/src/baseline.ts +11 -19
  24. package/src/migrations/postgres/0001_remove_syncs.sql +13 -0
  25. package/src/migrations/postgres/meta/0001_snapshot.json +1707 -0
  26. package/src/migrations/postgres/meta/_journal.json +7 -0
  27. package/src/migrations/sqlite/0001_remove_syncs.sql +13 -0
  28. package/src/migrations/sqlite/meta/0001_snapshot.json +1575 -0
  29. package/src/migrations/sqlite/meta/_journal.json +7 -0
  30. package/src/relations.ts +1 -14
  31. package/src/schema-version.ts +4 -2
  32. package/src/schema.sqlite.ts +1 -65
  33. package/src/schema.ts +1 -81
@@ -0,0 +1,1575 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "b24525b7-a286-4409-93b5-ec8b99033dac",
5
+ "prevId": "6de9e286-f9d7-4c08-ac7d-e963092320c1",
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
+ },
276
+ "foreignKeys": {
277
+ "audit_log_project_id_fkey": {
278
+ "name": "audit_log_project_id_fkey",
279
+ "tableFrom": "audit_log",
280
+ "tableTo": "projects",
281
+ "columnsFrom": [
282
+ "project_id"
283
+ ],
284
+ "columnsTo": [
285
+ "id"
286
+ ],
287
+ "onDelete": "restrict",
288
+ "onUpdate": "no action"
289
+ },
290
+ "audit_log_environment_id_fkey": {
291
+ "name": "audit_log_environment_id_fkey",
292
+ "tableFrom": "audit_log",
293
+ "tableTo": "environments",
294
+ "columnsFrom": [
295
+ "environment_id"
296
+ ],
297
+ "columnsTo": [
298
+ "id"
299
+ ],
300
+ "onDelete": "restrict",
301
+ "onUpdate": "no action"
302
+ },
303
+ "audit_log_secret_id_fkey": {
304
+ "name": "audit_log_secret_id_fkey",
305
+ "tableFrom": "audit_log",
306
+ "tableTo": "secrets",
307
+ "columnsFrom": [
308
+ "secret_id"
309
+ ],
310
+ "columnsTo": [
311
+ "id"
312
+ ],
313
+ "onDelete": "restrict",
314
+ "onUpdate": "no action"
315
+ },
316
+ "audit_log_secret_version_id_fkey": {
317
+ "name": "audit_log_secret_version_id_fkey",
318
+ "tableFrom": "audit_log",
319
+ "tableTo": "secret_versions",
320
+ "columnsFrom": [
321
+ "secret_version_id"
322
+ ],
323
+ "columnsTo": [
324
+ "id"
325
+ ],
326
+ "onDelete": "restrict",
327
+ "onUpdate": "no action"
328
+ },
329
+ "audit_log_related_seq_fkey": {
330
+ "name": "audit_log_related_seq_fkey",
331
+ "tableFrom": "audit_log",
332
+ "tableTo": "audit_log",
333
+ "columnsFrom": [
334
+ "related_seq"
335
+ ],
336
+ "columnsTo": [
337
+ "seq"
338
+ ],
339
+ "onDelete": "restrict",
340
+ "onUpdate": "no action"
341
+ }
342
+ },
343
+ "compositePrimaryKeys": {},
344
+ "uniqueConstraints": {},
345
+ "checkConstraints": {
346
+ "audit_log_author_check": {
347
+ "name": "audit_log_author_check",
348
+ "value": "\"audit_log\".\"author\" IN ('app', 'vault')"
349
+ },
350
+ "audit_log_actor_check": {
351
+ "name": "audit_log_actor_check",
352
+ "value": "\"audit_log\".\"actor\" GLOB 'user:?*' OR \"audit_log\".\"actor\" GLOB 'token:?*' OR \"audit_log\".\"actor\" GLOB 'sync:?*' OR \"audit_log\".\"actor\" GLOB 'system:?*'"
353
+ },
354
+ "audit_log_decision_check": {
355
+ "name": "audit_log_decision_check",
356
+ "value": "\"audit_log\".\"decision\" IN ('allow', 'deny')"
357
+ },
358
+ "audit_log_metadata_check": {
359
+ "name": "audit_log_metadata_check",
360
+ "value": "json_valid(\"audit_log\".\"metadata\")"
361
+ },
362
+ "audit_log_prev_hash_check": {
363
+ "name": "audit_log_prev_hash_check",
364
+ "value": "octet_length(\"audit_log\".\"prev_hash\") = 32"
365
+ },
366
+ "audit_log_mac_check": {
367
+ "name": "audit_log_mac_check",
368
+ "value": "octet_length(\"audit_log\".\"mac\") = 32"
369
+ },
370
+ "audit_log_hash_check": {
371
+ "name": "audit_log_hash_check",
372
+ "value": "octet_length(\"audit_log\".\"hash\") = 32"
373
+ }
374
+ }
375
+ },
376
+ "credentials": {
377
+ "name": "credentials",
378
+ "columns": {
379
+ "id": {
380
+ "name": "id",
381
+ "type": "text",
382
+ "primaryKey": true,
383
+ "notNull": true,
384
+ "autoincrement": false
385
+ },
386
+ "kind": {
387
+ "name": "kind",
388
+ "type": "text",
389
+ "primaryKey": false,
390
+ "notNull": true,
391
+ "autoincrement": false
392
+ },
393
+ "auth_mac": {
394
+ "name": "auth_mac",
395
+ "type": "blob",
396
+ "primaryKey": false,
397
+ "notNull": true,
398
+ "autoincrement": false
399
+ },
400
+ "token_hash": {
401
+ "name": "token_hash",
402
+ "type": "blob",
403
+ "primaryKey": false,
404
+ "notNull": true,
405
+ "autoincrement": false
406
+ },
407
+ "token_hint": {
408
+ "name": "token_hint",
409
+ "type": "text",
410
+ "primaryKey": false,
411
+ "notNull": true,
412
+ "autoincrement": false
413
+ },
414
+ "generation": {
415
+ "name": "generation",
416
+ "type": "integer",
417
+ "primaryKey": false,
418
+ "notNull": true,
419
+ "autoincrement": false
420
+ },
421
+ "principal": {
422
+ "name": "principal",
423
+ "type": "text",
424
+ "primaryKey": false,
425
+ "notNull": true,
426
+ "autoincrement": false
427
+ },
428
+ "identity_id": {
429
+ "name": "identity_id",
430
+ "type": "text",
431
+ "primaryKey": false,
432
+ "notNull": false,
433
+ "autoincrement": false
434
+ },
435
+ "label": {
436
+ "name": "label",
437
+ "type": "text",
438
+ "primaryKey": false,
439
+ "notNull": false,
440
+ "autoincrement": false
441
+ },
442
+ "created_at": {
443
+ "name": "created_at",
444
+ "type": "integer",
445
+ "primaryKey": false,
446
+ "notNull": true,
447
+ "autoincrement": false,
448
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
449
+ },
450
+ "created_by": {
451
+ "name": "created_by",
452
+ "type": "text",
453
+ "primaryKey": false,
454
+ "notNull": true,
455
+ "autoincrement": false
456
+ },
457
+ "expires_at": {
458
+ "name": "expires_at",
459
+ "type": "integer",
460
+ "primaryKey": false,
461
+ "notNull": true,
462
+ "autoincrement": false
463
+ },
464
+ "last_used_at": {
465
+ "name": "last_used_at",
466
+ "type": "integer",
467
+ "primaryKey": false,
468
+ "notNull": false,
469
+ "autoincrement": false
470
+ },
471
+ "last_used_ip": {
472
+ "name": "last_used_ip",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": false,
476
+ "autoincrement": false
477
+ },
478
+ "revoked_at": {
479
+ "name": "revoked_at",
480
+ "type": "integer",
481
+ "primaryKey": false,
482
+ "notNull": false,
483
+ "autoincrement": false
484
+ },
485
+ "revoked_by": {
486
+ "name": "revoked_by",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": false,
490
+ "autoincrement": false
491
+ }
492
+ },
493
+ "indexes": {
494
+ "credentials_principal_idx": {
495
+ "name": "credentials_principal_idx",
496
+ "columns": [
497
+ "principal",
498
+ "generation"
499
+ ],
500
+ "isUnique": false
501
+ },
502
+ "credentials_token_hash_key": {
503
+ "name": "credentials_token_hash_key",
504
+ "columns": [
505
+ "token_hash"
506
+ ],
507
+ "isUnique": true
508
+ }
509
+ },
510
+ "foreignKeys": {
511
+ "credentials_principal_fkey": {
512
+ "name": "credentials_principal_fkey",
513
+ "tableFrom": "credentials",
514
+ "tableTo": "vault_members",
515
+ "columnsFrom": [
516
+ "principal"
517
+ ],
518
+ "columnsTo": [
519
+ "principal"
520
+ ],
521
+ "onDelete": "restrict",
522
+ "onUpdate": "no action"
523
+ },
524
+ "credentials_identity_id_fkey": {
525
+ "name": "credentials_identity_id_fkey",
526
+ "tableFrom": "credentials",
527
+ "tableTo": "identities",
528
+ "columnsFrom": [
529
+ "identity_id",
530
+ "principal",
531
+ "generation"
532
+ ],
533
+ "columnsTo": [
534
+ "id",
535
+ "principal",
536
+ "generation"
537
+ ],
538
+ "onDelete": "restrict",
539
+ "onUpdate": "no action"
540
+ }
541
+ },
542
+ "compositePrimaryKeys": {},
543
+ "uniqueConstraints": {},
544
+ "checkConstraints": {
545
+ "credentials_kind_check": {
546
+ "name": "credentials_kind_check",
547
+ "value": "\"credentials\".\"kind\" IN ('browser', 'cli', 'service')"
548
+ },
549
+ "credentials_principal_check": {
550
+ "name": "credentials_principal_check",
551
+ "value": "\"credentials\".\"principal\" LIKE 'user:%' OR \"credentials\".\"principal\" LIKE 'token:%'"
552
+ },
553
+ "credentials_kind_matches_principal": {
554
+ "name": "credentials_kind_matches_principal",
555
+ "value": "(\"credentials\".\"kind\" = 'service') = (\"credentials\".\"principal\" LIKE 'token:%')"
556
+ },
557
+ "credentials_token_hash_check": {
558
+ "name": "credentials_token_hash_check",
559
+ "value": "octet_length(\"credentials\".\"token_hash\") = 32"
560
+ },
561
+ "credentials_auth_mac_check": {
562
+ "name": "credentials_auth_mac_check",
563
+ "value": "octet_length(\"credentials\".\"auth_mac\") = 32"
564
+ }
565
+ }
566
+ },
567
+ "device_authorizations": {
568
+ "name": "device_authorizations",
569
+ "columns": {
570
+ "id": {
571
+ "name": "id",
572
+ "type": "text",
573
+ "primaryKey": true,
574
+ "notNull": true,
575
+ "autoincrement": false
576
+ },
577
+ "device_code_hash": {
578
+ "name": "device_code_hash",
579
+ "type": "blob",
580
+ "primaryKey": false,
581
+ "notNull": true,
582
+ "autoincrement": false
583
+ },
584
+ "auth_mac": {
585
+ "name": "auth_mac",
586
+ "type": "blob",
587
+ "primaryKey": false,
588
+ "notNull": true,
589
+ "autoincrement": false
590
+ },
591
+ "user_code": {
592
+ "name": "user_code",
593
+ "type": "text",
594
+ "primaryKey": false,
595
+ "notNull": true,
596
+ "autoincrement": false
597
+ },
598
+ "client_label": {
599
+ "name": "client_label",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": false,
603
+ "autoincrement": false
604
+ },
605
+ "client_ip": {
606
+ "name": "client_ip",
607
+ "type": "text",
608
+ "primaryKey": false,
609
+ "notNull": false,
610
+ "autoincrement": false
611
+ },
612
+ "created_at": {
613
+ "name": "created_at",
614
+ "type": "integer",
615
+ "primaryKey": false,
616
+ "notNull": true,
617
+ "autoincrement": false,
618
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
619
+ },
620
+ "expires_at": {
621
+ "name": "expires_at",
622
+ "type": "integer",
623
+ "primaryKey": false,
624
+ "notNull": true,
625
+ "autoincrement": false
626
+ },
627
+ "decided_at": {
628
+ "name": "decided_at",
629
+ "type": "integer",
630
+ "primaryKey": false,
631
+ "notNull": false,
632
+ "autoincrement": false
633
+ },
634
+ "decision": {
635
+ "name": "decision",
636
+ "type": "text",
637
+ "primaryKey": false,
638
+ "notNull": false,
639
+ "autoincrement": false
640
+ },
641
+ "generation": {
642
+ "name": "generation",
643
+ "type": "integer",
644
+ "primaryKey": false,
645
+ "notNull": true,
646
+ "autoincrement": false,
647
+ "default": 0
648
+ },
649
+ "principal": {
650
+ "name": "principal",
651
+ "type": "text",
652
+ "primaryKey": false,
653
+ "notNull": false,
654
+ "autoincrement": false
655
+ },
656
+ "consumed_at": {
657
+ "name": "consumed_at",
658
+ "type": "integer",
659
+ "primaryKey": false,
660
+ "notNull": false,
661
+ "autoincrement": false
662
+ }
663
+ },
664
+ "indexes": {
665
+ "device_authorizations_device_code_hash_key": {
666
+ "name": "device_authorizations_device_code_hash_key",
667
+ "columns": [
668
+ "device_code_hash"
669
+ ],
670
+ "isUnique": true
671
+ },
672
+ "device_authorizations_user_code_key": {
673
+ "name": "device_authorizations_user_code_key",
674
+ "columns": [
675
+ "user_code"
676
+ ],
677
+ "isUnique": true
678
+ }
679
+ },
680
+ "foreignKeys": {
681
+ "device_authorizations_principal_fkey": {
682
+ "name": "device_authorizations_principal_fkey",
683
+ "tableFrom": "device_authorizations",
684
+ "tableTo": "vault_members",
685
+ "columnsFrom": [
686
+ "principal"
687
+ ],
688
+ "columnsTo": [
689
+ "principal"
690
+ ],
691
+ "onDelete": "restrict",
692
+ "onUpdate": "no action"
693
+ }
694
+ },
695
+ "compositePrimaryKeys": {},
696
+ "uniqueConstraints": {},
697
+ "checkConstraints": {
698
+ "device_authorizations_auth_mac_check": {
699
+ "name": "device_authorizations_auth_mac_check",
700
+ "value": "octet_length(\"device_authorizations\".\"auth_mac\") = 32"
701
+ },
702
+ "device_authorizations_decision_check": {
703
+ "name": "device_authorizations_decision_check",
704
+ "value": "\"device_authorizations\".\"decision\" IS NULL OR \"device_authorizations\".\"decision\" IN ('approved', 'denied')"
705
+ },
706
+ "device_authorizations_approval_names_principal": {
707
+ "name": "device_authorizations_approval_names_principal",
708
+ "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 ))"
709
+ }
710
+ }
711
+ },
712
+ "environments": {
713
+ "name": "environments",
714
+ "columns": {
715
+ "id": {
716
+ "name": "id",
717
+ "type": "text",
718
+ "primaryKey": true,
719
+ "notNull": true,
720
+ "autoincrement": false
721
+ },
722
+ "project_id": {
723
+ "name": "project_id",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": true,
727
+ "autoincrement": false
728
+ },
729
+ "slug": {
730
+ "name": "slug",
731
+ "type": "text",
732
+ "primaryKey": false,
733
+ "notNull": true,
734
+ "autoincrement": false
735
+ },
736
+ "name": {
737
+ "name": "name",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "autoincrement": false
742
+ },
743
+ "created_at": {
744
+ "name": "created_at",
745
+ "type": "integer",
746
+ "primaryKey": false,
747
+ "notNull": true,
748
+ "autoincrement": false,
749
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
750
+ },
751
+ "archived_at": {
752
+ "name": "archived_at",
753
+ "type": "integer",
754
+ "primaryKey": false,
755
+ "notNull": false,
756
+ "autoincrement": false
757
+ }
758
+ },
759
+ "indexes": {
760
+ "environments_project_id_slug_key": {
761
+ "name": "environments_project_id_slug_key",
762
+ "columns": [
763
+ "project_id",
764
+ "slug"
765
+ ],
766
+ "isUnique": true
767
+ },
768
+ "environments_project_scoped": {
769
+ "name": "environments_project_scoped",
770
+ "columns": [
771
+ "id",
772
+ "project_id"
773
+ ],
774
+ "isUnique": true
775
+ }
776
+ },
777
+ "foreignKeys": {
778
+ "environments_project_id_fkey": {
779
+ "name": "environments_project_id_fkey",
780
+ "tableFrom": "environments",
781
+ "tableTo": "projects",
782
+ "columnsFrom": [
783
+ "project_id"
784
+ ],
785
+ "columnsTo": [
786
+ "id"
787
+ ],
788
+ "onDelete": "restrict",
789
+ "onUpdate": "no action"
790
+ }
791
+ },
792
+ "compositePrimaryKeys": {},
793
+ "uniqueConstraints": {},
794
+ "checkConstraints": {
795
+ "environments_slug_check": {
796
+ "name": "environments_slug_check",
797
+ "value": "length(\"environments\".\"slug\") BETWEEN 1 AND 63 AND \"environments\".\"slug\" GLOB '[a-z0-9]*' AND \"environments\".\"slug\" NOT GLOB '*[^a-z0-9-]*'"
798
+ }
799
+ }
800
+ },
801
+ "identities": {
802
+ "name": "identities",
803
+ "columns": {
804
+ "id": {
805
+ "name": "id",
806
+ "type": "text",
807
+ "primaryKey": true,
808
+ "notNull": true,
809
+ "autoincrement": false
810
+ },
811
+ "provider": {
812
+ "name": "provider",
813
+ "type": "text",
814
+ "primaryKey": false,
815
+ "notNull": true,
816
+ "autoincrement": false
817
+ },
818
+ "auth_mac": {
819
+ "name": "auth_mac",
820
+ "type": "blob",
821
+ "primaryKey": false,
822
+ "notNull": true,
823
+ "autoincrement": false
824
+ },
825
+ "subject": {
826
+ "name": "subject",
827
+ "type": "text",
828
+ "primaryKey": false,
829
+ "notNull": true,
830
+ "autoincrement": false
831
+ },
832
+ "issuer_hash": {
833
+ "name": "issuer_hash",
834
+ "type": "text",
835
+ "primaryKey": false,
836
+ "notNull": true,
837
+ "autoincrement": false
838
+ },
839
+ "generation": {
840
+ "name": "generation",
841
+ "type": "integer",
842
+ "primaryKey": false,
843
+ "notNull": true,
844
+ "autoincrement": false
845
+ },
846
+ "principal": {
847
+ "name": "principal",
848
+ "type": "text",
849
+ "primaryKey": false,
850
+ "notNull": true,
851
+ "autoincrement": false
852
+ },
853
+ "email": {
854
+ "name": "email",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": false,
858
+ "autoincrement": false
859
+ },
860
+ "created_at": {
861
+ "name": "created_at",
862
+ "type": "integer",
863
+ "primaryKey": false,
864
+ "notNull": true,
865
+ "autoincrement": false,
866
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
867
+ },
868
+ "created_by": {
869
+ "name": "created_by",
870
+ "type": "text",
871
+ "primaryKey": false,
872
+ "notNull": true,
873
+ "autoincrement": false
874
+ },
875
+ "last_sign_in_at": {
876
+ "name": "last_sign_in_at",
877
+ "type": "integer",
878
+ "primaryKey": false,
879
+ "notNull": false,
880
+ "autoincrement": false
881
+ },
882
+ "revoked_at": {
883
+ "name": "revoked_at",
884
+ "type": "integer",
885
+ "primaryKey": false,
886
+ "notNull": false,
887
+ "autoincrement": false
888
+ },
889
+ "revoked_by": {
890
+ "name": "revoked_by",
891
+ "type": "text",
892
+ "primaryKey": false,
893
+ "notNull": false,
894
+ "autoincrement": false
895
+ },
896
+ "active_subject": {
897
+ "name": "active_subject",
898
+ "type": "text",
899
+ "primaryKey": false,
900
+ "notNull": false,
901
+ "autoincrement": false,
902
+ "generated": {
903
+ "as": "(CASE WHEN revoked_at IS NULL THEN subject END)",
904
+ "type": "stored"
905
+ }
906
+ }
907
+ },
908
+ "indexes": {
909
+ "identities_active_subject": {
910
+ "name": "identities_active_subject",
911
+ "columns": [
912
+ "provider",
913
+ "issuer_hash",
914
+ "active_subject"
915
+ ],
916
+ "isUnique": true
917
+ },
918
+ "identities_principal_idx": {
919
+ "name": "identities_principal_idx",
920
+ "columns": [
921
+ "principal",
922
+ "generation"
923
+ ],
924
+ "isUnique": false
925
+ },
926
+ "identities_member_generation_key": {
927
+ "name": "identities_member_generation_key",
928
+ "columns": [
929
+ "id",
930
+ "principal",
931
+ "generation"
932
+ ],
933
+ "isUnique": true
934
+ }
935
+ },
936
+ "foreignKeys": {
937
+ "identities_principal_fkey": {
938
+ "name": "identities_principal_fkey",
939
+ "tableFrom": "identities",
940
+ "tableTo": "vault_members",
941
+ "columnsFrom": [
942
+ "principal"
943
+ ],
944
+ "columnsTo": [
945
+ "principal"
946
+ ],
947
+ "onDelete": "restrict",
948
+ "onUpdate": "no action"
949
+ }
950
+ },
951
+ "compositePrimaryKeys": {},
952
+ "uniqueConstraints": {},
953
+ "checkConstraints": {
954
+ "identities_principal_check": {
955
+ "name": "identities_principal_check",
956
+ "value": "\"identities\".\"principal\" LIKE 'user:%'"
957
+ },
958
+ "identities_provider_check": {
959
+ "name": "identities_provider_check",
960
+ "value": "length(\"identities\".\"provider\") BETWEEN 1 AND 32 AND \"identities\".\"provider\" GLOB '[a-z0-9]*' AND \"identities\".\"provider\" NOT GLOB '*[^a-z0-9-]*'"
961
+ },
962
+ "identities_auth_mac_check": {
963
+ "name": "identities_auth_mac_check",
964
+ "value": "octet_length(\"identities\".\"auth_mac\") = 32"
965
+ }
966
+ }
967
+ },
968
+ "projects": {
969
+ "name": "projects",
970
+ "columns": {
971
+ "id": {
972
+ "name": "id",
973
+ "type": "text",
974
+ "primaryKey": true,
975
+ "notNull": true,
976
+ "autoincrement": false
977
+ },
978
+ "slug": {
979
+ "name": "slug",
980
+ "type": "text",
981
+ "primaryKey": false,
982
+ "notNull": true,
983
+ "autoincrement": false
984
+ },
985
+ "name": {
986
+ "name": "name",
987
+ "type": "text",
988
+ "primaryKey": false,
989
+ "notNull": true,
990
+ "autoincrement": false
991
+ },
992
+ "created_at": {
993
+ "name": "created_at",
994
+ "type": "integer",
995
+ "primaryKey": false,
996
+ "notNull": true,
997
+ "autoincrement": false,
998
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
999
+ },
1000
+ "archived_at": {
1001
+ "name": "archived_at",
1002
+ "type": "integer",
1003
+ "primaryKey": false,
1004
+ "notNull": false,
1005
+ "autoincrement": false
1006
+ }
1007
+ },
1008
+ "indexes": {
1009
+ "projects_slug_key": {
1010
+ "name": "projects_slug_key",
1011
+ "columns": [
1012
+ "slug"
1013
+ ],
1014
+ "isUnique": true
1015
+ }
1016
+ },
1017
+ "foreignKeys": {},
1018
+ "compositePrimaryKeys": {},
1019
+ "uniqueConstraints": {},
1020
+ "checkConstraints": {
1021
+ "projects_slug_check": {
1022
+ "name": "projects_slug_check",
1023
+ "value": "length(\"projects\".\"slug\") BETWEEN 1 AND 63 AND \"projects\".\"slug\" GLOB '[a-z0-9]*' AND \"projects\".\"slug\" NOT GLOB '*[^a-z0-9-]*'"
1024
+ }
1025
+ }
1026
+ },
1027
+ "secret_versions": {
1028
+ "name": "secret_versions",
1029
+ "columns": {
1030
+ "id": {
1031
+ "name": "id",
1032
+ "type": "text",
1033
+ "primaryKey": true,
1034
+ "notNull": true,
1035
+ "autoincrement": false
1036
+ },
1037
+ "secret_id": {
1038
+ "name": "secret_id",
1039
+ "type": "text",
1040
+ "primaryKey": false,
1041
+ "notNull": true,
1042
+ "autoincrement": false
1043
+ },
1044
+ "version": {
1045
+ "name": "version",
1046
+ "type": "integer",
1047
+ "primaryKey": false,
1048
+ "notNull": true,
1049
+ "autoincrement": false
1050
+ },
1051
+ "envelope_version": {
1052
+ "name": "envelope_version",
1053
+ "type": "integer",
1054
+ "primaryKey": false,
1055
+ "notNull": true,
1056
+ "autoincrement": false
1057
+ },
1058
+ "ciphertext": {
1059
+ "name": "ciphertext",
1060
+ "type": "blob",
1061
+ "primaryKey": false,
1062
+ "notNull": true,
1063
+ "autoincrement": false
1064
+ },
1065
+ "iv": {
1066
+ "name": "iv",
1067
+ "type": "blob",
1068
+ "primaryKey": false,
1069
+ "notNull": true,
1070
+ "autoincrement": false
1071
+ },
1072
+ "auth_tag": {
1073
+ "name": "auth_tag",
1074
+ "type": "blob",
1075
+ "primaryKey": false,
1076
+ "notNull": true,
1077
+ "autoincrement": false
1078
+ },
1079
+ "wrapped_dek": {
1080
+ "name": "wrapped_dek",
1081
+ "type": "blob",
1082
+ "primaryKey": false,
1083
+ "notNull": true,
1084
+ "autoincrement": false
1085
+ },
1086
+ "kek_provider": {
1087
+ "name": "kek_provider",
1088
+ "type": "text",
1089
+ "primaryKey": false,
1090
+ "notNull": true,
1091
+ "autoincrement": false
1092
+ },
1093
+ "kek_id": {
1094
+ "name": "kek_id",
1095
+ "type": "text",
1096
+ "primaryKey": false,
1097
+ "notNull": true,
1098
+ "autoincrement": false
1099
+ },
1100
+ "kek_version": {
1101
+ "name": "kek_version",
1102
+ "type": "text",
1103
+ "primaryKey": false,
1104
+ "notNull": true,
1105
+ "autoincrement": false
1106
+ },
1107
+ "created_at": {
1108
+ "name": "created_at",
1109
+ "type": "integer",
1110
+ "primaryKey": false,
1111
+ "notNull": true,
1112
+ "autoincrement": false,
1113
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1114
+ },
1115
+ "created_by": {
1116
+ "name": "created_by",
1117
+ "type": "text",
1118
+ "primaryKey": false,
1119
+ "notNull": true,
1120
+ "autoincrement": false
1121
+ }
1122
+ },
1123
+ "indexes": {
1124
+ "secret_versions_secret_idx": {
1125
+ "name": "secret_versions_secret_idx",
1126
+ "columns": [
1127
+ "secret_id",
1128
+ "version"
1129
+ ],
1130
+ "isUnique": false
1131
+ },
1132
+ "secret_versions_secret_id_version_key": {
1133
+ "name": "secret_versions_secret_id_version_key",
1134
+ "columns": [
1135
+ "secret_id",
1136
+ "version"
1137
+ ],
1138
+ "isUnique": true
1139
+ }
1140
+ },
1141
+ "foreignKeys": {
1142
+ "secret_versions_secret_id_fkey": {
1143
+ "name": "secret_versions_secret_id_fkey",
1144
+ "tableFrom": "secret_versions",
1145
+ "tableTo": "secrets",
1146
+ "columnsFrom": [
1147
+ "secret_id"
1148
+ ],
1149
+ "columnsTo": [
1150
+ "id"
1151
+ ],
1152
+ "onDelete": "restrict",
1153
+ "onUpdate": "no action"
1154
+ }
1155
+ },
1156
+ "compositePrimaryKeys": {},
1157
+ "uniqueConstraints": {},
1158
+ "checkConstraints": {
1159
+ "secret_versions_version_check": {
1160
+ "name": "secret_versions_version_check",
1161
+ "value": "\"secret_versions\".\"version\" > 0"
1162
+ },
1163
+ "secret_versions_iv_check": {
1164
+ "name": "secret_versions_iv_check",
1165
+ "value": "octet_length(\"secret_versions\".\"iv\") = 12"
1166
+ },
1167
+ "secret_versions_auth_tag_check": {
1168
+ "name": "secret_versions_auth_tag_check",
1169
+ "value": "octet_length(\"secret_versions\".\"auth_tag\") = 16"
1170
+ }
1171
+ }
1172
+ },
1173
+ "secrets": {
1174
+ "name": "secrets",
1175
+ "columns": {
1176
+ "id": {
1177
+ "name": "id",
1178
+ "type": "text",
1179
+ "primaryKey": true,
1180
+ "notNull": true,
1181
+ "autoincrement": false
1182
+ },
1183
+ "project_id": {
1184
+ "name": "project_id",
1185
+ "type": "text",
1186
+ "primaryKey": false,
1187
+ "notNull": true,
1188
+ "autoincrement": false
1189
+ },
1190
+ "environment_id": {
1191
+ "name": "environment_id",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": true,
1195
+ "autoincrement": false
1196
+ },
1197
+ "key": {
1198
+ "name": "key",
1199
+ "type": "text",
1200
+ "primaryKey": false,
1201
+ "notNull": true,
1202
+ "autoincrement": false
1203
+ },
1204
+ "created_at": {
1205
+ "name": "created_at",
1206
+ "type": "integer",
1207
+ "primaryKey": false,
1208
+ "notNull": true,
1209
+ "autoincrement": false,
1210
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1211
+ },
1212
+ "updated_at": {
1213
+ "name": "updated_at",
1214
+ "type": "integer",
1215
+ "primaryKey": false,
1216
+ "notNull": true,
1217
+ "autoincrement": false,
1218
+ "default": "(CAST(unixepoch('subsec') * 1000 AS INTEGER))"
1219
+ },
1220
+ "current_version_id": {
1221
+ "name": "current_version_id",
1222
+ "type": "text",
1223
+ "primaryKey": false,
1224
+ "notNull": false,
1225
+ "autoincrement": false
1226
+ },
1227
+ "current_version": {
1228
+ "name": "current_version",
1229
+ "type": "integer",
1230
+ "primaryKey": false,
1231
+ "notNull": true,
1232
+ "autoincrement": false,
1233
+ "default": 0
1234
+ },
1235
+ "archived_at": {
1236
+ "name": "archived_at",
1237
+ "type": "integer",
1238
+ "primaryKey": false,
1239
+ "notNull": false,
1240
+ "autoincrement": false
1241
+ }
1242
+ },
1243
+ "indexes": {
1244
+ "secrets_lookup_idx": {
1245
+ "name": "secrets_lookup_idx",
1246
+ "columns": [
1247
+ "project_id",
1248
+ "environment_id",
1249
+ "key"
1250
+ ],
1251
+ "isUnique": false
1252
+ },
1253
+ "secrets_project_id_environment_id_key_key": {
1254
+ "name": "secrets_project_id_environment_id_key_key",
1255
+ "columns": [
1256
+ "project_id",
1257
+ "environment_id",
1258
+ "key"
1259
+ ],
1260
+ "isUnique": true
1261
+ }
1262
+ },
1263
+ "foreignKeys": {
1264
+ "secrets_current_version_id_secret_versions_id_fk": {
1265
+ "name": "secrets_current_version_id_secret_versions_id_fk",
1266
+ "tableFrom": "secrets",
1267
+ "tableTo": "secret_versions",
1268
+ "columnsFrom": [
1269
+ "current_version_id"
1270
+ ],
1271
+ "columnsTo": [
1272
+ "id"
1273
+ ],
1274
+ "onDelete": "no action",
1275
+ "onUpdate": "no action"
1276
+ },
1277
+ "secrets_project_id_fkey": {
1278
+ "name": "secrets_project_id_fkey",
1279
+ "tableFrom": "secrets",
1280
+ "tableTo": "projects",
1281
+ "columnsFrom": [
1282
+ "project_id"
1283
+ ],
1284
+ "columnsTo": [
1285
+ "id"
1286
+ ],
1287
+ "onDelete": "restrict",
1288
+ "onUpdate": "no action"
1289
+ },
1290
+ "secrets_environment_id_fkey": {
1291
+ "name": "secrets_environment_id_fkey",
1292
+ "tableFrom": "secrets",
1293
+ "tableTo": "environments",
1294
+ "columnsFrom": [
1295
+ "environment_id"
1296
+ ],
1297
+ "columnsTo": [
1298
+ "id"
1299
+ ],
1300
+ "onDelete": "restrict",
1301
+ "onUpdate": "no action"
1302
+ },
1303
+ "secrets_environment_in_project": {
1304
+ "name": "secrets_environment_in_project",
1305
+ "tableFrom": "secrets",
1306
+ "tableTo": "environments",
1307
+ "columnsFrom": [
1308
+ "environment_id",
1309
+ "project_id"
1310
+ ],
1311
+ "columnsTo": [
1312
+ "id",
1313
+ "project_id"
1314
+ ],
1315
+ "onDelete": "no action",
1316
+ "onUpdate": "no action"
1317
+ }
1318
+ },
1319
+ "compositePrimaryKeys": {},
1320
+ "uniqueConstraints": {},
1321
+ "checkConstraints": {
1322
+ "secrets_key_check": {
1323
+ "name": "secrets_key_check",
1324
+ "value": "length(\"secrets\".\"key\") BETWEEN 1 AND 128 AND \"secrets\".\"key\" GLOB '[A-Za-z_]*' AND \"secrets\".\"key\" NOT GLOB '*[^A-Za-z0-9_]*'"
1325
+ }
1326
+ }
1327
+ },
1328
+ "vault_grants": {
1329
+ "name": "vault_grants",
1330
+ "columns": {
1331
+ "principal": {
1332
+ "name": "principal",
1333
+ "type": "text",
1334
+ "primaryKey": false,
1335
+ "notNull": true,
1336
+ "autoincrement": false
1337
+ },
1338
+ "project_id": {
1339
+ "name": "project_id",
1340
+ "type": "text",
1341
+ "primaryKey": false,
1342
+ "notNull": false,
1343
+ "autoincrement": false
1344
+ },
1345
+ "environment_id": {
1346
+ "name": "environment_id",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": false,
1350
+ "autoincrement": false
1351
+ },
1352
+ "role": {
1353
+ "name": "role",
1354
+ "type": "text",
1355
+ "primaryKey": false,
1356
+ "notNull": true,
1357
+ "autoincrement": false
1358
+ },
1359
+ "expires_at": {
1360
+ "name": "expires_at",
1361
+ "type": "integer",
1362
+ "primaryKey": false,
1363
+ "notNull": false,
1364
+ "autoincrement": false
1365
+ },
1366
+ "granted_at": {
1367
+ "name": "granted_at",
1368
+ "type": "integer",
1369
+ "primaryKey": false,
1370
+ "notNull": true,
1371
+ "autoincrement": false
1372
+ },
1373
+ "granted_by": {
1374
+ "name": "granted_by",
1375
+ "type": "text",
1376
+ "primaryKey": false,
1377
+ "notNull": true,
1378
+ "autoincrement": false
1379
+ }
1380
+ },
1381
+ "indexes": {
1382
+ "vault_grants_on_project": {
1383
+ "name": "vault_grants_on_project",
1384
+ "columns": [
1385
+ "principal",
1386
+ "project_id"
1387
+ ],
1388
+ "isUnique": true
1389
+ },
1390
+ "vault_grants_on_environment": {
1391
+ "name": "vault_grants_on_environment",
1392
+ "columns": [
1393
+ "principal",
1394
+ "environment_id"
1395
+ ],
1396
+ "isUnique": true
1397
+ }
1398
+ },
1399
+ "foreignKeys": {
1400
+ "vault_grants_principal_fkey": {
1401
+ "name": "vault_grants_principal_fkey",
1402
+ "tableFrom": "vault_grants",
1403
+ "tableTo": "vault_members",
1404
+ "columnsFrom": [
1405
+ "principal"
1406
+ ],
1407
+ "columnsTo": [
1408
+ "principal"
1409
+ ],
1410
+ "onDelete": "restrict",
1411
+ "onUpdate": "no action"
1412
+ },
1413
+ "vault_grants_project_id_fkey": {
1414
+ "name": "vault_grants_project_id_fkey",
1415
+ "tableFrom": "vault_grants",
1416
+ "tableTo": "projects",
1417
+ "columnsFrom": [
1418
+ "project_id"
1419
+ ],
1420
+ "columnsTo": [
1421
+ "id"
1422
+ ],
1423
+ "onDelete": "restrict",
1424
+ "onUpdate": "no action"
1425
+ },
1426
+ "vault_grants_environment_id_fkey": {
1427
+ "name": "vault_grants_environment_id_fkey",
1428
+ "tableFrom": "vault_grants",
1429
+ "tableTo": "environments",
1430
+ "columnsFrom": [
1431
+ "environment_id"
1432
+ ],
1433
+ "columnsTo": [
1434
+ "id"
1435
+ ],
1436
+ "onDelete": "restrict",
1437
+ "onUpdate": "no action"
1438
+ }
1439
+ },
1440
+ "compositePrimaryKeys": {},
1441
+ "uniqueConstraints": {},
1442
+ "checkConstraints": {
1443
+ "vault_grants_one_place": {
1444
+ "name": "vault_grants_one_place",
1445
+ "value": "(\"vault_grants\".\"project_id\" IS NULL) <> (\"vault_grants\".\"environment_id\" IS NULL)"
1446
+ },
1447
+ "vault_grants_role_check": {
1448
+ "name": "vault_grants_role_check",
1449
+ "value": "\"vault_grants\".\"role\" IN ('viewer', 'developer', 'maintainer', 'access-manager', 'auditor', 'owner')"
1450
+ },
1451
+ "vault_grants_environment_role_check": {
1452
+ "name": "vault_grants_environment_role_check",
1453
+ "value": "\"vault_grants\".\"environment_id\" IS NULL OR \"vault_grants\".\"role\" IN ('viewer', 'developer', 'auditor')"
1454
+ }
1455
+ }
1456
+ },
1457
+ "vault_members": {
1458
+ "name": "vault_members",
1459
+ "columns": {
1460
+ "principal": {
1461
+ "name": "principal",
1462
+ "type": "text",
1463
+ "primaryKey": true,
1464
+ "notNull": true,
1465
+ "autoincrement": false
1466
+ },
1467
+ "status": {
1468
+ "name": "status",
1469
+ "type": "text",
1470
+ "primaryKey": false,
1471
+ "notNull": true,
1472
+ "autoincrement": false
1473
+ },
1474
+ "owner": {
1475
+ "name": "owner",
1476
+ "type": "integer",
1477
+ "primaryKey": false,
1478
+ "notNull": true,
1479
+ "autoincrement": false,
1480
+ "default": false
1481
+ },
1482
+ "generation": {
1483
+ "name": "generation",
1484
+ "type": "integer",
1485
+ "primaryKey": false,
1486
+ "notNull": true,
1487
+ "autoincrement": false,
1488
+ "default": 0
1489
+ },
1490
+ "created_at": {
1491
+ "name": "created_at",
1492
+ "type": "integer",
1493
+ "primaryKey": false,
1494
+ "notNull": true,
1495
+ "autoincrement": false
1496
+ },
1497
+ "created_by": {
1498
+ "name": "created_by",
1499
+ "type": "text",
1500
+ "primaryKey": false,
1501
+ "notNull": true,
1502
+ "autoincrement": false
1503
+ },
1504
+ "status_changed_at": {
1505
+ "name": "status_changed_at",
1506
+ "type": "integer",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "autoincrement": false
1510
+ },
1511
+ "status_changed_by": {
1512
+ "name": "status_changed_by",
1513
+ "type": "text",
1514
+ "primaryKey": false,
1515
+ "notNull": true,
1516
+ "autoincrement": false
1517
+ },
1518
+ "access_seq": {
1519
+ "name": "access_seq",
1520
+ "type": "integer",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "autoincrement": false
1524
+ },
1525
+ "mac": {
1526
+ "name": "mac",
1527
+ "type": "blob",
1528
+ "primaryKey": false,
1529
+ "notNull": true,
1530
+ "autoincrement": false
1531
+ }
1532
+ },
1533
+ "indexes": {},
1534
+ "foreignKeys": {},
1535
+ "compositePrimaryKeys": {},
1536
+ "uniqueConstraints": {},
1537
+ "checkConstraints": {
1538
+ "vault_members_mac_check": {
1539
+ "name": "vault_members_mac_check",
1540
+ "value": "octet_length(\"vault_members\".\"mac\") = 32"
1541
+ },
1542
+ "vault_members_principal_check": {
1543
+ "name": "vault_members_principal_check",
1544
+ "value": "(\"vault_members\".\"principal\" GLOB 'user:?*' OR \"vault_members\".\"principal\" GLOB 'token:?*' OR \"vault_members\".\"principal\" GLOB 'sync:?*')\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"
1545
+ },
1546
+ "vault_members_user_lowercase": {
1547
+ "name": "vault_members_user_lowercase",
1548
+ "value": "\"vault_members\".\"principal\" NOT LIKE 'user:%' OR \"vault_members\".\"principal\" = lower(\"vault_members\".\"principal\")"
1549
+ },
1550
+ "vault_members_status_check": {
1551
+ "name": "vault_members_status_check",
1552
+ "value": "\"vault_members\".\"status\" IN ('active', 'removed')"
1553
+ },
1554
+ "vault_members_owner_check": {
1555
+ "name": "vault_members_owner_check",
1556
+ "value": "NOT \"vault_members\".\"owner\" OR (\"vault_members\".\"status\" = 'active' AND \"vault_members\".\"principal\" LIKE 'user:%')"
1557
+ },
1558
+ "vault_members_generation_check": {
1559
+ "name": "vault_members_generation_check",
1560
+ "value": "\"vault_members\".\"generation\" >= 0"
1561
+ }
1562
+ }
1563
+ }
1564
+ },
1565
+ "views": {},
1566
+ "enums": {},
1567
+ "_meta": {
1568
+ "schemas": {},
1569
+ "tables": {},
1570
+ "columns": {}
1571
+ },
1572
+ "internal": {
1573
+ "indexes": {}
1574
+ }
1575
+ }