Passed
Push — master ( 74d8e9...36c944 )
by Benjamin
13:38 queued 09:09
created

m180910_103838_craft3_upgrade   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 20
rs 10
c 0
b 0
f 0
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()
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()
29
    {
30
        echo "m180910_103838_craft3_upgrade cannot be reverted.\n";
31
        return false;
32
    }
33
}
34