Passed
Push — master ( fb230b...cd53a6 )
by M. Mikkel
06:13
created

m200720_180000_craft3::safeUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
namespace mmikkel\cacheflag\migrations;
4
5
use yii\db\Migration;
6
7
class m200720_180000_craft3 extends Migration
8
{
9
    public function safeUp()
10
    {
11
        $tableSchema = \Craft::$app->db->schema->getTableSchema('{{%cacheflag_flags}}');
12
        if ($tableSchema === null) {
13
            $installMigration = new Install();
14
            return $installMigration->safeUp();
15
        }
16
        return true;
17
    }
18
}
19