New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diesel migration down #1509

Closed
coder543 opened this Issue Jan 24, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@coder543

coder543 commented Jan 24, 2018

I quickly glanced through the issues (open and closed), and didn't see anything mention this, so I figured I would. Would it make sense for there to be a subcommand on the diesel CLI that goes all the way down?

I'm not sure how to use the down.sql files usefully without a command that will run through the migrations in reverse and down all of them. Instead, I have a script that will just drop the entire public schema, recreate it, and then run the diesel migrations when I want a clean starting point.

If I could use the diesel CLI itself to run all of the down.sql files in reverse, that would be really nice!

Maybe I'm missing something obvious.

@sgrif

This comment has been minimized.

Member

sgrif commented Jan 24, 2018

You can revert a single migration with diesel migration revert. You can reset your whole schema with diesel database reset. You can run diesel --help for a full list of commands.

@sgrif sgrif closed this Jan 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment