Passed
Pull Request — master (#3)
by
unknown
15:40
created

m171230_122107_create_users_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 31
c 0
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 3 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `users`.
7
 */
8
class m171230_122107_create_users_table extends Migration
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function up()
14
    {
15
        $this->createTable('users', [
16
            'id' => $this->primaryKey(),
17
            'first_name' => $this->string(64),
18
            'last_name' => $this->string(64),
19
            'patronymic' => $this->string(64),
20
            'login' => $this->string(64),
21
            'email' => $this->string(64),
22
            'phone' => $this->string(64),
23
            'hashedPassword' => $this->string(),
24
            'status' => $this->tinyInteger(),
25
            'public' => $this->tinyInteger(),
26
            'order' => $this->tinyInteger(),
27
            'about' => $this->text(),
28
            'created_at' => $this->dateTime(),
29
            'updated_at' => $this->dateTime(),
30
        ]);
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function down()
37
    {
38
        $this->dropTable('users');
39
    }
40
}
41