m161109_112016_rename_user_table   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
rs 10

2 Methods

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