for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class m150106_122229_comments extends \yii\db\Migration
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.
{
public function safeUp()
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%comment}}', [
'id' => $this->primaryKey(),
'entity' => $this->string(),
'text' => $this->text(),
'deleted' => $this->boolean()->notNull()->defaultValue(false),
'created_by' => $this->integer(),
'updated_by' => $this->integer(),
'created_at' => $this->integer(),
'updated_at' => $this->integer(),
], $tableOptions);
$this->createIndex('idx_entity', '{{%comment}}', ['entity']);
$this->createIndex('idx_created_by', '{{%comment}}', ['created_by']);
$this->createIndex('idx_created_at', '{{%comment}}', ['created_at']);
public function safeDown()
$this->dropTable('{{%comment}}');
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.