Don't simply sort migration scripts by name, this is going to break when we
authorJan Schneider <jan@horde.org>
Wed, 26 Jan 2011 16:56:25 +0000 (17:56 +0100)
committerJan Schneider <jan@horde.org>
Wed, 26 Jan 2011 16:56:25 +0000 (17:56 +0100)
have schema versions with several digits.

framework/Db/lib/Horde/Db/Migration/Migrator.php

index fa918ce..82fb391 100644 (file)
@@ -178,7 +178,7 @@ class Horde_Db_Migration_Migrator
         }
 
         // Sort by version.
-        ksort($migrations);
+        uksort($migrations, 'strnatcmp');
         $sorted = array_values($migrations);
 
         return $this->_isDown() ? array_reverse($sorted) : $sorted;