Passed
Branch master (3c33c7)
by Andrey
04:31
created

m180603_123208_create_home_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 28
c 0
b 0
f 0
rs 10
wmc 2

2 Methods

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