Skip to content
Snippets Groups Projects
Commit 0a8ce44e authored by Vermaat's avatar Vermaat
Browse files

Fix order in database create script

parent 7744af72
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,72 @@ cat << EOF | mysql -u root -p
FLUSH PRIVILEGES;
EOF
echo -e "${COLOR_INFO}Creating tables in mutalyzer database${COLOR_END}"
# Create mutalyzer tables
cat << EOF | mysql -u mutalyzer -D mutalyzer
CREATE TABLE BatchJob (
JobID char(20) NOT NULL,
Filter char(20) NOT NULL,
EMail char(255) NOT NULL,
FromHost char(255) NOT NULL,
JobType char(20) DEFAULT NULL,
Arg1 char(20) DEFAULT NULL,
PRIMARY KEY (JobID)
) ENGINE = MYISAM;
CREATE TABLE BatchQueue (
QueueID int(5) NOT NULL AUTO_INCREMENT,
JobID char(20) NOT NULL,
Input char(255) NOT NULL,
Flags char(20) DEFAULT NULL,
PRIMARY KEY (QueueID),
KEY JobQueue (JobID,QueueID)
) ENGINE = MYISAM;
CREATE TABLE GBInfo (
AccNo char(20) NOT NULL DEFAULT '',
GI char(13) DEFAULT NULL,
hash char(32) NOT NULL DEFAULT '',
ChrAccVer char(20) DEFAULT NULL,
ChrStart int(12) DEFAULT NULL,
ChrStop int(12) DEFAULT NULL,
orientation int(2) DEFAULT NULL,
url char(255) DEFAULT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (AccNo),
UNIQUE KEY hash (hash),
UNIQUE KEY alias (GI),
INDEX (created)
) ENGINE = MYISAM;
CREATE TABLE Link (
mrnaAcc char(20) NOT NULL,
protAcc char(20) NOT NULL,
PRIMARY KEY (mrnaAcc),
UNIQUE KEY protAcc (protAcc)
) ENGINE = MYISAM;
CREATE TABLE Counter (
service varchar(100) NOT NULL,
interface varchar(100) NOT NULL,
count bigint NOT NULL DEFAULT 0,
start TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (service, interface)
) ENGINE = MYISAM;
INSERT INTO Counter (service, interface) VALUES
('namecheck', 'website'),
('syntaxcheck', 'website'),
('positionconvert', 'website'),
('snpconvert', 'website'),
('batchjob', 'website'),
('namecheck', 'webservice'),
('syntaxcheck', 'webservice'),
('positionconvert', 'webservice'),
('snpconvert', 'webservice'),
('batchjob', 'webservice'),
('namecheck', 'batch'),
('syntaxcheck', 'batch'),
('positionconvert', 'batch'),
('snpconvert', 'batch');
EOF
echo -e "${COLOR_INFO}Creating tables in hg18 database${COLOR_END}"
# Create ChrName and Mapping table (hg18)
......@@ -319,72 +385,6 @@ rm $MAPPING
echo -e "${COLOR_INFO}Separate import of NC_005089.1 (chrM) in mm10 database${COLOR_END}"
$($BIN_MAPPING_IMPORT reference mm10 NC_005089.1)
echo -e "${COLOR_INFO}Creating tables in mutalyzer database${COLOR_END}"
# Create mutalyzer tables
cat << EOF | mysql -u mutalyzer -D mutalyzer
CREATE TABLE BatchJob (
JobID char(20) NOT NULL,
Filter char(20) NOT NULL,
EMail char(255) NOT NULL,
FromHost char(255) NOT NULL,
JobType char(20) DEFAULT NULL,
Arg1 char(20) DEFAULT NULL,
PRIMARY KEY (JobID)
) ENGINE = MYISAM;
CREATE TABLE BatchQueue (
QueueID int(5) NOT NULL AUTO_INCREMENT,
JobID char(20) NOT NULL,
Input char(255) NOT NULL,
Flags char(20) DEFAULT NULL,
PRIMARY KEY (QueueID),
KEY JobQueue (JobID,QueueID)
) ENGINE = MYISAM;
CREATE TABLE GBInfo (
AccNo char(20) NOT NULL DEFAULT '',
GI char(13) DEFAULT NULL,
hash char(32) NOT NULL DEFAULT '',
ChrAccVer char(20) DEFAULT NULL,
ChrStart int(12) DEFAULT NULL,
ChrStop int(12) DEFAULT NULL,
orientation int(2) DEFAULT NULL,
url char(255) DEFAULT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (AccNo),
UNIQUE KEY hash (hash),
UNIQUE KEY alias (GI),
INDEX (created)
) ENGINE = MYISAM;
CREATE TABLE Link (
mrnaAcc char(20) NOT NULL,
protAcc char(20) NOT NULL,
PRIMARY KEY (mrnaAcc),
UNIQUE KEY protAcc (protAcc)
) ENGINE = MYISAM;
CREATE TABLE Counter (
service varchar(100) NOT NULL,
interface varchar(100) NOT NULL,
count bigint NOT NULL DEFAULT 0,
start TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (service, interface)
) ENGINE = MYISAM;
INSERT INTO Counter (service, interface) VALUES
('namecheck', 'website'),
('syntaxcheck', 'website'),
('positionconvert', 'website'),
('snpconvert', 'website'),
('batchjob', 'website'),
('namecheck', 'webservice'),
('syntaxcheck', 'webservice'),
('positionconvert', 'webservice'),
('snpconvert', 'webservice'),
('batchjob', 'webservice'),
('namecheck', 'batch'),
('syntaxcheck', 'batch'),
('positionconvert', 'batch'),
('snpconvert', 'batch');
EOF
# The remainder is essentially the same as post-upgrade.sh
if [ ! -e /var/www/mutalyzer ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment