If we don't set _targetVersion to null, re-use of a Migrator object won't work as...
authorChuck Hagenbuch <chuck@horde.org>
Mon, 14 Dec 2009 16:02:55 +0000 (11:02 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 14 Dec 2009 16:02:55 +0000 (11:02 -0500)
framework/Db/lib/Horde/Db/Migration/Migrator.php

index f1194e5..8443959 100644 (file)
@@ -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());
     }
-
 }