1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-29 06:20:29 +01:00
vaultwarden/migrations/2018-02-17-205753_create_collections_and_orgs/up.sql

31 Zeilen
892 B
MySQL

CREATE TABLE collections (
2019-05-20 21:12:41 +02:00
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
org_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid),
name TEXT NOT NULL
);
CREATE TABLE organizations (
2019-05-20 21:12:41 +02:00
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
billing_email TEXT NOT NULL
);
CREATE TABLE users_collections (
2019-05-20 21:12:41 +02:00
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 (
2019-05-20 21:12:41 +02:00
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,
2019-05-20 21:12:41 +02:00
akey TEXT NOT NULL,
status INTEGER NOT NULL,
2019-05-20 21:12:41 +02:00
atype INTEGER NOT NULL,
UNIQUE (user_uuid, org_uuid)
);