Additional fixes to upgrade scripts.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 21 Oct 2009 11:44:55 +0000 (11:44 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 21 Oct 2009 11:44:55 +0000 (11:44 +0000)
CHANGELOG.txt
admin/inst_upgrade.php
sql/alter2.1.php
sql/alter2.2.php
sql/alter2.2rc.sql

index ecfaad53659d3bbc2cf9b18e65c8f58ecd408ec5..f41a6296dfc34570b60e1b7603ae8b7e644b5b02 100644 (file)
@@ -32,6 +32,7 @@ $ install.html
 $ /sql/alter2.1.php
   /sql/alter2.2.php
   /sql/alter2.2rc.sql (new)
+  /admin/inst_upgrade.php
 
 20-Oct-2009 Janusz Dobrowolski
 ! Conditional config files generation - prevents overwrite during upgrade.
index 20a056557e80d07fc16c263376f77b612ca7898a..9ef317ebebb0ae5a8b548a63a93c880c3174b2fd 100644 (file)
@@ -89,7 +89,6 @@ function upgrade_step($index, $conn)
        global $path_to_root, $installers;
 
        $inst = $installers[$index];
-       $sql = $inst->sql;
        $pref = $conn['tbpref'];
        $ret = true;
 
@@ -100,6 +99,7 @@ function upgrade_step($index, $conn)
                if (!$state || $force) 
                {
                        if (!$inst->pre_check($pref)) return false;
+                       $sql = $inst->sql;
 
                        if ($sql != '')
                                $ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);
index 9d932c9fdb39a44ba0332746c17e3a2c22819995..fae78321cf033afef1f53f61c4ca41eac340fd47 100644 (file)
 ***********************************************************************/
 class fa2_1 {
        var $version = '2.1';   // version installed
-       var $description = _('Upgrade from version 2.0 to 2.1');
+       var $description;
        var $sql = 'alter2.1.sql';
+
+       function fa2_1() {
+               $this->description = _('Upgrade from version 2.0 to 2.1');
+       }
        //
        //      Install procedure. All additional changes 
        //      not included in sql file should go here.
index c5dc619d9cc7ad28b33e01ca732f3bc4165b4e14..a1a4b1d5a5a5eeb66713613bad4280099ccb82b3 100644 (file)
 
 class fa2_2 {
        var $version = '2.2';   // version installed
-       var $description = _('Upgrade from version 2.1/2.2beta to 2.2');
+       var $description;
        var $sql = 'alter2.2.sql';
        var $preconf = true;
        var $beta = false; // upgrade from 2.1 or 2.2beta; set in pre_check
        
        function fa2_2() {
-
+               global $security_groups;
+               $this->beta = !isset($security_groups);
+               $this->description = _('Upgrade from version 2.1/2.2beta to 2.2');
                $this->preconf = fix_extensions();
        }
        
@@ -99,7 +101,6 @@ class fa2_2 {
        {       
                global $security_groups;
                
-               $this->beta = !isset($security_groups);
                if ($this->beta && !$force)
                        $this->sql = 'alter2.2rc.sql';
                return $this->beta || !check_table($pref, 'usersonline');
index 12dbb097294a48a68cebc702c75a6f631f4e5fa7..aff4c0a7cfedd408f8596cb131e293804171b60d 100644 (file)
@@ -1,8 +1,7 @@
 # Patch for upgrade from 2.2beta to 2.2RC/final
 
-ALTER TABLE `0_tag_associations` DROP PRIMARY KEY;
 ALTER TABLE `0_tag_associations` DROP COLUMN `id`;
-ALTER TABLE `0_tag_associations` ADD UNIQUE KEY (`type`,`name`);
+ALTER TABLE `0_tag_associations` ADD  UNIQUE KEY(`record_id`,`tag_id`);
 
 DROP TABLE IF EXISTS `0_useronline` ;