Create ability to run up and down a certain number of versions

Issue #17 new
Rao Venu created an issue

Currently "goose up" runs all up migrations while "goose down" runs one migration down. Please add ability to up/down a certain number of migrations.

Please see the "-c" option in https://github.com/kunklejr/node-db-migrate

Thanks -Rao

Comments (5)

  1. Liam Staskawicz repo owner

    Just a quick note - this seems like a reasonable request.

    Another related option would be specify a target migration.

    Would be open to either or both.

  2. Rao Venu reporter

    Both of these options sound good though my personal preference is to use the count. It is useful when refactoring my dbmodel and I realize that I have made a mistake. Instead of going "goose down" 10 times manually, I would prefer to be able to fire this.

    Rais and other migration tools also do this

  3. Steve Gattuso

    I'd definitely find this useful as well.

    I've been looking for a way to "reset" my database without having to drop/create the database and run migrations again. It'd be nice to be able to do something like goose down [something representing the first migration] in order to clear out the database, and then run goose up to get everything back.

  4. Log in to comment