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

6.x
Dries Buytaert 2007-05-29 11:36:33 +00:00
parent 556ef56c52
commit af34a17925
2 changed files with 28 additions and 0 deletions

View File

@ -184,6 +184,20 @@ function db_type_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.
*

View File

@ -612,6 +612,20 @@ function _db_create_field_sql($name, $spec) {
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.
*