Score:1

How to check which module db updates have been applied?

cn flag

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.

Score:2
cn flag

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

fr flag
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.
cn flag
@anonymous Thanks, updated!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.