Passed
Branch master (67bfd3)
by Andrey
03:27
created

safeUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `owners_albums`.
7
 */
8
class m180220_082911_create_owners_albums_table extends Migration
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function safeUp()
14
    {
15
        $this->createTable('owners_albums', [
16
            'albumId' => $this->integer()->notNull(),
0 ignored issues
show
Bug introduced by
The method integer() does not exist on m180220_082911_create_owners_albums_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
            'albumId' => $this->/** @scrutinizer ignore-call */ integer()->notNull(),
Loading history...
17
            'ownerId' => $this->integer()->notNull(),
18
            'owner' => $this->string(64)->notNull(),
0 ignored issues
show
Bug introduced by
The method string() does not exist on m180220_082911_create_owners_albums_table. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
            'owner' => $this->/** @scrutinizer ignore-call */ string(64)->notNull(),
Loading history...
19
            'ownerAttribute' => $this->string(64)->notNull(),
20
            'PRIMARY KEY (`albumId`, `ownerId`, `owner`, `ownerAttribute`)',
21
        ]);
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function safeDown()
28
    {
29
        $this->dropTable('owners_albums');
30
    }
31
}
32