for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Migration;
use yii\db\Schema;
class m151226_111407_init extends 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 up()
$this->createTable(
'{{%html}}',
[
'id' => Schema::TYPE_PK,
'key' => Schema::TYPE_STRING.' NOT NULL',
'value' => Schema::TYPE_TEXT.' NOT NULL',
]
);
$this->createIndex('html_key_unique', '{{%html}}', 'key', true);
'{{%less}}',
'value' => Schema::TYPE_TEXT,
$this->createIndex('less_key_unique', '{{%less}}', 'key', true);
}
public function down()
echo "m151226_111407_init cannot be reverted.\n";
return false;
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
public function safeDown()
*/
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.