Create ability to run up and down a certain number of versions
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)
-
repo owner -
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
-
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 rungoose up
to get everything back. -
+1 to this. it would be cool to
goose reset
-
I would definitely find this feature-request useful. Another approach to this could be to keep track of migrations by assigning all successful migrations with a batch number. This way
goose down
could simply revert the entire last batch. This is exactly the wayartisan
does it, which is very convenient in case of a rollback.https://laravel.com/docs/5.6/migrations#rolling-back-migrations
- Log in to comment
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.