From 2385d30422b865052bbc6f333e6a189f46215a61 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 7 Apr 2008 14:01:01 +0000 Subject: Added rename_table() into DBForge. --- system/database/drivers/mssql/mssql_forge.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'system/database/drivers/mssql') diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index baf776c74..63063f259 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -215,5 +215,24 @@ class CI_DB_mssql_forge extends CI_DB_forge { } + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + // I think this syntax will work, but can find little documentation on renaming tables in MSSQL + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + } ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b