function update_set_schema
Same name in other branches
- 9 core/includes/update.inc \update_set_schema()
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.
1 call to update_set_schema()
- UpdateSchemaTest::testUpdateHooks in core/
modules/ system/ tests/ src/ Functional/ UpdateSystem/ UpdateSchemaTest.php - Tests that update hooks are properly run.
File
-
core/
includes/ update.inc, line 180
Code
function update_set_schema($module, $schema_version) {
\Drupal::keyValue('system.schema')->set($module, $schema_version);
\Drupal::service('extension.list.profile')->reset();
\Drupal::service('extension.list.module')->reset();
\Drupal::service('extension.list.theme_engine')->reset();
\Drupal::service('extension.list.theme')->reset();
drupal_static_reset('drupal_get_installed_schema_version');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.