Test Failed
Pull Request — master (#5)
by Carlos
03:57
created

getTableName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
use roaresearch\yii2\rmdb\migrations\CreateEntity;
4
5
class m170101_000004_workflow_transition_permission extends CreateEntity
6
{
7
    /**
8
     * @inhertidoc
9
     */
10
    public function getTableName(): string
11
    {
12
        return 'workflow_transition_permission';
13
    }
14
15
    /**
16
     * @inhertidoc
17
     */
18
    public function columns(): array
19
    {
20
        return [
21
            'source_stage_id' => $this->normalKey(),
22
            'target_stage_id' => $this->normalKey(),
23
            'permission' => $this->string()->notNull(),
24
        ];
25
    }
26
27
    /**
28
     * @inhertidoc
29
     */
30
    public function foreignKeys(): array
31
    {
32
        return [
33
            'transition' => [
34
                'table' => 'workflow_transition',
35
                'columns' => [
36
                    'source_stage_id' => 'source_stage_id',
37
                    'target_stage_id' => 'target_stage_id',
38
                ]
39
            ],
40
        ];
41
    }
42
43
    /**
44
     * @inhertidoc
45
     */
46
    public function compositePrimaryKeys(): array
47
    {
48
        return ['source_stage_id', 'target_stage_id', 'permission'];
49
    }
50
}
51