Commit af34a179 authored by Dries's avatar Dries
Browse files

- Patch #147285 by drewish: add db_rename_table().

parent 556ef56c
...@@ -184,6 +184,20 @@ function db_type_map() { ...@@ -184,6 +184,20 @@ function db_type_map() {
return $map; return $map;
} }
/**
* Rename a table.
*
* @param $ret
* Array to which query results will be added.
* @param $table
* The table to be renamed.
* @param $new_name
* The new name for the table.
*/
function db_rename_table(&$ret, $table, $new_name) {
$ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
}
/** /**
* Drop a table. * Drop a table.
* *
......
...@@ -612,6 +612,20 @@ function _db_create_field_sql($name, $spec) { ...@@ -612,6 +612,20 @@ function _db_create_field_sql($name, $spec) {
return $sql; return $sql;
} }
/**
* Rename a table.
*
* @param $ret
* Array to which query results will be added.
* @param $table
* The table to be renamed.
* @param $new_name
* The new name for the table.
*/
function db_rename_table(&$ret, $table, $new_name) {
$ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
}
/** /**
* Drop a table. * Drop a table.
* *
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment