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/DB_forge.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'system/database/DB_forge.php') diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index cd468bc6a..5f25ebedc 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -208,6 +208,27 @@ class CI_DB_forge { // -------------------------------------------------------------------- + /** + * Rename Table + * + * @access public + * @param string the old table name + * @param string the new table name + * @return bool + */ + function rename_table($table_name, $new_table_name) + { + if ($table_name == '' OR $new_table_name == '') + { + show_error('A table name is required for that operation.'); + } + + $sql = $this->_rename_table($table_name, $new_table_name); + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + /** * Column Add * -- cgit v1.2.3-24-g4f1b