Completed
Push — master ( 9a2843...3c69ee )
by Jeff
03:06
created

m170210_155249_update_screen_template_fk::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 17
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m170210_155249_update_screen_template_fk extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    public function up()
8
    {
9
        $this->dropForeignKey(
10
            'fk_screen_template_template_background1',
11
            'screen_template'
12
        );
13
14
        $this->addForeignKey(
15
            'fk_screen_template_template_background1',
16
            'screen_template',
17
            'background_id',
18
            'template_background',
19
            'id',
20
            'SET NULL',
21
            'SET NULL'
22
        );
23
    }
24
25
    public function down()
26
    {
27
        $this->dropForeignKey(
28
            'fk_screen_template_template_background1',
29
            'screen_template'
30
        );
31
32
        $this->addForeignKey(
33
            'fk_screen_template_template_background1',
34
            'screen_template',
35
            'background_id',
36
            'template_background',
37
            'id',
38
            'CASCADE',
39
            'CASCADE'
40
        );
41
    }
42
}
43