File: /home/safarimaris/home/safarimaris/console/migrations/m161110_080355_tour_date.php
<?php
use yii\db\Migration;
class m161110_080355_tour_date extends Migration
{
public function up()
{
$this->addColumn('{{%tour}}', 'ym', $this->integer()->after('startDate'));
$this->createIndex('IDX_tour_ym', '{{%tour}}', 'ym');
$this->createIndex('IDX_tour_price', '{{%tour}}', 'price');
$this->createIndex('IDX_tour_special', '{{%tour}}', 'isSpecial');
$this->createIndex('IDX_tour_compatriot', '{{%tour}}', 'isCompatriot');
$this->createIndex('IDX_entity_type', '{{%entity}}', 'type');
$this->createIndex('IDX_entity_boat_nitrox', '{{%entity_boat}}', 'nitrox');
$this->createIndex('IDX_entity_boat_wifi', '{{%entity_boat}}', 'wifi');
}
public function down()
{
$this->dropIndex('IDX_tour_ym', '{{%tour}}');
$this->dropIndex('IDX_tour_price', '{{%tour}}');
$this->dropIndex('IDX_tour_special', '{{%tour}}');
$this->dropIndex('IDX_tour_compatriot', '{{%tour}}');
$this->dropIndex('IDX_entity_type', '{{%entity}}');
$this->dropIndex('IDX_entity_boat_nitrox', '{{%entity_boat}}');
$this->dropIndex('IDX_entity_boat_wifi', '{{%entity_boat}}');
$this->dropColumn('{{%tour}}', 'ym');
}
}