From: Chuck Hagenbuch Date: Mon, 14 Dec 2009 16:02:55 +0000 (-0500) Subject: If we don't set _targetVersion to null, re-use of a Migrator object won't work as... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7ed9e5f99bed130b23b446b9a00cf8ee549de863;p=horde.git If we don't set _targetVersion to null, re-use of a Migrator object won't work as expected. --- 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()); } - }