carlos / contra Public

Clone
git clone https://amadan.net/carlos/contra

Plain git — no account needed to clone.

Download

Download this file

1-- Generated by rastrillo migration generate; DO NOT EDIT.
2-- The schema every migration in this directory adds up to.
3
4CREATE TABLE `accounts` (`id` blob,`email_index` blob NOT NULL,`kdf_salt` blob NOT NULL,`created_at` datetime, `public_key` blob, `keyset_nonce` blob, `keyset_ciphertext` blob,PRIMARY KEY (`id`));
5
6CREATE TABLE `device_links` (`id` blob,`code_hash` blob NOT NULL,`account_id` blob NOT NULL,`device_public` blob NOT NULL,`sealed` blob,`expires_at` datetime NOT NULL,PRIMARY KEY (`id`));
7
8CREATE 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`));
9
10CREATE TABLE `login_challenges` (`id` blob,`account_id` blob NOT NULL,`branch` text NOT NULL,`challenge` blob NOT NULL,`expires_at` datetime NOT NULL,`created_at` datetime,PRIMARY KEY (`id`));
11
12CREATE 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`));
13
14CREATE TABLE `signup_sessions` (`id` blob,`email_index` blob NOT NULL,`token_hash` blob NOT NULL,`verified` numeric NOT NULL,`expires_at` datetime NOT NULL,`created_at` datetime,PRIMARY KEY (`id`));
15
16CREATE 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`));
17
18CREATE TABLE `vaults` (`id` blob,`account_id` blob NOT NULL,`drop_box_public_key` blob NOT NULL,`created_at` datetime, `keyset_nonce` blob, `keyset_ciphertext` blob, `epoch` integer NOT NULL DEFAULT 1,PRIMARY KEY (`id`));
19
20CREATE 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, `credential_id` blob,PRIMARY KEY (`id`));
21
22CREATE UNIQUE INDEX `idx_accounts_email_index` ON `accounts`(`email_index`);
23
24CREATE INDEX `idx_device_links_account_id` ON `device_links`(`account_id`);
25
26CREATE UNIQUE INDEX `idx_device_links_code_hash` ON `device_links`(`code_hash`);
27
28CREATE INDEX `idx_device_links_expires_at` ON `device_links`(`expires_at`);
29
30CREATE INDEX `idx_items_vault_id` ON `items`(`vault_id`);
31
32CREATE INDEX `idx_login_challenges_account_id` ON `login_challenges`(`account_id`);
33
34CREATE INDEX `idx_login_challenges_challenge` ON `login_challenges`(`challenge`);
35
36CREATE INDEX `idx_login_challenges_expires_at` ON `login_challenges`(`expires_at`);
37
38CREATE INDEX `idx_login_keys_account_id` ON `login_keys`(`account_id`);
39
40CREATE INDEX `idx_signup_sessions_email_index` ON `signup_sessions`(`email_index`);
41
42CREATE INDEX `idx_signup_sessions_expires_at` ON `signup_sessions`(`expires_at`);
43
44CREATE INDEX `idx_signup_sessions_token_hash` ON `signup_sessions`(`token_hash`);
45
46CREATE INDEX `idx_vault_members_account_id` ON `vault_members`(`account_id`);
47
48CREATE INDEX `idx_vault_members_vault_id` ON `vault_members`(`vault_id`);
49
50CREATE INDEX `idx_vaults_account_id` ON `vaults`(`account_id`);
51
52CREATE INDEX `idx_wraps_account_id` ON `wraps`(`account_id`);
53
54CREATE INDEX `idx_wraps_credential_id` ON `wraps`(`credential_id`);
55
56CREATE INDEX `idx_wraps_kind` ON `wraps`(`kind`);
57
58