mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-24 20:43:59 +00:00
initial mysql support
This commit is contained in:
parent
badd22ac3d
commit
ff759397f6
55 changed files with 454 additions and 21 deletions
|
@ -0,0 +1,8 @@
|
|||
DROP TABLE collections;
|
||||
|
||||
DROP TABLE organizations;
|
||||
|
||||
|
||||
DROP TABLE users_collections;
|
||||
|
||||
DROP TABLE users_organizations;
|
|
@ -0,0 +1,30 @@
|
|||
CREATE TABLE collections (
|
||||
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
|
||||
org_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid),
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE organizations (
|
||||
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
billing_email TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE users_collections (
|
||||
user_uuid VARCHAR(40) NOT NULL REFERENCES users (uuid),
|
||||
collection_uuid VARCHAR(40) NOT NULL REFERENCES collections (uuid),
|
||||
PRIMARY KEY (user_uuid, collection_uuid)
|
||||
);
|
||||
|
||||
CREATE TABLE users_organizations (
|
||||
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
|
||||
user_uuid VARCHAR(40) NOT NULL REFERENCES users (uuid),
|
||||
org_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid),
|
||||
|
||||
access_all BOOLEAN NOT NULL,
|
||||
`key` TEXT NOT NULL,
|
||||
status INTEGER NOT NULL,
|
||||
type INTEGER NOT NULL,
|
||||
|
||||
UNIQUE (user_uuid, org_uuid)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue