fixing alternc-awstats upgrade SQL error + fixing error in upgrade check for mysql

This commit is contained in:
Benjamin Sonntag 2014-03-28 14:56:49 +01:00
parent 48cee467fc
commit db9d270de7
2 changed files with 3 additions and 3 deletions

View File

@ -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 ;

View File

@ -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