m171016_201410_init_myabstract_closed::safeUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
use yii\db\Migration;
4
5
class m171016_201410_init_myabstract_closed extends Migration
6
{
7
    public function safeUp()
8
    {
9
        $this->createTable('{{closing}}', [
10
            'table_name'=>$this->string(128)->notNull()->comment('referred entity table name'),
11
            'last_closing_time'=>$this->dateTime(6)->notNull()->comment('Last closure time in that entity'),
12
        ]);
13
        $this->addPrimaryKey('pk_closing', '{{closing}}', 'table_name');
14
    }
15
16
    public function safeDown()
17
    {
18
        $this->dropTable('{{closing}}');
19
    }
20
21
}
22