/** * test drop index with custom index name */ public function test_remove_index_with_custom_index_name() { //create it $this->adapter->execute_ddl("CREATE TABLE `users` ( name varchar(20), age int(3) );"); $this->adapter->add_index("users", "name", array('name' => 'my_special_index')); $this->assertEquals(true, $this->adapter->has_index("users", "name", array('name' => 'my_special_index'))); //drop it $this->adapter->remove_index("users", "name", array('name' => 'my_special_index')); $this->assertEquals(false, $this->adapter->has_index("users", "name", array('name' => 'my_special_index'))); $this->remove_table('users'); }
/** * Add an index * * @param string $table_name the name of the table * @param string $column_name the column name * @param array|string $options * * @return boolean */ public function add_index($table_name, $column_name, $options = array()) { return $this->_adapter->add_index($table_name, $column_name, $options); }