function drupal_set_installed_schema_version

Same name and namespace in other branches
  1. 7.x includes/ \drupal_set_installed_schema_version()
  2. 9 core/includes/ \drupal_set_installed_schema_version()

Updates the installed version information for a module.


string $module: A module name.

string $version: The new schema version.

Related topics

12 calls to drupal_set_installed_schema_version()
DbUpdateController::triggerBatch in core/modules/system/src/Controller/DbUpdateController.php
Starts the database update batch process.
ModuleInstaller::install in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Installs a given list of modules.
StatusTest::testStatusPage in core/modules/system/tests/src/Functional/System/StatusTest.php
Tests that the status page returns.
UpdatePathLastRemovedTest::testLastRemovedVersion in core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
Tests that a module with a too old schema version can not be updated.
UpdatePathNewDependencyTest::testUpdateNewDependency in core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php
Test that a module can add services that depend on new modules.

... See full list


core/includes/, line 107


function drupal_set_installed_schema_version($module, $version) {
    \Drupal::keyValue('system.schema')->set($module, $version);
    // Reset the static cache of module schema versions.
    drupal_get_installed_schema_version(NULL, TRUE);

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