Phinx: Implement rollback --all feature to rollback all migrations

Created on 5 Jul 2017  路  8Comments  路  Source: cakephp/phinx

It would be super handy to be able to rollback all the migrations in one command.
Currently I either have to bin/cake migrations rollback for every migrations, or I have to rollback to a specific timestamp by doing a bin/cake migrations rollback -t 0. Suggestion is to add a --all option to the rollback command, that performs a rollback on all the migrations.

Also having a refresh command that performs a rollback --all and then migrates could be super handy for development. Even cooler would be to extend this feature with an optional --seed that also seeds the database after a rollback->migrate has been performed.

feature

All 8 comments

All of this seconded & would make Phinx a real joy to use. Very eager to see refresh --seed in particular, it's super useful.

I'm waiting for this PR to be finished so we can reuse the logic to add --all https://github.com/cakephp/phinx/pull/945

Eager to use this.

As per http://docs.phinx.org/en/latest/commands.html#the-rollback-command you can rollback all migrations via:

phinx rollback -e development -t 0

So this can be closed then as a solution is available.

Yeah, the timestamp rollback thing is just semantically not very nice. Thanks though.

@lomholdt Are you able to provide a PR with your semantically improved version of this enhancement?

I can give it a go. Thanks @dereuromark .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeremylivingston picture jeremylivingston  路  20Comments

joshribakoff picture joshribakoff  路  15Comments

aimfeld picture aimfeld  路  23Comments

hmp5bs picture hmp5bs  路  17Comments

l0gicgate picture l0gicgate  路  16Comments