m161109_124936_rename_cart_table::down()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m161109_124936_rename_cart_table extends Migration
6
{
7
    public function up()
8
    {
9
        if (Yii::$app->db->schema->getTableSchema('cart') === null) {
10
            $this->renameTable('{{%Cart}}', '{{%cart}}');
11
        }
12
    }
13
14
    public function down()
15
    {
16
        if (Yii::$app->db->schema->getTableSchema('Cart') === null) {
17
            $this->renameTable('{{%cart}}', '{{%Cart}}');
18
        }
19
    }
20
}
21