aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2018-02-15 00:40:34 +0100
committerDaniel García <[email protected]>2018-02-15 00:40:34 +0100
commitb54684b677fd399011fa7061dc7c0926f3d17c4b (patch)
tree44a010a938f35c8f467411cdde2cbc2ac60cc180 /migrations
parent5cd40c63ed230bee6dd54b79a9a7e768ad87978f (diff)
downloadvaultwarden-b54684b677fd399011fa7061dc7c0926f3d17c4b.tar.gz
vaultwarden-b54684b677fd399011fa7061dc7c0926f3d17c4b.zip
Upload and download attachments, and added License file
Diffstat (limited to 'migrations')
-rw-r--r--migrations/2018-01-14-171611_create_tables/down.sql2
-rw-r--r--migrations/2018-01-14-171611_create_tables/up.sql49
2 files changed, 31 insertions, 20 deletions
diff --git a/migrations/2018-01-14-171611_create_tables/down.sql b/migrations/2018-01-14-171611_create_tables/down.sql
index 3d258d2f..1025a2c0 100644
--- a/migrations/2018-01-14-171611_create_tables/down.sql
+++ b/migrations/2018-01-14-171611_create_tables/down.sql
@@ -4,4 +4,6 @@ DROP TABLE devices;
DROP TABLE ciphers;
+DROP TABLE attachments;
+
DROP TABLE folders; \ No newline at end of file
diff --git a/migrations/2018-01-14-171611_create_tables/up.sql b/migrations/2018-01-14-171611_create_tables/up.sql
index 6f4d31fa..c14ff67f 100644
--- a/migrations/2018-01-14-171611_create_tables/up.sql
+++ b/migrations/2018-01-14-171611_create_tables/up.sql
@@ -1,30 +1,32 @@
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,
+ uuid TEXT NOT NULL PRIMARY KEY,
+ created_at DATETIME NOT NULL,
+ updated_at DATETIME NOT NULL,
+ email TEXT NOT NULL UNIQUE,
+ 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,
+ key TEXT NOT NULL,
private_key TEXT,
public_key TEXT,
totp_secret TEXT,
totp_recover TEXT,
- security_stamp TEXT NOT NULL
+ security_stamp TEXT NOT NULL,
+ equivalent_domains TEXT NOT NULL,
+ excluded_globals 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
+ 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,
+ refresh_token TEXT NOT NULL
);
CREATE TABLE ciphers (
@@ -36,8 +38,15 @@ CREATE TABLE ciphers (
organization_uuid TEXT,
type INTEGER NOT NULL,
data TEXT NOT NULL,
- favorite BOOLEAN NOT NULL,
- attachments BLOB
+ favorite BOOLEAN NOT NULL
+);
+
+CREATE TABLE attachments (
+ id TEXT NOT NULL PRIMARY KEY,
+ cipher_uuid TEXT NOT NULL REFERENCES ciphers (uuid),
+ file_name TEXT NOT NULL,
+ file_size INTEGER NOT NULL
+
);
CREATE TABLE folders (