From e34a51f853eb62d0113c6ceaed9ba2e6b4bf85dc Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 6 Oct 2010 11:29:28 -0400 Subject: [PATCH] Note that these upgrades are one way, some ws fixes, reset the style table on downgrade. --- ansel/migration/3_ansel_upgrade_style.php | 10 ++++++++-- ansel/migration/4_ansel_upgrade_tagstocontent.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ansel/migration/3_ansel_upgrade_style.php b/ansel/migration/3_ansel_upgrade_style.php index 9f661adda..59ffbc2c7 100644 --- a/ansel/migration/3_ansel_upgrade_style.php +++ b/ansel/migration/3_ansel_upgrade_style.php @@ -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'); } diff --git a/ansel/migration/4_ansel_upgrade_tagstocontent.php b/ansel/migration/4_ansel_upgrade_tagstocontent.php index 1d6add04b..8adc658de 100644 --- a/ansel/migration/4_ansel_upgrade_tagstocontent.php +++ b/ansel/migration/4_ansel_upgrade_tagstocontent.php @@ -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 -- 2.11.0