function db_rename_table

7.x database.inc db_rename_table($table, $new_name)
6.x database.pgsql.inc db_rename_table(&$ret, $table, $new_name)
6.x database.mysql-common.inc db_rename_table(&$ret, $table, $new_name)

Renames a table.

Parameters

$table: The current name of the table to be renamed.

$new_name: The new name for the table.

Related topics

14 calls to db_rename_table()
block_update_7002 in drupal-7.x/modules/block/block.install
Rename {blocks} table to {block}, {blocks_roles} to {block_role} and {boxes} to {block_custom}.
comment_update_7002 in drupal-7.x/modules/comment/comment.install
Rename {comments} table to {comment} and upgrade it.
field_sql_storage_field_storage_delete_field in drupal-7.x/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_delete_field().
filter_update_7000 in drupal-7.x/modules/filter/filter.install
Upgrade the {filter_formats} table and rename it to {filter_format}.
filter_update_7003 in drupal-7.x/modules/filter/filter.install
Upgrade the {filter} table for core filters.

... See full list

File

drupal-7.x/includes/database/database.inc, line 2806
Core systems for the database layer.

Code

function db_rename_table($table, $new_name) {
  return Database::getConnection()->schema()->renameTable($table, $new_name);
}