1 /* Unique Ids sequence generator */
3 drop sequence SEQ_GEN_SEQUENCE;
4 create sequence SEQ_GEN_SEQUENCE START WITH 100 INCREMENT BY 50;
7 DROP TABLE IF EXISTS GROUP_ CASCADE;
9 id bigint NOT NULL PRIMARY KEY,
10 groupName varchar(255) NOT NULL
13 DROP TABLE IF EXISTS USERS CASCADE;
15 id bigint NOT NULL PRIMARY KEY,
16 userName varchar(255) not null,
17 userpassword varchar(255) not null
19 CREATE INDEX users_username_index ON USERS(userName);
21 DROP TABLE IF EXISTS USERGROUP CASCADE;
22 CREATE TABLE USERGROUP (
23 id bigint NOT NULL PRIMARY KEY,
24 groupId bigint references GROUP_(id) on delete cascade,
25 userId bigint references USERS(id) on delete cascade
27 create index usergroup_groupId_idx ON USERGROUP(groupId);
29 DROP TABLE IF EXISTS GROUPPERMISSIONS CASCADE;
30 CREATE TABLE GROUPPERMISSIONS (
31 id bigint NOT NULL PRIMARY KEY,
32 groupId bigint references GROUP_(id),
33 serviceName varchar(255) not null,
34 methodName varchar(255) not null
39 DROP TABLE IF EXISTS attribute_group CASCADE;
40 CREATE TABLE attribute_group (
41 id bigint NOT NULL PRIMARY KEY
44 DROP TABLE IF EXISTS attribute CASCADE;
45 CREATE TABLE attribute (
46 id bigint NOT NULL PRIMARY KEY,
50 attribute_group_id bigint REFERENCES attribute_group (id),
56 DROP TABLE IF EXISTS gde_file CASCADE;
57 CREATE TABLE gde_file (
58 id bigint NOT NULL PRIMARY KEY,
61 checksum varchar(255),
62 creation_date timestamp,
63 update_date timestamp,
66 deletion_date timestamp,
67 attribute_group_id bigint REFERENCES attribute_group (id),
68 data_profile_id bigint REFERENCES profile (id)
71 DROP TABLE IF EXISTS chunk CASCADE;
73 id bigint NOT NULL PRIMARY KEY,
74 file_id bigint NOT NULL REFERENCES gde_file (id),
76 checksum varchar(255),
83 DROP TABLE IF EXISTS study CASCADE;
85 id bigint NOT NULL PRIMARY KEY,
87 creation_date timestamp,
88 update_date timestamp,
91 deletion_date timestamp,
92 attribute_group_id bigint REFERENCES attribute_group (id),
93 profile_id bigint REFERENCES profile (id)
98 DROP TABLE IF EXISTS profile CASCADE;
99 CREATE TABLE profile (
100 id bigint NOT NULL PRIMARY KEY,
104 DROP TABLE IF EXISTS profile_attribute CASCADE;
105 CREATE TABLE profile_attribute (
106 id bigint NOT NULL PRIMARY KEY,
110 profile_id bigint REFERENCES profile (id)