Passed
Push — master ( 9f850d...5c55bf )
by Paweł
03:12
created

m181006_154743_chg_account_table::safeUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 9
rs 10
c 1
b 0
f 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Class m181006_154743_chg_account_table
7
 */
8
class m181006_154743_chg_account_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->addColumn('account', 'followed_by', $this->integer());
16
        $this->addColumn('account', 'follows', $this->integer());
17
        $this->addColumn('account', 'media', $this->integer());
18
        $this->addColumn('account', 'er', $this->money());
19
        $this->addColumn('account', 'avg_likes', $this->money());
20
        $this->addColumn('account', 'avg_comments', $this->money());
21
        $this->addColumn('account', 'stats_updated_at', $this->dateTime());
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function safeDown()
28
    {
29
        $this->dropColumn('account', 'followed_by');
30
        $this->dropColumn('account', 'follows');
31
        $this->dropColumn('account', 'media');
32
        $this->dropColumn('account', 'er');
33
        $this->dropColumn('account', 'avg_likes');
34
        $this->dropColumn('account', 'avg_comments');
35
        $this->dropColumn('account', 'stats_updated_at');
36
    }
37
}
38