3

For a specific module, how can I check which database updates have been applied in Drupal 9? I've downloaded a database from a server and I want to check what the current module schema is.

In Drupal 7, this was in the system database table, but that no longer exists.

1 Answer 1

3

For Drupal 9.3+/10:

drush php-eval "echo \Drupal::service('update.update_hook_registry')->getInstalledVersion('mymodule');"

Source: Change record

For Drupal 8/9 up to 9.3:

drush php-eval "echo drupal_get_installed_schema_version('mymodule');"

Source: gist

2
  • Check the API documentation - drupal_get_installed_schema_version() is deprecated in Drupal 9 and will be removed in Drupal 10. If you use the recommended replacement now, you won't have to make any changes to this code in the future.
    – anonymous
    Apr 5, 2022 at 17:50
  • @anonymous Thanks, updated! Apr 6, 2022 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.