m180110_204953_create_account_table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

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