db = 'db'; parent::init(); } public function safeUp() { $tableOptions = 'ENGINE=InnoDB'; $this->createTable( '{{%inquirer_answer}}', [ 'id'=> $this->primaryKey()->unsigned(), 'idq'=> $this->integer()->unsigned()->notNull()->comment('id вопроса'), 'text'=> $this->text()->notNull(), 'type'=> $this->string(64)->notNull()->defaultValue('simple'), 'count'=> $this->integer()->unsigned()->notNull()->defaultValue(0)->comment('счётчик'), ],$tableOptions ); $this->createIndex('idq','{{%inquirer_answer}}',['idq'],false); } public function safeDown() { $this->dropIndex('idq', '{{%inquirer_answer}}'); $this->dropTable('{{%inquirer_answer}}'); } }