function db_create_table

7.x db_create_table($name, $table)
6.x db_create_table(&$ret, $name, $table)

Creates a new table from a Drupal table definition.


$name: The name of the table to create.

$table: A Schema API table definition array.

Related topics

30 calls to db_create_table()
block_update_7006 in drupal-7.x/modules/block/block.install
Recreates cache_block table.
DatabaseTestCase::installTables in drupal-7.x/modules/simpletest/tests/database_test.test
Set up several tables needed by a certain test.
DatabaseTransactionTestCase::executeDDLStatement in drupal-7.x/modules/simpletest/tests/database_test.test
Execute a DDL statement.
DatabaseTransactionTestCase::transactionInnerLayer in drupal-7.x/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_install_schema in drupal-7.x/includes/
Creates all tables defined in a module's hook_schema().

... See full list


drupal-7.x/includes/database/, line 2717
Core systems for the database layer.


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