m190822_022858_table_article_meta   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 6 1
A safeDown() 0 3 1
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