db_create_table

Versions
6
db_create_table(&$ret, $name, $table)
7
db_create_table($name, $table)

Create 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

▾ 14 functions call db_create_table()

block_update_7001 in modules/block/block.install
Add the block_node_type table.
drupal_install_schema in includes/common.inc
Create all tables that a module defines in its hook_schema().
field_sql_storage_field_storage_create_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_create_field().
field_sql_storage_field_storage_update_field in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_update_field().
forum_update_7001 in modules/forum/forum.install
Create new {forum_index} table.
system_update_7002 in modules/system/system.install
Add a table to store blocked IP addresses.
system_update_7006 in modules/system/system.install
Registry tables and drop the file key of the menu router, since it is no longer needed.
system_update_7022 in modules/system/system.install
Add the queue tables.
system_update_7034 in modules/system/system.install
Migrate the file_downloads setting and create the new {file} table.
system_update_7042 in modules/system/system.install
Rename dst and src to source and alias.
system_update_7044 in modules/system/system.install
Reuse the actions_aid table as sequences.
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.

Code

includes/database/database.inc, line 2297

<?php
function db_create_table($name, $table) {
  if (!db_table_exists($name)) {
    return Database::getConnection()->schema()->createTable($name, $table);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.