m161109_092304_rename_comment_table   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 5
c 3
b 1
f 0
dl 0
loc 13
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 4 2
A down() 0 4 2
1
<?php
2
3
use yii\db\Migration;
4
5
class m161109_092304_rename_comment_table extends Migration
6
{
7
    public function up()
8
    {
9
        if (null === Yii::$app->db->schema->getTableSchema('{{%comment}}')) {
10
            $this->renameTable('{{%Comment}}', '{{%comment}}');
11
        }
12
    }
13
14
    public function down()
15
    {
16
        if (null === Yii::$app->db->schema->getTableSchema('{{%Comment}}')) {
17
            $this->renameTable('{{%comment}}', '{{%Comment}}');
18
        }
19
    }
20
}
21