function drupal_install_schema

Same name in other branches
  1. 7.x includes/common.inc \drupal_install_schema()
  2. 8.9.x core/includes/schema.inc \drupal_install_schema()

Creates all tables defined in a module's hook_schema().

Parameters

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

Deprecated

in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided.

See also

https://www.drupal.org/node/2970993

\Drupal\Core\Extension\ModuleInstaller::installSchema()

Related topics

1 call to drupal_install_schema()
SchemaDeprecationTest::testDeprecatedInstallSchema in core/tests/Drupal/KernelTests/Core/Extension/SchemaDeprecationTest.php
Tests deprecation of database schema API functions.

File

core/includes/schema.inc, line 112

Code

function drupal_install_schema($module) {
    @trigger_error('drupal_install_schema() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/2970993', E_USER_DEPRECATED);
    $schema = drupal_get_module_schema($module);
    _drupal_schema_initialize($schema, $module, FALSE);
    foreach ($schema as $name => $table) {
        \Drupal::database()->schema()
            ->createTable($name, $table);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.