From daf7e5b71fcc56159f75cebd9beede064b788381 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Tue, 22 Jan 2013 14:36:37 +0000 Subject: [PATCH] Moving the upgrade processes before the database update since operations wanted to take place before the sql collumns and tables are actually up to date with the new version --- debian/alternc.postinst | 17 +++++++++-------- install/upgrades/1.1.sql | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/debian/alternc.postinst b/debian/alternc.postinst index 1a02ffee..6d61e614 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -146,6 +146,15 @@ EOF sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE + # Erase all apacheconf file + # They will be regenerated without the bug by upgrade_check.sh below. + if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then + rm -f /var/alternc/apacheconf/*/* + fi + + echo "checking for upgrades" + /usr/share/alternc/install/upgrade_check.sh $2 + # Setup grants db_get "alternc/mysql/host" MYSQL_HOST="$RET" @@ -205,14 +214,6 @@ EOF FQDN_LETTER="_" fi - # Erase all apacheconf file - # They will be regenerated without the bug by upgrade_check.sh below. - if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then - rm -f /var/alternc/apacheconf/*/* - fi - - echo "checking for upgrades" - /usr/share/alternc/install/upgrade_check.sh $2 echo "config phpmyadmin" # Mise à jour sur une configuration existante diff --git a/install/upgrades/1.1.sql b/install/upgrades/1.1.sql index 6033a7b4..ec1da221 100644 --- a/install/upgrades/1.1.sql +++ b/install/upgrades/1.1.sql @@ -121,7 +121,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` ( -- -- Other recipients for an address (aliases) -CREATE TABLE `recipient` ( +CREATE TABLE IF NOT EXISTS `recipient` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, -- Technical id. `address_id` bigint(20) unsigned NOT NULL REFERENCES `address`(`id`), -- Reference to address `recipients` text NOT NULL, -- Recipients