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

4 calls to db_rename_table()
field_sql_storage_field_storage_delete_field in drupal/core/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_delete_field().
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/Common/SchemaTest.php
Tests database interactions.
update_prepare_d8_language in drupal/core/includes/update.inc
Prepare Drupal 8 language changes for the bootstrap if needed.

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);
}