m190822_022858_table_article_meta::safeDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
use App\Db\Migration;
3
4
/**
5
 * Class m190822_022858_table_article_meta
6
 */
7
class m190822_022858_table_article_meta extends Migration
8
{
9
    private $tableName = '{{%article_meta}}';
10
11
    public function safeUp()
12
    {
13
        $this->createTable($this->tableName, [
14
            'article_id' => $this->integer()->notNull()->unique()->comment('Article ID'),
15
            'content' => $this->text()->notNull()->comment('Content'),
16
        ], $this->tableOptions());
17
    }
18
19
    public function safeDown()
20
    {
21
        $this->dropTable($this->tableName);
22
    }
23
}
24