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

m180531_170328_create_technologies_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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