Completed
Push — master ( 193986...cdf399 )
by Andrey
11:47
created

m180602_095657_create_contacts_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 29
c 0
b 0
f 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 17 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `contacts`.
7
 */
8
class m180602_095657_create_contacts_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->createTable('contacts',
16
            [
17
                'id' => $this->primaryKey(),
18
                'title' => $this->string()->notNull(),
19
                'address' => $this->string(128),
20
                'email' => $this->string(64),
21
                'phone' => $this->string(32),
22
                'metaKeys' => $this->string()->notNull(),
23
                'metaDescription' => $this->string()->notNull(),
24
                'default' => $this->tinyInteger(1)->defaultValue(0),
25
                'created_at' => $this->dateTime(),
26
                'updated_at' => $this->dateTime(),
27
            ]
28
        );
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function safeDown()
35
    {
36
        $this->dropTable('contacts');
37
    }
38
}
39