Skip to content

Commit

Permalink
Accept description in the migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Jul 12, 2023
1 parent 89b72d4 commit 7c989f8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getMigrationSql($version, $increment)
. "/*.sql";

$result = array_filter(glob($filePattern), function ($file) use ($version) {
return preg_match("/^0*$version(-dev)?\.sql$/", basename($file));
return preg_match("/^0*$version(-[\w\d-]*)?\.sql$/", basename($file));
});

// Valid values are 0 or 1
Expand Down
2 changes: 1 addition & 1 deletion tests/MigrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testGetMigrationSql3()
public function testGetMigrationSql4()
{
$this->expectException(InvalidMigrationFile::class);
$this->expectExceptionMessage("version number '13'");
$this->expectExceptionMessage("You have two files with the same version number '13'");
$this->object->getMigrationSql(13, 1);
}

Expand Down
File renamed without changes.

0 comments on commit 7c989f8

Please sign in to comment.