Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class m150227_114524_init extends Migration |
||
9 | { |
||
10 | /** |
||
11 | * This method contains the logic to be executed when applying this migration. |
||
12 | */ |
||
13 | public function up() |
||
14 | { |
||
15 | $tableOptions = null; |
||
16 | |||
17 | if ($this->db->driverName === 'mysql') { |
||
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
19 | } |
||
20 | |||
21 | $this->createTable('{{%Setting}}', [ |
||
22 | 'id' => $this->primaryKey(), |
||
23 | 'type' => $this->string(10)->notNull(), |
||
24 | 'section' => $this->string()->notNull(), |
||
25 | 'key' => $this->string()->notNull(), |
||
26 | 'value' => $this->text()->notNull(), |
||
27 | 'status' => $this->smallInteger()->notNull()->defaultValue(1), |
||
28 | 'createdAt' => $this->integer()->notNull(), |
||
29 | 'updatedAt' => $this->integer()->notNull(), |
||
30 | ], $tableOptions); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * This method contains the logic to be executed when removing this migration. |
||
35 | */ |
||
36 | public function down() |
||
39 | } |
||
40 | } |
||
41 |