Passed
Pull Request — master (#5)
by
unknown
14:27
created

m180602_095657_create_contacts_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Methods

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