Passed
Branch master (ecb7f7)
by Andrey
17:46
created

m171230_122107_create_users_table::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
nc 1
nop 0
dl 0
loc 17
c 0
b 0
f 0
cc 1
rs 9.7666
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