m180823_193925_clean_identity_table::safeDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace flipbox\saml\sp\migrations;
4
5
use craft\db\Migration;
6
use flipbox\saml\sp\records\ProviderIdentityRecord;
7
8
/**
9
 * m180823_193925_clean_identity_table migration.
10
 */
11
class m180823_193925_clean_identity_table extends Migration
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function safeUp()
17
    {
18
        /**
19
         * We have to do this due to the name id be saved wrongly.
20
         */
21
        ProviderIdentityRecord::deleteAll();
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function safeDown()
28
    {
29
        echo "m180823_193925_clean_identity_table cannot be reverted.\n";
30
        return false;
31
    }
32
}
33