m180126_183432_create_user_table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

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