10

I specifically want Drush to list, of the modules that have available updates, which of those contain database updates. Is this possible with Drush?

Edit for clarification: I know drush up will list all modules that have available updates, yes, but not all of those updates will have database updates that go along with them. I strictly want a list of updates that have associated database updates.

4 Answers 4

14

drush updatedb --no (shorthand: drush up -n) will list them and take no further action.

1
  • Brilliant! Thank you. I looked through drush help up but nothing turned up in there, obviously... doh. Feb 4, 2012 at 5:38
2

This is a feature request; please post it in the drush issue queue. Note that this is not a terribly easy thing for Drush to do; it would have to download all of the projects to be updated and inspect them prior to prompting you.

2
  • I wasn't so much requesting the feature as I was asking if it existed in the first place. I will add this to the queue though, thanks. Feb 3, 2012 at 22:34
  • I was considering how to do this during the pm-updatecode operation. @moshe's suggestion is much better; just grab all of the new code, then revert the modules you don't want to keep after inspecting the output of drush updatedb --no. Feb 6, 2012 at 18:43
1

"drush pm-update" will give you a list of modules that have updates available.

1
  • You miss my meaning. drush up will list all modules that have available updates, yes, but not all of those updates will have database updates that go along with them. I strictly want a list of updates that have associated database updates. Feb 3, 2012 at 22:04
0

There is a drush command that will be better for you than drush updatedb --no, as it will not clear the cache (which could really affect performance on a production site):

drush8 --uri=www.example.com updatedb-status --format=json
[
    {
        "module": "Metatag",
        "update_id": 7104,
        "description": "Remove the entity revision ID from the translation strings. "
    },
    {
        "module": "Metatag",
        "update_id": 7105,
        "description": "Fix the output translation strings. "
    }
]

Documentation is at http://drushcommands.com/drush-8x/core/updatedb-status/

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.