Error message
You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).function db_create_table
Same name and namespace in other branches
- 8.9.x core/includes/database.inc \db_create_table()
Creates a new table from a Drupal table definition.
Parameters
$name: The name of the table to create.
$table: A Schema API table definition array.
Related topics
- Schema API
- API to handle database schemas.
37 calls to db_create_table()
- block_update_7006 in modules/
block/ block.install - Recreates cache_block table.
- DatabaseTestCase::installTables in modules/
simpletest/ tests/ database_test.test - Set up several tables needed by a certain test.
- DatabaseTransactionTestCase::executeDDLStatement in modules/
simpletest/ tests/ database_test.test - Execute a DDL statement.
- DatabaseTransactionTestCase::transactionInnerLayer in modules/
simpletest/ tests/ database_test.test - Helper method for transaction unit tests. This "inner layer" transaction is either used alone or nested inside of the "outer layer" transaction.
- dblog_update_7003 in modules/
dblog/ dblog.install - Account for possible legacy systems where dblog was not installed.
File
-
includes/
database/ database.inc, line 2836
Code
function db_create_table ($name, $table) {
return Database ::getConnection ()->schema ()
->createTable ($name, $table);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.