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

▾ 21 functions call drupal_install_schema()

aggregator_install in modules/aggregator/aggregator.install
Implementation of hook_install().
blogapi_install in modules/blogapi/blogapi.install
Implementation of hook_install().
book_install in modules/book/book.install
Implementation of hook_install().
contact_install in modules/contact/contact.install
Implementation of hook_install().
dblog_install in modules/dblog/dblog.install
Implementation of hook_install().
forum_install in modules/forum/forum.install
Implementation of hook_install().
hook_install in developer/hooks/install.php
Install the current version of the database schema, and any other setup tasks.
locale_install in modules/locale/locale.install
Implementation of hook_install().
menu_install in modules/menu/menu.install
Implementation of hook_install().
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().
openid_install in modules/openid/openid.install
Implementation of hook_install().
poll_install in modules/poll/poll.install
Implementation of hook_install().
profile_install in modules/profile/profile.install
Implementation of hook_install().
search_install in modules/search/search.install
Implementation of hook_install().
statistics_install in modules/statistics/statistics.install
Implementation of hook_install().
system_install in modules/system/system.install
Implementation of hook_install().
trigger_install in modules/trigger/trigger.install
Implementation of hook_install().
update_install in modules/update/update.install
Implementation of hook_install().
upload_install in modules/upload/upload.install
Implementation of hook_install().

Code

includes/common.inc, line 3243

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

  $ret = array();
  foreach ($schema as $name => $table) {
    db_create_table($ret, $name, $table);
  }
  return $ret;
}
?>
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.