protected function _copyMigrations()
{
$this->stdout("Copy the migration files in a single directory\n", Console::FG_YELLOW);
$tmpMigrateDir = \Yii::getAlias($this->_runtimeMigrationPath);
FileHelper::removeDirectory($tmpMigrateDir);
FileHelper::createDirectory($tmpMigrateDir);
if (!is_dir($tmpMigrateDir)) {
$this->stdout("Could not create a temporary directory migration\n");
die;
}
$this->stdout("\tCreated a directory migration\n");
if ($dirs = $this->_findMigrationDirs()) {
foreach ($dirs as $path) {
FileHelper::copyDirectory($path, $tmpMigrateDir);
}
}
$this->stdout("\tThe copied files modules migrations\n");
$appMigrateDir = \Yii::getAlias("@console/migrations");
if (is_dir($appMigrateDir)) {
FileHelper::copyDirectory($appMigrateDir, $tmpMigrateDir);
}
$this->stdout("\tThe copied files app migrations\n\n");
}