drupal_install_schema

Versions
6 – 7
drupal_install_schema($module)

Create all tables that a module defines in its hook_schema().

Note: This function does not pass the module's schema through hook_schema_alter(). The module's tables will be created exactly as the module defines them.

Parameters

$module The module for which the tables will be created.

Return value

An array of arrays with the following key/value pairs:

  • success: a boolean indicating whether the query succeeded.
  • query: the SQL query(s) executed, passed through check_plain().

Related topics

▾ 7 functions call drupal_install_schema()

nodeapi_example_install in developer/examples/nodeapi_example.install
Implementation of hook_install().
node_access_example_install in developer/examples/node_access_example.install
Implementation of hook_install().
node_example_install in developer/examples/node_example.install
Implementation of hook_install().
scaffolding_example_install in developer/examples/scaffolding_example/scaffolding_example.install
Implementation of hook_install().
system_install in modules/system/system.install
Implement hook_install().
tracker_install in modules/tracker/tracker.install
Implement hook_install().
_drupal_install_module in includes/install.inc
Callback to install an individual install profile module.

Code

includes/common.inc, line 5590

<?php
function drupal_install_schema($module) {
  $schema = drupal_get_schema_unprocessed($module);
  _drupal_schema_initialize($module, $schema);

  foreach ($schema as $name => $table) {
    db_create_table($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.