Passed
Branch master (b11977)
by Charles
02:33
created

m000000_000000_api_user::safeDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use yii\db\Migration;
0 ignored issues
show
Bug introduced by
The type yii\db\Migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
5
class m000000_000000_api_user extends Migration
6
{
7
    /**
8
     * @inheritdoc
9
     */
10
    public function safeUp()
11
    {
12
        $this->createTable('user', [
13
            'id'                => $this->primaryKey(),
14
            'email'             => $this->string(255)->notNull(),
15
            'username'          => $this->string(255)->notNull(),
16
            'password'          => $this->string(255)->notNull(),
17
            'verified'          => $this->integer()->defaultValue(0),
18
            'otp_secret'        => $this->string(600),
19
            'otp_enabled'       => $this->integer()->defaultValue(0),
20
            'created_at'        => $this->integer(),
21
            'updated_at'        => $this->integer()
22
        ]);
23
        
24
        $this->createIndex('user__email_unique_index', 'user', ['email'], true);
25
        $this->createIndex('user__username_unique_index', 'user', ['username'], true);
26
    }
27
    
28
    /**
29
     * @inheritdoc
30
     */
31
    public function safeDown()
32
    {
33
        $this->dropTable('user');
34
    }
35
}