mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
ensure backwards compatibiliy with migration without $compact
See https://github.com/yiisoft/yii2/pull/14474#discussion_r135237472
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
namespace yii\console\controllers;
|
||||
|
||||
use Yii;
|
||||
use yii\base\BaseObject;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\base\NotSupportedException;
|
||||
use yii\console\Controller;
|
||||
@ -759,7 +760,11 @@ abstract class BaseMigrateController extends Controller
|
||||
protected function createMigration($class)
|
||||
{
|
||||
$this->includeMigrationFile($class);
|
||||
return new $class(['compact' => $this->compact]);
|
||||
$migration = new $class();
|
||||
if ($migration instanceof BaseObject && $migration->canSetProperty('compact')) {
|
||||
$migration->compact = $this->compact;
|
||||
}
|
||||
return $migration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user