You are here

function db_drop_table in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/database.inc \db_drop_table()

Drops a table.

Parameters

$table: The table to be dropped.

Deprecated

as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropTable() on it. E.g. $injected_database->schema()->dropTable($table);

See also

\Drupal\Core\Database\Schema::dropTable()

Related topics

5 calls to db_drop_table()
drupal_uninstall_schema in core/includes/schema.inc
Removes all tables defined in a module's hook_schema().
SchemaTest::assertFieldAdditionRemoval in core/modules/system/src/Tests/Database/SchemaTest.php
Asserts that a given field can be added and removed from a table.
SchemaTest::assertFieldChange in core/modules/system/src/Tests/Database/SchemaTest.php
Asserts that a field can be changed from one spec to another.
SchemaTest::testSchema in core/modules/system/src/Tests/Database/SchemaTest.php
Tests database interactions.
simpletest_clean_database in core/modules/simpletest/simpletest.module
Removes prefixed tables from the database from crashed tests.

File

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

Code

function db_drop_table($table) {
  return Database::getConnection()
    ->schema()
    ->dropTable($table);
}