db_rename_table

Versions
6
db_rename_table(&$ret, $table, $new_name)
7
db_rename_table($table, $new_name)

Rename a table.

Parameters

$table The table to be renamed.

$new_name The new name for the table.

Related topics

▾ 9 functions call db_rename_table()

comment_update_7002 in modules/comment/comment.install
Rename {comments} table to {comment}.
field_sql_storage_field_storage_delete_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_delete_field().
filter_update_7002 in modules/filter/filter.install
Rename {filters} table to {filter} and {filter_formats} table to {filter_format}.
node_update_7001 in modules/node/node.install
Rename {node_revisions} table to {node_revision}.
poll_update_7001 in modules/poll/poll.install
Rename {poll_choices} table to {poll_choice} and {poll_votes} to {poll_vote}.
profile_update_7001 in modules/profile/profile.install
Rename {profile_fields} table to {profile_field} and {profile_values} to {profile_value}.
system_update_7012 in modules/system/system.install
Rename {blocks} table to {block}, {blocks_roles} to {block_role} and {boxes} to {box}.
system_update_7028 in modules/system/system.install
Rename taxonomy tables.
system_update_7037 in modules/system/system.install
Rename {box} table to {block_custom}.

Code

includes/database/database.inc, line 2365

<?php
function db_rename_table($table, $new_name) {
  return Database::getConnection()->schema()->renameTable($table, $new_name);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.