up.sql 1.1 KB

1234567891011121314151617181920212223
  1. CREATE TABLE groups (
  2. uuid CHAR(36) NOT NULL PRIMARY KEY,
  3. organizations_uuid VARCHAR(40) NOT NULL REFERENCES organizations (uuid),
  4. name VARCHAR(100) NOT NULL,
  5. access_all BOOLEAN NOT NULL,
  6. external_id VARCHAR(300) NULL,
  7. creation_date TIMESTAMP NOT NULL,
  8. revision_date TIMESTAMP NOT NULL
  9. );
  10. CREATE TABLE groups_users (
  11. groups_uuid CHAR(36) NOT NULL REFERENCES groups (uuid),
  12. users_organizations_uuid VARCHAR(36) NOT NULL REFERENCES users_organizations (uuid),
  13. PRIMARY KEY (groups_uuid, users_organizations_uuid)
  14. );
  15. CREATE TABLE collections_groups (
  16. collections_uuid VARCHAR(40) NOT NULL REFERENCES collections (uuid),
  17. groups_uuid CHAR(36) NOT NULL REFERENCES groups (uuid),
  18. read_only BOOLEAN NOT NULL,
  19. hide_passwords BOOLEAN NOT NULL,
  20. PRIMARY KEY (collections_uuid, groups_uuid)
  21. );