Passed
Push — master ( e24ae8...fb230b )
by M. Mikkel
05:45
created

m220620_191334_delete_cacheflag_flagged_database_table   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeDown() 0 4 1
A safeUp() 0 4 1
1
<?php
2
3
namespace mmikkel\cacheflag\migrations;
4
5
use craft\db\Migration;
6
7
/**
8
 * Class m220620_191334_delete_cacheflag_flagged_database_table
9
 * @package mmikkel\cacheflag\migrations
10
 * @since 1.3.1
11
 */
12
class m220620_191334_delete_cacheflag_flagged_database_table extends Migration
13
{
14
15
    /** @inheritdoc */
16
    public function safeUp()
17
    {
18
        // Remove the old "cacheflag_flagged" table if it exists
19
        $this->dropTableIfExists('{{%cacheflag_flagged}}');
20
    }
21
22
    /** @inheritdoc */
23
    public function safeDown()
24
    {
25
        echo "m220620_191334_delete_cacheflag_flagged_database_table cannot be reverted.\n";
26
        return false;
27
    }
28
29
}
30