Passed
Push — master ( 9657eb...3d91b6 )
by Benjamin
03:17
created

m190304_031715_soft_delete_users::safeDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace dukt\social\migrations;
4
5
use craft\db\Migration;
6
use craft\helpers\MigrationHelper;
7
8
/**
9
 * m190304_031715_soft_delete_users migration.
10
 */
11
class m190304_031715_soft_delete_users extends Migration
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function safeUp()
17
    {
18
        // Unique social UID should no longer be enforced by the DB to avoid conflicts with soft-deleted users.
19
        MigrationHelper::dropIndexIfExists('{{%social_login_accounts}}', ['providerHandle', 'socialUid'], true, $this);
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function safeDown()
26
    {
27
        echo "m190304_031715_soft_delete_users cannot be reverted.\n";
28
        return false;
29
    }
30
}
31