m180910_103838_craft3_upgrade::safeUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace dukt\videos\migrations;
4
5
use Craft;
6
use craft\db\Migration;
7
use dukt\videos\fields\Video;
8
9
/**
10
 * m180910_103838_craft3_upgrade migration.
11
 */
12
class m180910_103838_craft3_upgrade extends Migration
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public function safeUp(): void
18
    {
19
        // Place migration code here...
20
        $this->update('{{%fields}}', [
21
            'type' => Video::class
22
        ], ['type' => 'Videos_Video']);
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function safeDown(): bool
29
    {
30
        echo "m180910_103838_craft3_upgrade cannot be reverted.\n";
31
        return false;
32
    }
33
}
34