When you are developing it would be nice that you can test updates.
Specify a module and version number. When something went wrong you can just run that update again.
drush updatedb -y [module_name] [version_number]

Comments

tomswiggers’s picture

StatusFileSize
new3.68 KB
tomswiggers’s picture

Status: Active » Needs review
moshe weitzman’s picture

Makes sense. Patches welcome.

greg.1.anderson’s picture

Status: Needs review » Needs work

Pretty cool.

Needs a d7 version.
The schema version should be optional; if not specified, then run all of the pending updates for the specified module.
It would also be useful to be able to specify 7001-7003 or 7002+, for example, to run a range of schema updates, or everything from a given number through to the end. Would -7004 also make sense, perhaps? (Run from current up to and uncluding 7004)?
Your documentation says 'options' => array(, but you mean 'arguments' => array.

tomswiggers’s picture

Indeed I have to do this also for drupal 7.
Your remarks are indeed useful.
Maybe we can add some extra argument instead of -7004 7004+? What do you think?

I already changed options -> arguments :-)

greg.1.anderson’s picture

@tomswiggers: ranges of updates would be an optional enhancement; one could always just run the command in a loop to do multiple updates. Providing similar functionality in options would also be acceptable, but I don't think it would be worth adding this optional feature unless it was easier to remember and type than for x in 7001 7002 7003 ; do .... Just taking N arguments would be another possibility.

tomswiggers’s picture

Status: Needs work » Needs review
StatusFileSize
new14.81 KB

I changed the code a little bit.
Now you can do:
drush updatedb mymodule
This we do all pending updates for mymodule

drush updatedb mymodule 6004
This will do update 6004 for mymodule

This weekend I will try to add the drupal 7 version

moshe weitzman’s picture

Version: All-versions-4.2 »
Status: Needs review » Needs work
greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.