You are here

function drupal_set_installed_schema_version in Drupal 8

Same name and namespace in other branches
  1. 4 includes/install.inc \drupal_set_installed_schema_version()
  2. 5 includes/install.inc \drupal_set_installed_schema_version()
  3. 6 includes/install.inc \drupal_set_installed_schema_version()
  4. 7 includes/install.inc \drupal_set_installed_schema_version()
  5. 9 core/includes/schema.inc \drupal_set_installed_schema_version()

Updates the installed version information for a module.

Parameters

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

File

core/includes/schema.inc, line 107
Schema API handling functions.

Code

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);
}