We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 052fc7f commit 056dc46Copy full SHA for 056dc46
migrations/m161109_092304_rename_comment_table.php
@@ -6,22 +6,15 @@ class m161109_092304_rename_comment_table extends Migration
6
{
7
public function up()
8
9
- $this->renameTable('{{%Comment}}', '{{%comment}}');
+ if (Yii::$app->db->schema->getTableSchema('comment') === null) {
10
+ $this->renameTable('{{%Comment}}', "{{%comment}}");
11
+ }
12
}
13
14
public function down()
15
- $this->renameTable('{{%comment}}', '{{%Comment}}');
16
+ if (Yii::$app->db->schema->getTableSchema('Comment') === null) {
17
+ $this->renameTable('{{%comment}}', '{{%Comment}}');
18
19
-
- /*
- // Use safeUp/safeDown to run migration code within a transaction
- public function safeUp()
20
- {
21
- }
22
23
- public function safeDown()
24
25
26
- */
27
-}
+}
0 commit comments