safeDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Class m200917_064807_create_exclude_from_stats_column
7
 */
8
class m200917_064807_create_exclude_from_stats_column extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->addColumn('{{%record}}', 'exclude_from_stats', $this->tinyInteger()->defaultValue(0)->after('source'));
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function safeDown()
22
    {
23
        echo "m200917_064807_create_exclude_from_stats_column cannot be reverted.\n";
24
        $this->dropColumn('{{%record}}', 'exclude_from_stats');
25
        return true;
26
    }
27
28
    /*
29
    // Use up()/down() to run migration code without a transaction.
30
    public function up()
31
    {
32
33
    }
34
35
    public function down()
36
    {
37
        echo "m200917_064807_create_exclude_from_stats_column cannot be reverted.\n";
38
39
        return false;
40
    }
41
    */
42
}
43