Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | public function safeUp() |
||
8 | { |
||
9 | $tableOptions = null; |
||
10 | if ($this->db->driverName === 'mysql') { |
||
11 | // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci |
||
12 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
13 | } |
||
14 | |||
15 | $this->createTable('{{%lang}}', [ |
||
16 | 'id' => $this->string(2)->notNull(), |
||
17 | 'locale' => $this->string(8)->notNull(), |
||
18 | 'name' => $this->string(32)->notNull(), |
||
19 | 'status' => $this->smallInteger(), |
||
20 | 'PRIMARY KEY (id)', |
||
21 | ], $tableOptions); |
||
22 | |||
23 | $this->createIndex('lang_name_idx', 'lang', 'name', true); |
||
24 | $this->createIndex('lang_status_idx', 'lang', 'status'); |
||
25 | |||
26 | $this->insert('lang', [ |
||
27 | 'id' => 'en', |
||
28 | 'locale' => 'en-US', |
||
29 | 'name' => 'ENG', |
||
30 | 'status' => 10, |
||
31 | ]); |
||
32 | } |
||
33 | |||
39 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.