| 1 | CREATE TABLE `accounts` (`id` blob,`email_index` blob NOT NULL,`kdf_salt` blob NOT NULL,`created_at` datetime,PRIMARY KEY (`id`)); |
| 2 | |
| 3 | CREATE UNIQUE INDEX `idx_accounts_email_index` ON `accounts`(`email_index`); |
| 4 | |
| 5 | CREATE TABLE `login_keys` (`id` blob,`account_id` blob NOT NULL,`branch` text NOT NULL,`public_key` blob NOT NULL,`created_at` datetime,PRIMARY KEY (`id`)); |
| 6 | |
| 7 | CREATE INDEX `idx_login_keys_account_id` ON `login_keys`(`account_id`); |
| 8 | |
| 9 | CREATE TABLE `wraps` (`id` blob,`account_id` blob NOT NULL,`kind` text NOT NULL,`format_version` integer NOT NULL,`version` integer NOT NULL,`kdf_params` text NOT NULL,`cred_salt` blob,`kcv` blob NOT NULL,`nonce` blob NOT NULL,`ciphertext` blob NOT NULL,`created_at` datetime,PRIMARY KEY (`id`)); |
| 10 | |
| 11 | CREATE INDEX `idx_wraps_kind` ON `wraps`(`kind`); |
| 12 | |
| 13 | CREATE INDEX `idx_wraps_account_id` ON `wraps`(`account_id`); |
| 14 | |
| 15 | CREATE TABLE `vaults` (`id` blob,`account_id` blob NOT NULL,`drop_box_public_key` blob NOT NULL,`created_at` datetime,PRIMARY KEY (`id`)); |
| 16 | |
| 17 | CREATE INDEX `idx_vaults_account_id` ON `vaults`(`account_id`); |
| 18 | |
| 19 | CREATE TABLE `vault_members` (`id` blob,`vault_id` blob NOT NULL,`account_id` blob NOT NULL,`ephemeral_public_key` blob NOT NULL,`nonce` blob NOT NULL,`ciphertext` blob NOT NULL,`created_at` datetime,PRIMARY KEY (`id`)); |
| 20 | |
| 21 | CREATE INDEX `idx_vault_members_account_id` ON `vault_members`(`account_id`); |
| 22 | |
| 23 | CREATE INDEX `idx_vault_members_vault_id` ON `vault_members`(`vault_id`); |
| 24 | |
| 25 | CREATE TABLE `items` (`id` blob,`vault_id` blob NOT NULL,`version` integer NOT NULL,`nonce` blob NOT NULL,`ciphertext` blob NOT NULL,`created_at` datetime,`updated_at` datetime,PRIMARY KEY (`id`)); |
| 26 | |
| 27 | CREATE INDEX `idx_items_vault_id` ON `items`(`vault_id`); |
| 28 | |
| 29 | |