summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2013-11-27 00:20:09 +0100
committerMichael Tänzer <neo@nhng.de>2013-11-27 00:20:09 +0100
commitd769eb50a3b878d0828679728a623985536df3eb (patch)
tree8cecae8946fc25cb7bda73310e2c805125b41243
parent8a800f629e9d685d7c454d8fb16737f4cb8d9368 (diff)
downloadcacert-devel-d769eb50a3b878d0828679728a623985536df3eb.tar.gz
cacert-devel-d769eb50a3b878d0828679728a623985536df3eb.tar.xz
cacert-devel-d769eb50a3b878d0828679728a623985536df3eb.zip
Bug 1135: Fix SQL queries in many ways:
- Add semicolons - uniform definition of `information` column - capitalisation of table names - name the output file for adminlog backup Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--scripts/db_migrations/version3.sh12
-rw-r--r--scripts/db_migrations/version4.sh8
2 files changed, 10 insertions, 10 deletions
diff --git a/scripts/db_migrations/version3.sh b/scripts/db_migrations/version3.sh
index 55dfeca..8febfe7 100644
--- a/scripts/db_migrations/version3.sh
+++ b/scripts/db_migrations/version3.sh
@@ -64,7 +64,7 @@ mysql $mysql_opt <<- 'SQL'
-- alter table Admin log
ALTER TABLE `adminlog` ADD `type` VARCHAR( 50 ) NOT NULL ,
- ADD `information` VARCHAR( 50 ) NOT NULL
+ ADD `information` VARCHAR( 50 ) NOT NULL;
-- create new table OrgAdminLog
@@ -73,16 +73,16 @@ CREATE TABLE IF NOT EXISTS `orgadminlog` (
`oid` int(11) NOT NULL,
`adminid` int(11) NOT NULL,
`type` varchar(50) NOT NULL,
- `information` varchar(100) NOT NULL
+ `information` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- alter table OrgDomainCerts
-ALTER TABLE `OrgDomainCerts` ADD orgadminid int(11) NULL,
- ADD revokeorgadminid int(11) NULL
+ALTER TABLE `orgdomaincerts` ADD orgadminid int(11) NULL,
+ ADD revokeorgadminid int(11) NULL;
-- alter table OrgEmailCerts
-ALTER TABLE `OrgEmailCerts` ADD orgadminid int(11) NULL,
- ADD revokeorgadminid int(11) NULL
+ALTER TABLE `orgemailcerts` ADD orgadminid int(11) NULL,
+ ADD revokeorgadminid int(11) NULL;
diff --git a/scripts/db_migrations/version4.sh b/scripts/db_migrations/version4.sh
index 155a72e..9a8aded 100644
--- a/scripts/db_migrations/version4.sh
+++ b/scripts/db_migrations/version4.sh
@@ -62,22 +62,22 @@ mysql $mysql_opt <<- 'SQL'
-- dump table AdminLog
SELECT *
- INTO OUTFILE "???"
+ INTO OUTFILE "adminlog_table_backup_1135"
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
- FROM `adminlog`
+ FROM `adminlog`;
SQL
-echo "Dump table create in ???"
+echo "Dump table create in adminlog_table_backup_1135"
mysql $mysql_opt <<- 'SQL'
-- update table admin log
UPDATE `adminlog` SET `type` = 'old name or dob change',
-`information` = 'see dump ???'
+`information` = 'see adminlog_table_backup_1135';
-- alter table admin log