public function actionCreate($name)
{
if (!preg_match('/^[\\w\\\\]+$/', $name)) {
throw new Exception('The migration name should contain letters, digits, underscore and/or backslash characters only.');
}
list($namespace, $className) = $this->generateClassName($name);
$migrationPath = $this->findMigrationPath($namespace);
$file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php';
if ($this->confirm("Create new migration '{$file}'?")) {
$content = $this->generateMigrationSourceCode(['name' => $name, 'className' => $className, 'namespace' => $namespace]);
FileHelper::createDirectory($migrationPath);
file_put_contents($file, $content);
$this->stdout("New migration created successfully.\n", Console::FG_GREEN);
}
}