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 507574c commit 0ab0f7b
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions migrations/m161109_105445_rename_cms_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ class m161109_105445_rename_cms_table extends Migration
{
public function up()
{
$this->renameTable('{{%Cms}}', '{{%cms}}');
if (Yii::$app->db->schema->getTableSchema('cms') === null) {
$this->renameTable('{{%Cms}}', '{{%cms}}');
}
}

public function down()
{
$this->renameTable('{{%cms}}', '{{%Cms}}');
if (Yii::$app->db->schema->getTableSchema('Cms') === null) {
$this->renameTable('{{%cms}}', '{{%Cms}}');
}
}

/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}
}

0 comments on commit 0ab0f7b

Please sign in to comment.