for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Schema;
/**
* @inheritdoc
* @SuppressWarnings(ShortMethodName)
* @SuppressWarnings(CamelCaseClassName)
*/
class m140825_112820_elastic_init 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 up()
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
}
$this->createTable('ym_elastic_spool_item', [
'id' => Schema::TYPE_INTEGER . '(10) UNSIGNED NOT NULL AUTO_INCREMENT',
'model_class' => Schema::TYPE_STRING . '(256) NOT NULL',
'record_id' => Schema::TYPE_INTEGER . '(10) UNSIGNED NOT NULL',
'action_code' => Schema::TYPE_STRING . '(32) NOT NULL',
'is_processing' => 'tinyint(1) NOT NULL',
'PRIMARY KEY (`id`)',
], $tableOptions);
public function down()
$this->dropTable('ym_elastic_spool_item');
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.