for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use inblank\activeuser\migrations\Migration;
use yii\db\Schema;
class m170707_070437_avatar_image 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 safeUp()
// set default value for `avatar` field to NULL
$tab = self::tn(self::TAB_USERS);
$this->alterColumn($tab, 'avatar', Schema::TYPE_STRING . "(45) DEFAULT NULL");
// replace all empty `avatar`
$this->db->createCommand("update " . $tab . " set [[avatar]]=NULL where [[avatar]]=''")->execute();
}
public function safeDown()
$this->db->createCommand("update " . $tab . " set [[avatar]]='' where [[avatar]] IS NULL")->execute();
$this->alterColumn($tab, 'avatar', Schema::TYPE_STRING . "(45) NOT NULL DEFAULT ''");
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.