Passed
Push — master ( b2168e...f1daef )
by Paweł
03:26
created

safeDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles adding is_business to table `{{%account}}`.
7
 */
8
class m190513_085909_add_is_business_column_to_account_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->addColumn('{{%account}}', 'is_business', $this->boolean()->defaultValue(0));
16
        $this->addColumn('{{%account}}', 'business_category', $this->string());
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function safeDown()
23
    {
24
        $this->dropColumn('{{%account}}', 'is_business');
25
        $this->dropColumn('{{%account}}', 'business_category');
26
    }
27
}
28