diff --git a/migrations/m161109_104201_rename_setting_table.php b/migrations/m161109_104201_rename_setting_table.php index 983d251..3384ea6 100644 --- a/migrations/m161109_104201_rename_setting_table.php +++ b/migrations/m161109_104201_rename_setting_table.php @@ -6,22 +6,15 @@ class m161109_104201_rename_setting_table extends Migration { public function up() { - $this->renameTable('{{%Setting}}', '{{%setting}}'); + if (Yii::$app->db->schema->getTableSchema('setting') === null) { + $this->renameTable('{{%Setting}}', '{{%setting}}'); + } } public function down() { - $this->renameTable('{{%setting}}', '{{%Setting}}'); + if (Yii::$app->db->schema->getTableSchema('Setting') === null) { + $this->renameTable('{{%setting}}', '{{%Setting}}'); + } } - - /* - // Use safeUp/safeDown to run migration code within a transaction - public function safeUp() - { - } - - public function safeDown() - { - } - */ -} +} \ No newline at end of file