Passed
Branch master (ecb7f7)
by Andrey
17:46
created

m180602_191217_create_social_table::safeUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
nc 1
nop 0
dl 0
loc 8
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `social`.
7
 */
8
class m180602_191217_create_social_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->createTable('social', [
16
            'id' => $this->primaryKey(),
17
            'icon' => $this->string(128)->notNull(),
18
            'url' => $this->string()->notNull(),
19
            'created_at' => $this->dateTime(),
20
            'updated_at' => $this->dateTime(),
21
        ]);
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function safeDown()
28
    {
29
        $this->dropTable('social');
30
    }
31
}
32