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

m181006_155930_chg_account_stats_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeDown() 0 4 1
A safeUp() 0 4 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Class m181006_155930_chg_account_stats_table
7
 */
8
class m181006_155930_chg_account_stats_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->addColumn('account_stats', 'avg_likes', $this->money());
16
        $this->addColumn('account_stats', 'avg_comments', $this->money());
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function safeDown()
23
    {
24
        $this->dropColumn('account_stats', 'avg_likes');
25
        $this->dropColumn('account_stats', 'avg_comments');
26
    }
27
}
28