m180910_103838_craft3_upgrade   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 6 1
A safeDown() 0 4 1
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