alterColumn('{{%importers}}','price_date_update','VARCHAR(80)' ); // конвертем в дату $this->update('{{%importers}}',['price_date_update'=> new yii\db\Expression('FROM_UNIXTIME(price_date_update)')]); // а из даты в таймстамп $this->alterColumn('{{%importers}}','price_date_update','TIMESTAMP NOT NULL' ); $this->createIndex('price_date', '{{%importers}}', 'price_date_update', false); } public function safedown() { $this->alterColumn('{{%importers}}','price_date','varchar(15)' ); $this->dropIndex('price_date', '{{%importers}}'); } }