mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-17 00:53:56 +00:00
First working version
This commit is contained in:
commit
5cd40c63ed
172 changed files with 17903 additions and 0 deletions
7
migrations/2018-01-14-171611_create_tables/down.sql
Normal file
7
migrations/2018-01-14-171611_create_tables/down.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
DROP TABLE users;
|
||||
|
||||
DROP TABLE devices;
|
||||
|
||||
DROP TABLE ciphers;
|
||||
|
||||
DROP TABLE folders;
|
50
migrations/2018-01-14-171611_create_tables/up.sql
Normal file
50
migrations/2018-01-14-171611_create_tables/up.sql
Normal file
|
@ -0,0 +1,50 @@
|
|||
CREATE TABLE users (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME NOT NULL,
|
||||
updated_at DATETIME NOT NULL,
|
||||
email TEXT UNIQUE NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
password_hash BLOB NOT NULL,
|
||||
salt BLOB NOT NULL,
|
||||
password_iterations INTEGER NOT NULL,
|
||||
password_hint TEXT,
|
||||
key TEXT NOT NULL,
|
||||
private_key TEXT,
|
||||
public_key TEXT,
|
||||
totp_secret TEXT,
|
||||
totp_recover TEXT,
|
||||
security_stamp TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE devices (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME NOT NULL,
|
||||
updated_at DATETIME NOT NULL,
|
||||
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||||
name TEXT NOT NULL,
|
||||
type INTEGER NOT NULL,
|
||||
push_token TEXT UNIQUE,
|
||||
refresh_token TEXT UNIQUE NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE ciphers (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME NOT NULL,
|
||||
updated_at DATETIME NOT NULL,
|
||||
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||||
folder_uuid TEXT REFERENCES folders (uuid),
|
||||
organization_uuid TEXT,
|
||||
type INTEGER NOT NULL,
|
||||
data TEXT NOT NULL,
|
||||
favorite BOOLEAN NOT NULL,
|
||||
attachments BLOB
|
||||
);
|
||||
|
||||
CREATE TABLE folders (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
created_at DATETIME NOT NULL,
|
||||
updated_at DATETIME NOT NULL,
|
||||
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue