m190314_073617_add_avilable_to_ad_table::safeUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Class m190314_073617_add_avilable_to_ad_table
7
 */
8
class m190314_073617_add_avilable_to_ad_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->addColumn('{{%ad}}', 'available_from', $this->integer()->comment('开始投放时间'));
16
        $this->addColumn('{{%ad}}', 'available_to', $this->integer()->comment('结束投放时间'));
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function safeDown()
23
    {
24
        $this->dropColumn('{{%ad}}', 'available_from');
25
        $this->dropColumn('{{%ad}}', 'available_to');
26
    }
27
}
28