]> SALOME platform Git repositories - modules/gde.git/blob - projects/GDE_App/src/GDE_DB_Init.sql
Salome HOME
212a859e81df29047267fedf733af8e70824910f
[modules/gde.git] / projects / GDE_App / src / GDE_DB_Init.sql
1 drop sequence SEQ_GEN_SEQUENCE;
2 create sequence SEQ_GEN_SEQUENCE INCREMENT BY 50;
3
4 DROP TABLE attribute_group CASCADE;
5 CREATE TABLE attribute_group (
6     id int8 PRIMARY KEY
7 );
8
9 DROP TABLE attribute CASCADE;
10 CREATE TABLE attribute (
11     id int8 PRIMARY KEY,
12     name varchar(255),
13     type varchar(255),
14     value varchar(255),
15     group_id int8 REFERENCES attribute_group (id),
16     mandatory boolean
17 );
18
19 DROP TABLE file CASCADE;
20 CREATE TABLE file (
21     id int8 PRIMARY KEY,
22     name varchar(255),
23     length int8,
24     checksum varchar(255),
25     creation_date timestamp,
26     update_date timestamp,
27     valid boolean,
28     deleted boolean,
29     deletion_date timestamp,
30     group_id int8 REFERENCES attribute_group (id)
31 );
32
33 DROP TABLE chunk CASCADE;
34 CREATE TABLE chunk (
35     id int8 PRIMARY KEY,
36     file_id int8 REFERENCES file (id),
37     rank int8,
38     checksum varchar(255),
39     size int8,
40     data bytea
41 );
42 /*
43 DROP TABLE data CASCADE;
44 CREATE TABLE data (
45     file_id int8 REFERENCES file (id),
46     metadata_id int8 REFERENCES attribute_group (id),
47     PRIMARY KEY (file_id, metadata_id)
48 );
49 */
50 DROP TABLE profile CASCADE;
51 CREATE TABLE profile (
52     id int8 PRIMARY KEY,
53     name varchar(255)
54 );
55
56 DROP TABLE profile_attribute CASCADE;
57 CREATE TABLE profile_attribute (
58     id int8 PRIMARY KEY,
59     name varchar(255),
60     type varchar(255),
61     mandatory boolean,
62     profile_id int8 REFERENCES profile (id)
63 );