Skip to content

Commit

Permalink
Manually sort migrations found instead of relying on the OS to do so …
Browse files Browse the repository at this point in the history
…for us. Fixes #1666
  • Loading branch information
lonnieezell committed Feb 19, 2019
1 parent 20527d9 commit e557f41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions system/Database/MigrationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ public function findMigrations()
}
}

ksort($migrations);

return $migrations;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/system/Database/Migrations/MigrationRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ public function testFindMigrationsSuccessTimestamp()
$migrations = $runner->findMigrations();

$this->assertCount(2, $migrations);
$this->assertEquals($mig1, array_shift($migrations));
$this->assertEquals($mig2, array_shift($migrations));
$this->assertEquals($mig1, array_shift($migrations));
}

public function testFindMigrationsSuccessOrder()
Expand Down Expand Up @@ -211,8 +211,8 @@ public function testFindMigrationsSuccessOrder()

$migrations = $runner->findMigrations();

$this->assertEquals($mig1, array_shift($migrations));
$this->assertEquals($mig2, array_shift($migrations));
$this->assertEquals($mig1, array_shift($migrations));
}

/**
Expand Down

0 comments on commit e557f41

Please sign in to comment.