function db_create_table

7.x database.inc db_create_table($name, $table)
6.x database.inc db_create_table(&$ret, $name, $table)
8.x database.inc db_create_table($name, $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

36 calls to db_create_table()
block_update_7006 in drupal/modules/block/block.install
Recreates cache_block table.
DatabaseTestCase::installTables in drupal/modules/simpletest/tests/database_test.test
Set up several tables needed by a certain test.
DatabaseTransactionTestCase::executeDDLStatement in drupal/modules/simpletest/tests/database_test.test
Execute a DDL statement.
DatabaseTransactionTestCase::transactionInnerLayer in drupal/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.
drupal-6.bare.database.php in drupal/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
Bare installation of Drupal 6.17, for test purposes.

... See full list

File

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

Code

function db_create_table($name, $table) {
  return Database::getConnection()->schema()->createTable($name, $table);
}