public function actionCreate(RequestApplicationInterface $app, $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);
        // Abort if name is too long
        $nameLimit = $this->getMigrationNameLimit();
        if ($nameLimit !== null && strlen($className) > $nameLimit) {
            throw new Exception('The migration name is too long.');
        }

        $migrationPath = $this->findMigrationPath($namespace);

        $file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php';
        return $this->confirm("Create new migration '$file'?")->then(
            function() use ($app, $name, $className, $namespace, $migrationPath, $file) {
                $content = $this->generateMigrationSourceCode([
                    'name' => $name,
                    'className' => $className,
                    'namespace' => $namespace,
                ], $app);
                FileHelper::createDirectory($migrationPath);
                file_put_contents($file, $content, LOCK_EX);
                $this->stdout("New migration created successfully.\n", Console::FG_GREEN);
                return true;
            }
        );
    }