Total Complexity | 3 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class m140526_181732_create_option_table extends \yii\db\Migration |
||
6 | { |
||
7 | public function up() |
||
8 | { |
||
9 | $tableOptions = null; |
||
10 | if ($this->db->driverName === 'mysql') { |
||
11 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; |
||
12 | } |
||
13 | |||
14 | $this->createTable('{{%option}}', [ |
||
15 | 'id' => Schema::TYPE_PK, |
||
16 | 'name' => Schema::TYPE_TEXT . ' NOT NULL', |
||
17 | 'weight' => Schema::TYPE_INTEGER . ' NOT NULL', |
||
18 | ], $tableOptions); |
||
19 | } |
||
20 | |||
21 | public function down() |
||
24 | } |
||
25 | } |
||
26 |