function db_rename_table

Renames a table.

Parameters

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

$new_name: The new name for the table.

Related topics

6 calls to db_rename_table()
field_sql_storage_field_storage_delete_field in drupal/core/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_delete_field().
field_update_8003 in drupal/core/modules/field/field.install
Convert fields and instances to config.
hook_field_storage_delete_field in drupal/core/modules/field/field.api.php
Act on deletion of a field.
SchemaTest::testSchema in drupal/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
Tests database interactions.
system_update_8020 in drupal/core/modules/system/system.install
Conditionally enable the new Ban module.

... See full list

File

drupal/core/includes/database.inc, line 678
Core systems for the database layer.

Code

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