-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
158 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,65 @@ | ||
CREATE TABLE cycles ( | ||
cycle_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL UNIQUE | ||
CREATE TABLE PROCESSING ( | ||
PROCESSING_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
PROCESSING VARCHAR(700) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
|
||
CREATE TABLE beamlines ( | ||
beamline_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL UNIQUE | ||
CREATE TABLE PARENTS ( | ||
PARENT_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
PARENT VARCHAR(700) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
|
||
CREATE TABLE btrs ( | ||
btr_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL UNIQUE | ||
CREATE TABLE SITES ( | ||
SITE_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
SITE VARCHAR(700) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
|
||
CREATE TABLE samples ( | ||
sample_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
name VARCHAR(100) NOT NULL UNIQUE | ||
CREATE TABLE BUCKETS ( | ||
BUCKET_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
BUCKET VARCHAR(700) NOT NULL UNIQUE, | ||
META_ID VARCHAR(700), | ||
DATASET_ID BIGINT REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
|
||
CREATE TABLE datasets ( | ||
dataset_id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
meta_id VARCHAR(500) NOT NULL UNIQUE, | ||
cycle_id INTEGER REFERENCES cycles(cycle_id) ON UPDATE CASCADE, | ||
beamline_id INTEGER REFERENCES beamlines(beamline_id) ON UPDATE CASCADE, | ||
btr_id INTEGER REFERENCES btrs(btr_id) ON UPDATE CASCADE, | ||
sample_id INTEGER REFERENCES sample(sample_id) ON UPDATE CASCADE, | ||
tstamp INTEGER NOT NULL UNIQUE | ||
CREATE TABLE METADATA ( | ||
META_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
DID VARCHAR(700) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
|
||
CREATE TABLE files ( | ||
file_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
dataset_id BIGINT REFERENCES datasets(dataset_id) ON UPDATE CASCADE, | ||
name VARCHAR(100) NOT NULL | ||
CREATE TABLE DATASETS ( | ||
DATASET_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
DATASET VARCHAR(700) NOT NULL UNIQUE, | ||
META_ID BIGINT REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
SITE_ID BIGINT REFERENCES SITES(SITE_ID) ON UPDATE CASCADE, | ||
PROCESSING_ID BIGINT REFERENCES PROCESSINGS(PROCESSING_ID) ON UPDATE CASCADE, | ||
PARENT_ID BIGINT REFERENCES PARENTS(PARENT_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); | ||
CREATE TABLE FILES ( | ||
FILE_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
FILE VARCHAR(700) NOT NULL UNIQUE, | ||
IS_FILE_VALID INTEGER DEFAULT 1, | ||
META_ID BIGINT REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
DATASET_ID BIGINT REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(500), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(500) | ||
); |
Oops, something went wrong.