You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
7 years ago
|
CREATE TABLE users (
|
||
6 years ago
|
uuid TEXT NOT NULL PRIMARY KEY,
|
||
7 years ago
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL,
|
||
6 years ago
|
email TEXT NOT NULL UNIQUE,
|
||
7 years ago
|
name TEXT NOT NULL,
|
||
|
password_hash BLOB NOT NULL,
|
||
|
salt BLOB NOT NULL,
|
||
|
password_iterations INTEGER NOT NULL,
|
||
7 years ago
|
password_hint TEXT,
|
||
6 years ago
|
key TEXT NOT NULL,
|
||
7 years ago
|
private_key TEXT,
|
||
|
public_key TEXT,
|
||
|
totp_secret TEXT,
|
||
|
totp_recover TEXT,
|
||
7 years ago
|
security_stamp TEXT NOT NULL,
|
||
|
equivalent_domains TEXT NOT NULL,
|
||
|
excluded_globals TEXT NOT NULL
|
||
7 years ago
|
);
|
||
|
|
||
|
CREATE TABLE devices (
|
||
6 years ago
|
uuid TEXT NOT NULL PRIMARY KEY,
|
||
7 years ago
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL,
|
||
6 years ago
|
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||
7 years ago
|
name TEXT NOT NULL,
|
||
6 years ago
|
type INTEGER NOT NULL,
|
||
7 years ago
|
push_token TEXT,
|
||
|
refresh_token TEXT NOT NULL
|
||
7 years ago
|
);
|
||
|
|
||
|
CREATE TABLE ciphers (
|
||
6 years ago
|
uuid TEXT NOT NULL PRIMARY KEY,
|
||
7 years ago
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL,
|
||
6 years ago
|
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||
|
folder_uuid TEXT REFERENCES folders (uuid),
|
||
|
organization_uuid TEXT,
|
||
|
type INTEGER NOT NULL,
|
||
7 years ago
|
name TEXT NOT NULL,
|
||
|
notes TEXT,
|
||
|
fields TEXT,
|
||
7 years ago
|
data TEXT NOT NULL,
|
||
7 years ago
|
favorite BOOLEAN NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE TABLE attachments (
|
||
6 years ago
|
id TEXT NOT NULL PRIMARY KEY,
|
||
|
cipher_uuid TEXT NOT NULL REFERENCES ciphers (uuid),
|
||
7 years ago
|
file_name TEXT NOT NULL,
|
||
|
file_size INTEGER NOT NULL
|
||
|
|
||
7 years ago
|
);
|
||
|
|
||
|
CREATE TABLE folders (
|
||
6 years ago
|
uuid TEXT NOT NULL PRIMARY KEY,
|
||
7 years ago
|
created_at DATETIME NOT NULL,
|
||
|
updated_at DATETIME NOT NULL,
|
||
6 years ago
|
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||
7 years ago
|
name TEXT NOT NULL
|
||
|
);
|
||
6 years ago
|
|