Skip to content

Commit 7e73bab

Browse files
committed
fix: getMigrationName() does not take care of underscore seperator
1 parent 351277e commit 7e73bab

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

system/Database/MigrationRunner.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,14 +538,18 @@ protected function getMigrationNumber(string $migration): string
538538
}
539539

540540
/**
541-
* Extracts the migration class name from a filename
541+
* Extracts the migration name from a filename
542+
*
543+
* Note: The migration name should be the classname, but maybe they are
544+
* different.
545+
*
546+
* @param string $migration A migration filename w/o path.
542547
*/
543548
protected function getMigrationName(string $migration): string
544549
{
545550
$parts = explode('_', $migration);
546-
array_shift($parts);
547551

548-
return implode('_', $parts);
552+
return array_pop($parts);
549553
}
550554

551555
/**

0 commit comments

Comments
 (0)