1 /* Unique Ids sequence generator */
3 drop sequence SEQ_GEN_SEQUENCE;
4 create sequence SEQ_GEN_SEQUENCE START WITH 50 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),
25 userId bigint references USERS(id)
28 DROP TABLE IF EXISTS USERPERMISSIONS CASCADE;
29 CREATE TABLE USERPERMISSIONS (
30 id bigint NOT NULL PRIMARY KEY,
31 groupId bigint references GROUP_(id),
32 serviceName varchar(255) not null,
33 methodName varchar(255) not null
38 DROP TABLE IF EXISTS attribute_group CASCADE;
39 CREATE TABLE attribute_group (
40 id bigint NOT NULL PRIMARY KEY
43 DROP TABLE IF EXISTS attribute CASCADE;
44 CREATE TABLE attribute (
45 id bigint NOT NULL PRIMARY KEY,
49 attribute_group_id bigint REFERENCES attribute_group (id),
55 DROP TABLE IF EXISTS gde_file CASCADE;
56 CREATE TABLE gde_file (
57 id bigint NOT NULL PRIMARY KEY,
60 checksum varchar(255),
61 creation_date timestamp,
62 update_date timestamp,
65 deletion_date timestamp,
66 attribute_group_id bigint REFERENCES attribute_group (id),
67 data_profile_id bigint REFERENCES profile (id)
70 DROP TABLE IF EXISTS chunk CASCADE;
72 id bigint NOT NULL PRIMARY KEY,
73 file_id bigint NOT NULL REFERENCES gde_file (id),
75 checksum varchar(255),
82 DROP TABLE IF EXISTS study CASCADE;
84 id bigint NOT NULL PRIMARY KEY,
86 creation_date timestamp,
87 update_date timestamp,
90 deletion_date timestamp,
91 attribute_group_id bigint REFERENCES attribute_group (id),
92 profile_id bigint REFERENCES profile (id)
97 DROP TABLE IF EXISTS profile CASCADE;
98 CREATE TABLE profile (
99 id bigint NOT NULL PRIMARY KEY,
103 DROP TABLE IF EXISTS profile_attribute CASCADE;
104 CREATE TABLE profile_attribute (
105 id bigint NOT NULL PRIMARY KEY,
109 profile_id bigint REFERENCES profile (id)