From 1ecadb826c9c274121d3c4548285d3aba24bc40f Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Sat, 21 Jan 2012 13:34:45 +0000 Subject: [PATCH] Sort outstanding tasks by filename --- laravel/cli/tasks/migrate/resolver.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/laravel/cli/tasks/migrate/resolver.php b/laravel/cli/tasks/migrate/resolver.php index 7b7d2537..97f0eb46 100644 --- a/laravel/cli/tasks/migrate/resolver.php +++ b/laravel/cli/tasks/migrate/resolver.php @@ -127,6 +127,14 @@ protected function resolve($migrations) $instances[] = compact('bundle', 'name', 'migration'); } + // At this point the migrations are only sorted within their + // bundles so we need to re-sort them by name to ensure they + // are in a consistent order. + usort($migrations, function($a, $b) + { + return strcmp($a['name'], $b['name']); + }); + return $instances; }