I am confused about a few things to do with db updates.

I have a messed up site caused by commerce and importing configuration. I want to re-run the commerce updates to ensure that they were done (as they most likely have not been).

I see a simple update function in commerce.install: commerce_update_8201.

when i do:

drush ev "echo drupal_get_installed_schema_version('commerce');"

i get 8201. i then run:

drush ev "echo drupal_set_installed_schema_version('commerce', 1);"

and i can verify in the key_value table that this has been set to 1.

but now, when i run drush updb - it states: [success] No pending updates.

when i go to updates.php i get:

  • Some of the pending updates cannot be applied because their dependencies were not met.
  • No pending updates.

Next I try to force the update by running:

drush ev "module_load_install('commerce'); echo commerce_update_8201();"

I added an "echo" in the update script so that i could tell the code was run (otherwise there is no output and hard to tell anything happened). The code does get run by that last drush command.

But the system.schema is not updated in the db.

Does all of this sound like expected outcome. There sounds like at least a few bugs in Drupal core here.

  • 2
    Does all of this sound like expected outcome Look at the code for commerce_update_8201() - does it do anything that updates the schema in the db? – Clive Dec 31 '19 at 9:52
  • Perhaps you missed the point of my question? The specific update (commerce, in this case) was just an example. That particular update simply enables the token module. The question was about the update process. When i manually set the system.schema entry to1; shouldn't that trigger that there the update needs to be run? And I think now, that manually running the update hook won't update the system.schema entry; this is only done when update.php runs the hook. – liquidcms Dec 31 '19 at 12:02
  • The other bugs which seem evident here are why does drush not report the same issues as when run from update.php? Why does update.php report unmet dependencies but not inform what those are? And why does it state unmet dependencies while at the same time reporting there are no updates to run? – liquidcms Dec 31 '19 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.