for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Schema;
/**
* Class m000000_000017_media_comment
*
* @author Agiel K. Saputra <[email protected]>
* @since 0.1.0
*/
class m000000_000017_media_comment 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.
{
* @inheritdoc
public function up()
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->createTable('{{%media_comment}}', [
'id' => Schema::TYPE_PK,
'media_id' => Schema::TYPE_INTEGER . '(11) NOT NULL',
'author' => Schema::TYPE_TEXT,
'email' => Schema::TYPE_STRING . '(100)',
'url' => Schema::TYPE_STRING . '(255)',
'ip' => Schema::TYPE_STRING . '(100) NOT NULL',
'date' => Schema::TYPE_DATETIME . ' NOT NULL',
'content' => Schema::TYPE_TEXT . ' NOT NULL',
'status' => Schema::TYPE_STRING . '(20) NOT NULL',
'agent' => Schema::TYPE_STRING . '(255) NOT NULL',
'parent' => Schema::TYPE_INTEGER . '(11) DEFAULT 0',
'user_id' => Schema::TYPE_INTEGER . '(11)',
'FOREIGN KEY ([[media_id]]) REFERENCES {{%media}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE',
], $tableOptions);
public function down()
$this->dropTable('{{%media_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.