- Patch #147285 by drewish: add db_rename_table().
parent
556ef56c52
commit
af34a17925
|
@ -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) {
|
||||||
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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue