<?php

class m130724_064000_add_index_for_event_count_2 extends MyDbMigration
{
	public function up()
	{
		if(!$this->indexExist('validate_approved_no_extcode', 'storicotable'))
		{
			$command=$this->dbConnection->createCommand("CREATE INDEX validate_approved_no_extcode ON storicotable (ValidatedBy, validation_result, ext_code, id_validate_user, ValidationTime)");
			$command->execute();		
		}
	}

	public function down()
	{
    $this->dropIndex('validate_approved_no_extcode', 'storicotable');
		
    return true;
	}

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

	public function safeDown()
	{
	}
	*/
}
