We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e73bab commit e655969Copy full SHA for e655969
1 file changed
system/Database/MigrationRunner.php
@@ -67,7 +67,7 @@ class MigrationRunner
67
*
68
* @var string
69
*/
70
- protected $regex = '/^\d{4}[_-]?\d{2}[_-]?\d{2}[_-]?\d{6}_(\w+)$/';
+ protected $regex = '/\A(\d{4}[_-]?\d{2}[_-]?\d{2}[_-]?\d{6})_(\w+)\z/';
71
72
/**
73
* The main database connection. Used to store
@@ -547,9 +547,9 @@ protected function getMigrationNumber(string $migration): string
547
548
protected function getMigrationName(string $migration): string
549
{
550
- $parts = explode('_', $migration);
+ preg_match($this->regex, $migration, $matches);
551
552
- return array_pop($parts);
+ return count($matches) ? $matches[2] : '';
553
}
554
555
0 commit comments