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

m170210_155249_update_screen_template_fk   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 38
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 17 1
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