db_create_table

  1. drupal
    1. 6 database.inc
    2. 8
    3. 7
Versions
6 db_create_table(&$ret, $name, $table)
7 – 8 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

▾ 27 functions call 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::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.
drupal_install_schema in includes/common.inc
Creates all tables in a module's hook_schema() implementation.
field_sql_storage_field_storage_create_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_create_field().
field_sql_storage_field_storage_update_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_update_field().
filter_update_7003 in modules/filter/filter.install
Upgrade the {filter} table for core filters.
filter_update_7009 in modules/filter/filter.install
Converts fields that store serialized variables from text to blob.
forum_update_7001 in modules/forum/forum.install
Create new {forum_index} table.
hook_field_storage_create_field in modules/field/field.api.php
Act on creation of a new field.
hook_field_storage_update_field in modules/field/field.api.php
Update the storage information for a field.
image_update_7000 in modules/image/image.install
Install the schema for users upgrading from the contributed module.
node_update_7010 in modules/node/node.install
Add the {block_node_type} table.
openid_update_6000 in modules/openid/openid.install
Add a table to store nonces.
SchemaTestCase::assertFieldAdditionRemoval in modules/simpletest/tests/schema.test
Assert that a given field can be added and removed from a table.
SchemaTestCase::testSchema in modules/simpletest/tests/schema.test
SchemaTestCase::testUnsignedColumns in modules/simpletest/tests/schema.test
Tests creating unsigned columns and data integrity thereof.
system_update_7002 in modules/system/system.install
Add a table to store blocked IP addresses.
system_update_7034 in modules/system/system.install
Migrate the file path settings and create the new {file_managed} table.
system_update_7054 in modules/system/system.install
Remove {cache_*}.headers columns.
system_update_7059 in modules/system/system.install
Create the {file_usage} table.
system_update_7061 in modules/system/system.install
Migrate upload.module data to the newly created file field.
taxonomy_update_7004 in modules/taxonomy/taxonomy.install
Move taxonomy vocabulary associations for nodes to fields and field instances.
tracker_update_7000 in modules/tracker/tracker.install
Create new tracker_node and tracker_user tables.
update_fix_d7_requirements in includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.
update_prepare_d7_bootstrap in includes/update.inc
Performs extra steps required to bootstrap when using a Drupal 6 database.
update_update_7001 in modules/update/update.install
Recreates cache_update table.

Code

includes/database/database.inc, line 2685

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