<?php

class m160930_131304_new_indexes_for_gate_status extends MyDbMigration
{
	public function up()
	{
		$this->createIndex('Index_ext_code_validation_result_validated_by',   	'storicotable', 'ext_code, validation_result, validatedby');
		$this->createIndex('Index_gate_ext_code_time_protocol',   				'storicotable', 'gate,ext_code_time, protocol');
		$this->createIndex('Index_gate_validation_time_validation_result',   	'storicotable', 'gate, validationtime, validation_result');
		$this->createIndex('Index_gate_validation_time_validation_result',   	'storicotable', 'gate, validationtime, validation_result');
		$this->createIndex('Index_gate_startdatetime',   						'statstable', 'gate, startdatetime');
		$this->dropIndex('Index_order_gate', 									'storicotable');
		$this->dropIndex('Index_gate', 											'statstable');
	}

	public function down()
	{

		$this->createIndex('Index_order_gate',   	'storicotable', 'gate');
		$this->createIndex('Index_gate',   	'statstable', 'gate');
		$this->dropIndex('Index_gate_ext_code_time_protocol',   	'storicotable');
		$this->dropIndex('Index_gate_validation_time_validation_result',   	'storicotable');
		$this->dropIndex('Index_ext_code_validation_result_validated_by',   	'storicotable');		
		$this->dropIndex('Index_gate_startdatetime',  'statstable');
		
		return false;
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}