From 7ed9e5f99bed130b23b446b9a00cf8ee549de863 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Mon, 14 Dec 2009 11:02:55 -0500 Subject: [PATCH] If we don't set _targetVersion to null, re-use of a Migrator object won't work as expected. --- framework/Db/lib/Horde/Db/Migration/Migrator.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/framework/Db/lib/Horde/Db/Migration/Migrator.php b/framework/Db/lib/Horde/Db/Migration/Migrator.php index f1194e5cc..8443959c4 100644 --- a/framework/Db/lib/Horde/Db/Migration/Migrator.php +++ b/framework/Db/lib/Horde/Db/Migration/Migrator.php @@ -96,9 +96,7 @@ class Horde_Db_Migration_Migrator */ public function up($targetVersion = null) { - if (!is_null($targetVersion)) { - $this->_targetVersion = $targetVersion; - } + $this->_targetVersion = $targetVersion; $this->_direction = 'up'; $this->_doMigrate(); } @@ -108,9 +106,7 @@ class Horde_Db_Migration_Migrator */ public function down($targetVersion = null) { - if (!is_null($targetVersion)) { - $this->_targetVersion = $targetVersion; - } + $this->_targetVersion = $targetVersion; $this->_direction = 'down'; $this->_doMigrate(); } @@ -262,5 +258,4 @@ class Horde_Db_Migration_Migrator return ($this->_isUp() && $version <= self::getCurrentVersion()) || ($this->_isDown() && $version > self::getCurrentVersion()); } - } -- 2.11.0