mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-10 21:53:57 +00:00
Some initial work on organizations, nothing works yet
This commit is contained in:
parent
d6a1a9b274
commit
1bc346688c
7 changed files with 357 additions and 12 deletions
|
@ -0,0 +1,8 @@
|
|||
DROP TABLE collections;
|
||||
|
||||
DROP TABLE organizations;
|
||||
|
||||
|
||||
DROP TABLE users_collections;
|
||||
|
||||
DROP TABLE users_organizations;
|
|
@ -0,0 +1,29 @@
|
|||
CREATE TABLE collections (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
org_uuid TEXT NOT NULL REFERENCES organizations (uuid),
|
||||
name TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE organizations (
|
||||
uuid TEXT NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
billing_email TEXT NOT NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE users_collections (
|
||||
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||||
collection_uuid TEXT NOT NULL REFERENCES collections (uuid),
|
||||
PRIMARY KEY (user_uuid, collection_uuid)
|
||||
);
|
||||
|
||||
CREATE TABLE users_organizations (
|
||||
user_uuid TEXT NOT NULL REFERENCES users (uuid),
|
||||
org_uuid TEXT NOT NULL REFERENCES organizations (uuid),
|
||||
|
||||
key TEXT NOT NULL,
|
||||
status INTEGER NOT NULL,
|
||||
type INTEGER NOT NULL,
|
||||
|
||||
PRIMARY KEY (user_uuid, org_uuid)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue