m150705_000001_create_dashboard   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 11 2
A down() 0 4 1
1
<?php
2
3
use yii\db\Schema;
4
5
class m150705_000001_create_dashboard extends \yii\db\Migration
6
{
7
    const TABLE = '{{%dashboard}}';
8
9
    public function up()
10
    {
11
        $this->createTable(self::TABLE, [
12
            'id' => Schema::TYPE_PK,
13
            'name' => Schema::TYPE_STRING . ' NOT NULL',
14
            'layout_class' => Schema::TYPE_STRING . ' NOT NULL',
15
            'sort' => Schema::TYPE_INTEGER . ' NOT NULL',
16
            'options' => Schema::TYPE_TEXT,
17
            'enabled' => Schema::TYPE_INTEGER . '(1) DEFAULT 0 NOT NULL',
18
        ], ($this->db->driverName === 'mysql' ? 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB' : null));
19
    }
20
21
    public function down()
22
    {
23
        $this->dropTable(self::TABLE);
24
    }
25
}
26