Completed
Pull Request — master (#6)
by zacksleo
04:38
created

m190314_073617_add_avilable_to_ad_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 5 1
A safeDown() 0 5 1
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