m151226_111407_init   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 43
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 22 1
A down() 0 6 1
1
<?php
2
3
use yii\db\Migration;
4
use yii\db\Schema;
5
6
class m151226_111407_init extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
    public function up()
9
    {
10
        $this->createTable(
11
            '{{%html}}',
12
            [
13
                'id' => Schema::TYPE_PK,
14
                'key' => Schema::TYPE_STRING.' NOT NULL',
15
                'value' => Schema::TYPE_TEXT.' NOT NULL',
16
            ]
17
        );
18
        $this->createIndex('html_key_unique', '{{%html}}', 'key', true);
19
20
        $this->createTable(
21
            '{{%less}}',
22
            [
23
                'id' => Schema::TYPE_PK,
24
                'key' => Schema::TYPE_STRING.' NOT NULL',
25
                'value' => Schema::TYPE_TEXT,
26
            ]
27
        );
28
        $this->createIndex('less_key_unique', '{{%less}}', 'key', true);
29
    }
30
31
    public function down()
32
    {
33
        echo "m151226_111407_init cannot be reverted.\n";
34
35
        return false;
36
    }
37
38
    /*
39
    // Use safeUp/safeDown to run migration code within a transaction
40
    public function safeUp()
41
    {
42
    }
43
44
    public function safeDown()
45
    {
46
    }
47
    */
48
}
49