X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=projects%2FGDE_App%2Fsrc%2FGDE_DB_Init.sql;h=caf73238fe4f6a2ea952ee6075d76a31dd4256e6;hb=42759e578f13c7647e60889c6088d1309e535456;hp=212a859e81df29047267fedf733af8e70824910f;hpb=f01c4fadc0ada0a44eb3d93b2d9ceba1cec2ba36;p=modules%2Fgde.git diff --git a/projects/GDE_App/src/GDE_DB_Init.sql b/projects/GDE_App/src/GDE_DB_Init.sql index 212a859..caf7323 100644 --- a/projects/GDE_App/src/GDE_DB_Init.sql +++ b/projects/GDE_App/src/GDE_DB_Init.sql @@ -1,63 +1,76 @@ drop sequence SEQ_GEN_SEQUENCE; create sequence SEQ_GEN_SEQUENCE INCREMENT BY 50; +/* METADATA */ + DROP TABLE attribute_group CASCADE; CREATE TABLE attribute_group ( - id int8 PRIMARY KEY + id bigint NOT NULL PRIMARY KEY ); DROP TABLE attribute CASCADE; CREATE TABLE attribute ( - id int8 PRIMARY KEY, + id bigint NOT NULL PRIMARY KEY, name varchar(255), type varchar(255), value varchar(255), - group_id int8 REFERENCES attribute_group (id), + attribute_group_id bigint REFERENCES attribute_group (id), mandatory boolean ); -DROP TABLE file CASCADE; -CREATE TABLE file ( - id int8 PRIMARY KEY, +/* DATA */ + +DROP TABLE gde_file CASCADE; +CREATE TABLE gde_file ( + id bigint NOT NULL PRIMARY KEY, name varchar(255), - length int8, + length bigint, checksum varchar(255), creation_date timestamp, update_date timestamp, valid boolean, deleted boolean, deletion_date timestamp, - group_id int8 REFERENCES attribute_group (id) + attribute_group_id bigint REFERENCES attribute_group (id) ); DROP TABLE chunk CASCADE; CREATE TABLE chunk ( - id int8 PRIMARY KEY, - file_id int8 REFERENCES file (id), - rank int8, + id bigint NOT NULL PRIMARY KEY, + file_id bigint NOT NULL REFERENCES gde_file (id), + rank bigint, checksum varchar(255), - size int8, + size bigint, data bytea ); -/* -DROP TABLE data CASCADE; -CREATE TABLE data ( - file_id int8 REFERENCES file (id), - metadata_id int8 REFERENCES attribute_group (id), - PRIMARY KEY (file_id, metadata_id) + +/* STUDIES */ + +DROP TABLE study CASCADE; +CREATE TABLE study ( + id bigint NOT NULL PRIMARY KEY, + name varchar(255), + creation_date timestamp, + update_date timestamp, + valid boolean, + deleted boolean, + deletion_date timestamp, + attribute_group_id bigint REFERENCES attribute_group (id) ); -*/ + +/* PROFILES */ + DROP TABLE profile CASCADE; CREATE TABLE profile ( - id int8 PRIMARY KEY, + id bigint NOT NULL PRIMARY KEY, name varchar(255) ); DROP TABLE profile_attribute CASCADE; CREATE TABLE profile_attribute ( - id int8 PRIMARY KEY, + id bigint NOT NULL PRIMARY KEY, name varchar(255), type varchar(255), mandatory boolean, - profile_id int8 REFERENCES profile (id) + profile_id bigint REFERENCES profile (id) );