Completed
Push — master ( 89be15...80fd60 )
by Igor
11:15
created

m141230_043250_create_file   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 12 1
A safeDown() 0 4 1
1
<?php
2
3
use app\migrations\Migration;
4
5
class m141230_043250_create_file extends Migration
6
{
7
    public function safeUp()
8
    {
9
        $this->createTable('{{%file}}', [
10
            'id' => $this->primaryKey(),
11
            'user_id' => $this->integer()->notNull()->defaultValue(0),
12
            'title' => $this->string()->notNull()->defaultValue(''),
13
            'name' => $this->string()->notNull()->defaultValue(''),
14
            'date_create' => $this->timestamp()->null(),
15
            'date_update' => $this->timestamp()->null(),
16
            'ip' => $this->bigInteger(20)->notNull()->defaultValue(0),
17
        ], $this->tableOptions);
18
    }
19
20
    public function safeDown()
21
    {
22
        $this->dropTable('{{%file}}');
23
    }
24
}
25