db = 'db'; parent::init(); } public function safeUp() { $tableOptions = 'ENGINE=InnoDB'; $this->createTable( '{{%inquirer_log}}', [ 'id'=> $this->primaryKey()->unsigned(), 'idq'=> $this->integer()->unsigned()->notNull(), 'hash'=> $this->string(64)->notNull(), 'dt'=> $this->timestamp()->notNull()->defaultExpression("CURRENT_TIMESTAMP"), ],$tableOptions ); $this->createIndex('idq','{{%inquirer_log}}',['idq'],false); } public function safeDown() { $this->dropIndex('idq', '{{%inquirer_log}}'); $this->dropTable('{{%inquirer_log}}'); } }