m170608_141511_rename_columns::safeUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m170608_141511_rename_columns extends Migration
6
{
7 View Code Duplication
    public function safeUp()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
    {
9
        $this->renameColumn('{{%user}}', 'passwordHash', 'password_hash');
10
        $this->renameColumn('{{%user}}', 'passwordResetToken', 'password_reset_token');
11
        $this->renameColumn('{{%user}}', 'authKey', 'auth_key');
12
        $this->renameColumn('{{%user}}', 'lastLogin', 'last_login');
13
        $this->renameColumn('{{%user}}', 'createdAt', 'created_at');
14
        $this->renameColumn('{{%user}}', 'updatedAt', 'updated_at');
15
    }
16
17 View Code Duplication
    public function safeDown()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19
        $this->renameColumn('{{%user}}', 'password_hash', 'passwordHash');
20
        $this->renameColumn('{{%user}}', 'password_reset_token', 'passwordResetToken');
21
        $this->renameColumn('{{%user}}', 'auth_key', 'authKey');
22
        $this->renameColumn('{{%user}}', 'last_login', 'lastLogin');
23
        $this->renameColumn('{{%user}}', 'created_at', 'createdAt');
24
        $this->renameColumn('{{%user}}', 'updated_at', 'updatedAt');
25
    }
26
}
27