m180910_142234_craft3_upgrade   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeDown() 0 4 1
A safeUp() 0 5 1
1
<?php
2
3
namespace dukt\social\migrations;
4
5
use Craft;
6
use craft\db\Migration;
7
use dukt\social\elements\LoginAccount;
8
9
/**
10
 * m180910_142234_craft3_upgrade migration.
11
 */
12
class m180910_142234_craft3_upgrade extends Migration
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public function safeUp()
18
    {
19
        $this->update('{{%elements}}', [
20
            'type' => LoginAccount::class
21
        ], ['type' => 'Social_LoginAccount']);
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function safeDown()
28
    {
29
        echo "m180910_142234_craft3_upgrade cannot be reverted.\n";
30
        return false;
31
    }
32
}
33