Passed
Push — master ( 09d163...3c33c7 )
by Andrey
14:44
created

m180602_095657_create_contacts_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 16 1
A safeDown() 0 3 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(128)->notNull(),
19
                'address' => $this->string(128),
20
                'email' => $this->string(128),
21
                'phone' => $this->string(128),
22
                'mapQ' => $this->string(128),
23
                'mapZoom' => $this->tinyInteger(),
24
                'metaKeys' => $this->string(128)->notNull(),
25
                'metaDescription' => $this->string()->notNull(),
26
                'default' => $this->tinyInteger()->defaultValue(0),
27
                'created_at' => $this->dateTime(),
28
                'updated_at' => $this->dateTime(),
29
            ]
30
        );
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function safeDown()
37
    {
38
        $this->dropTable('contacts');
39
    }
40
}
41