Skip to content

Commit

Permalink
fix issue 'table already exists' for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-chepurnoi committed Nov 11, 2016
1 parent 4ab2c48 commit ef8d752
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions migrations/m161109_104201_rename_setting_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
}
*/
}
}

0 comments on commit ef8d752

Please sign in to comment.