m180110_204953_create_account_table::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 13
rs 9.9
c 1
b 0
f 0
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