Completed
Push — master ( 6494b1...504660 )
by Igor
02:00
created

m161109_124936_rename_cart_table::down()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
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