m140618_045255_create_settings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 16 1
A down() 0 4 1
1
<?php
2
/**
3
 * @link http://phe.me
4
 * @copyright Copyright (c) 2014 Pheme
5
 * @license MIT http://opensource.org/licenses/MIT
6
 */
7
8
/**
9
 * @author Aris Karageorgos <[email protected]>
10
 */
11
class m140618_045255_create_settings extends \yii\db\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...
12
{
13
    public function up()
14
    {
15
        $this->createTable(
16
            '{{%settings}}',
17
            [
18
                'id' => $this->primaryKey(),
19
                'type' => $this->string(255)->notNull(),
20
                'section' => $this->string(255)->notNull(),
21
                'key' => $this->string(255)->notNull(),
22
                'value' => $this->text(),
23
                'active' => $this->boolean(),
24
                'created' => $this->dateTime(),
25
                'modified' => $this->dateTime(),
26
            ]
27
        );
28
    }
29
30
    public function down()
31
    {
32
        $this->dropTable('{{%settings}}');
33
    }
34
}
35