From db9d270de72f1fa963365c197188836037d99365 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Fri, 28 Mar 2014 14:56:49 +0100 Subject: [PATCH] fixing alternc-awstats upgrade SQL error + fixing error in upgrade check for mysql --- awstats/awstats.sql | 4 ++-- install/upgrade_check.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awstats/awstats.sql b/awstats/awstats.sql index b4e649d8..cb4766c9 100644 --- a/awstats/awstats.sql +++ b/awstats/awstats.sql @@ -3,6 +3,8 @@ CREATE TABLE IF NOT EXISTS `aws` ( `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL default '0', `hostname` varchar(255) NOT NULL default '', + `public` INT(1) unsigned NOT NULL DEFAULT '1', + `hostaliases` TEXT, PRIMARY KEY (`id`) ) Engine=MyISAM COMMENT='Statistiques web par Awstats'; @@ -24,5 +26,3 @@ CREATE TABLE IF NOT EXISTS `aws_access` ( INDEX (`id`) ) COMMENT = 'Qui peut accéder aux stats awstats '; -ALTER TABLE `aws` ADD `public` INT(1) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `aws` ADD `hostaliases` TEXT ; diff --git a/install/upgrade_check.sh b/install/upgrade_check.sh index 88502e2d..4b86d847 100755 --- a/install/upgrade_check.sh +++ b/install/upgrade_check.sh @@ -21,7 +21,7 @@ get_ext() { # Reading the current version in the DB. # If the DB exist but the alternc_status table doesn't, we will initialize it below # In that case we search where we upgrade from in /var/lib/alternc/backups/lastversion from debian.postinstall script -oldvers="`mysql --defaults-file=/etc/alternc/my.cnf --skip-column-names -e "SELECT value FROM alternc_status WHERE name='alternc_version'"||true`" +oldvers="`mysql --defaults-file=/etc/alternc/my.cnf --skip-column-names -e "SELECT value FROM alternc_status WHERE name='alternc_version'" 2>/dev/null||true`" if [ -z "$oldvers" ] then # no version number, we check from /var/lib/alternc