Note that these upgrades are one way, some ws fixes, reset the style table on downgrade.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 6 Oct 2010 15:29:28 +0000 (11:29 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 6 Oct 2010 15:30:09 +0000 (11:30 -0400)
ansel/migration/3_ansel_upgrade_style.php
ansel/migration/4_ansel_upgrade_tagstocontent.php

index 9f661ad..59ffbc2 100644 (file)
@@ -18,7 +18,7 @@ class AnselUpgradeStyle extends Horde_Db_Migration_Base
     {
         $GLOBALS['registry']->pushApp('ansel');
         $this->changeColumn('ansel_shares', 'attribute_style', 'text');
-        
+
         // Create: ansel_hashes
         $tableList = $this->tables();
         if (!in_array('ansel_hashes', $tableList)) {
@@ -26,7 +26,7 @@ class AnselUpgradeStyle extends Horde_Db_Migration_Base
             $t->column('style_hash', 'string', array('limit' => 255));
             $t->end();
         }
-        
+
         // Make sure we have the full styles array.
         require ANSEL_BASE . '/config/styles.php';
 
@@ -72,8 +72,14 @@ class AnselUpgradeStyle extends Horde_Db_Migration_Base
         }
     }
 
+    /**
+     * Downgrade, though all style information will be lost and reverted to
+     * 'ansel_default'.
+     */
     public function down()
     {
+        $sql = "UPDATE ansel_shares set attribute_style = 'ansel_default'";
+        $this->_connection->execute($sql);
         $this->changeColumn('ansel_shares', 'attribute_style', 'string',  array('limit' => 255));
         $this->dropTable('ansel_hashes');
     }
index 1d6add0..8adc658 100644 (file)
@@ -56,7 +56,7 @@ class AnselUpgradeTagsToContent extends Horde_Db_Migration_Base
 
     public function down()
     {
-        // TODO
+        // Not supported. One way upgrade.
     }
 
 }
\ No newline at end of file