committed by
Maximilian Fijak
6 changed files with 78 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||||
|
DROP TABLE ´groups´; |
||||
|
DROP TABLE groups_users; |
||||
|
DROP TABLE collection_groups; |
@ -0,0 +1,23 @@ |
|||||
|
CREATE TABLE ´groups´ ( |
||||
|
uuid CHAR(36) NOT NULL PRIMARY KEY, |
||||
|
organizations_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid), |
||||
|
name VARCHAR(100) NOT NULL, |
||||
|
access_all BOOLEAN NOT NULL, |
||||
|
external_id VARCHAR(300) NULL, |
||||
|
creation_date DATETIME NOT NULL, |
||||
|
revision_date DATETIME NOT NULL |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE groups_users ( |
||||
|
groups_uuid CHAR(36) NOT NULL REFERENCES ´groups´ (uuid), |
||||
|
users_organizations_uuid VARCHAR(36) NOT NULL REFERENCES users_organizations (uuid), |
||||
|
UNIQUE (group_uuid, users_organizations_uuid) |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE collection_groups ( |
||||
|
collections_uuid VARCHAR(40) NOT NULL REFERENCES collections (uuid), |
||||
|
groups_uuid CHAR(36) NOT NULL REFERENCES ´groups´ (uuid), |
||||
|
read_only BOOLEAN NOT NULL, |
||||
|
hide_passwords BOOLEAN NOT NULL, |
||||
|
UNIQUE (collections_uuid, groups_uuid) |
||||
|
); |
@ -0,0 +1,3 @@ |
|||||
|
DROP TABLE groups; |
||||
|
DROP TABLE groups_users; |
||||
|
DROP TABLE collection_groups; |
@ -0,0 +1,23 @@ |
|||||
|
CREATE TABLE groups ( |
||||
|
uuid CHAR(36) NOT NULL PRIMARY KEY, |
||||
|
organizations_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid), |
||||
|
name VARCHAR(100) NOT NULL, |
||||
|
access_all BOOLEAN NOT NULL, |
||||
|
external_id VARCHAR(300) NULL, |
||||
|
creation_date TIMESTAMP NOT NULL, |
||||
|
revision_date TIMESTAMP NOT NULL |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE groups_users ( |
||||
|
groups_uuid CHAR(36) NOT NULL REFERENCES groups (uuid), |
||||
|
users_organizations_uuid VARCHAR(36) NOT NULL REFERENCES users_organizations (uuid), |
||||
|
PRIMARY KEY (group_uuid, users_organizations_uuid) |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE collection_groups ( |
||||
|
collections_uuid VARCHAR(40) NOT NULL REFERENCES collections (uuid), |
||||
|
groups_uuid CHAR(36) NOT NULL REFERENCES groups (uuid), |
||||
|
read_only BOOLEAN NOT NULL, |
||||
|
hide_passwords BOOLEAN NOT NULL, |
||||
|
PRIMARY KEY (collections_uuid, groups_uuid) |
||||
|
); |
@ -0,0 +1,3 @@ |
|||||
|
DROP TABLE groups; |
||||
|
DROP TABLE groups_users; |
||||
|
DROP TABLE collection_groups; |
@ -0,0 +1,23 @@ |
|||||
|
CREATE TABLE groups ( |
||||
|
uuid TEXT NOT NULL PRIMARY KEY, |
||||
|
organizations_uuid TEXT NOT NULL REFERENCES organizations (uuid), |
||||
|
name TEXT NOT NULL, |
||||
|
access_all BOOLEAN NOT NULL, |
||||
|
external_id TEXT NULL, |
||||
|
creation_date TIMESTAMP NOT NULL, |
||||
|
revision_date TIMESTAMP NOT NULL |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE groups_users ( |
||||
|
groups_uuid TEXT NOT NULL REFERENCES groups (uuid), |
||||
|
users_organizations_uuid TEXT NOT NULL REFERENCES users_organizations (uuid), |
||||
|
UNIQUE (group_uuid, users_organizations_uuid) |
||||
|
); |
||||
|
|
||||
|
CREATE TABLE collection_groups ( |
||||
|
collections_uuid TEXT NOT NULL REFERENCES collections (uuid), |
||||
|
groups_uuid TEXT NOT NULL REFERENCES groups (uuid), |
||||
|
read_only BOOLEAN NOT NULL, |
||||
|
hide_passwords BOOLEAN NOT NULL, |
||||
|
UNIQUE (collections_uuid, groups_uuid) |
||||
|
); |
Loading…
Reference in new issue