W3cubDocs

/Drupal 8

function update_set_schema

update_set_schema($module, $schema_version)

Forces a module to a given schema version.

This function is rarely necessary.

Parameters

string $module: Name of the module.

string $schema_version: The schema version the module should be set to.

File

core/includes/update.inc, line 113
Drupal database update API.

Code

function update_set_schema($module, $schema_version) {
  \Drupal::keyValue('system.schema')->set($module, $schema_version);
  // system_list_reset() is in module.inc but that would only be available
  // once the variable bootstrap is done.
  require_once __DIR__ . '/module.inc';
  system_list_reset();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!update.inc/function/update_set_schema/8.1.x