Skip to content
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

Rollbacks (for Cassandra) #31

Open
clawconduce opened this issue May 5, 2016 · 4 comments
Open

Rollbacks (for Cassandra) #31

clawconduce opened this issue May 5, 2016 · 4 comments

Comments

@clawconduce
Copy link

I like how light this tool is, and how clean the source is, but I do miss having rollbacks in a migration tool.

I think it would require 2 changes to get them though:

  • the migrate step would need to filter out .down.cql files.
  • A new task would need to get added that takes a migration name as a prameter. Something like rollback --target 20160101-new-table, which would run all the .down.cql files after the provided migration. Basically undo all the migrations after the 20160101-new-table.

How does this sound? I could write up a PR if it sounds good.
Thanks,
Charles

@bradfordcp
Copy link
Contributor

Would we have a .up.cql as well? That seems pretty straightforward, go for it.

@clawconduce
Copy link
Author

My thinking was if the file ends in <name>.up.cql or <name>.cql look for <name>.down.cql. So either .up.cql or just .cql would work for the initial migration.

I'll take a shot at it! Thanks for the quick feedback.

@clawconduce
Copy link
Author

I wanted to let you know that I am using https://github.com/mattes/migrate which can handle cassandra migrations. It's not nearly as lightweight, but it does have rollback already.

@bradfordcp
Copy link
Contributor

Interesting it looks like they have 2 separate up and down files. I'll keep this in mind when I get a chance to work on this ticket. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants