| Total Complexity | 2 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class m160706_223500_vote_updates extends Migration |
||
|
|
|||
| 9 | { |
||
| 10 | public function up() |
||
| 11 | { |
||
| 12 | $this->createIndex('vote_target_user_idx', '{{%vote}}', ['entity', 'target_id', 'user_id'], false); |
||
| 13 | $this->alterColumn('{{%vote}}', 'value', $this->boolean()->notNull()); |
||
| 14 | |||
| 15 | //TODO: check these command and fix migration |
||
| 16 | //$this->execute('ALTER TABLE vote ALTER COLUMN value TYPE boolean USING CASE value WHEN 0 THEN false ELSE true END'); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function down() |
||
| 23 | } |
||
| 24 | } |
||
| 25 |
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.