Passed
Push — master ( 465ddb...b25438 )
by Andrey
06:58
created

safeDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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