You are here

function update_set_schema in Drupal 9

Same name and namespace in other branches
  1. 8 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.

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/3210925

1 call to update_set_schema()
UpdateDeprecationTest::testUpdateSetSchema in core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php
Tests update_set_schema() function.

File

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

Code

function update_set_schema($module, $schema_version) {
  @trigger_error('update_set_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/3210925', E_USER_DEPRECATED);
  \Drupal::service('update.update_hook_registry')
    ->setInstalledVersion($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();
}