fixed migrate create failed

This commit is contained in:
JaguarJack 2020-04-23 19:47:00 +08:00
parent fbbfc70d39
commit 3f888f909a

View File

@ -62,7 +62,7 @@ class MigrateCreateCommand extends Create
*/ */
protected function create($module, $className): string protected function create($module, $className): string
{ {
$path = CatchAdmin::moduleMigrationsDirectory($module); $path = CatchAdmin::makeDirectory(CatchAdmin::moduleMigrationsDirectory($module));
if (!Util::isValidPhinxClassName($className)) { if (!Util::isValidPhinxClassName($className)) {
throw new InvalidArgumentException(sprintf('The migration class name "%s" is invalid. Please use CamelCase format.', $className)); throw new InvalidArgumentException(sprintf('The migration class name "%s" is invalid. Please use CamelCase format.', $className));
@ -74,6 +74,7 @@ class MigrateCreateCommand extends Create
// Compute the file path // Compute the file path
$fileName = Util::mapClassNameToFileName($className); $fileName = Util::mapClassNameToFileName($className);
$filePath = $path . DIRECTORY_SEPARATOR . $fileName; $filePath = $path . DIRECTORY_SEPARATOR . $fileName;
if (is_file($filePath)) { if (is_file($filePath)) {