/** * test renaming table */ public function test_rename_table() { $this->adapter->drop_table('users'); $this->adapter->drop_table('users_new'); //create it $table = $this->adapter->create_table('users'); $table->column('name', 'string', array('limit' => 20)); $table->finish(); $this->assertEquals(true, $this->adapter->has_table('users')); $this->assertEquals(false, $this->adapter->has_table('users_new')); //rename it $this->adapter->rename_table('users', 'users_new'); $this->assertEquals(false, $this->adapter->has_table('users')); $this->assertEquals(true, $this->adapter->has_table('users_new')); //clean up $this->adapter->drop_table('users'); $this->adapter->drop_table('users_new'); }
/** * Rename a table * * @param string $name the name of the table * @param string $new_name the new name of the table * * @return boolean */ public function rename_table($name, $new_name) { return $this->_adapter->rename_table($name, $new_name); }