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

Reverse doesn't reverse order of operations #86

Open
halfmatthalfcat opened this issue Jun 25, 2020 · 1 comment · May be fixed by #87 or #236
Open

Reverse doesn't reverse order of operations #86

halfmatthalfcat opened this issue Jun 25, 2020 · 1 comment · May be fixed by #87 or #236

Comments

@halfmatthalfcat
Copy link

It looks like reverse does reverse the individual commands, but if you chain a migration (.create.addForeignKey().addIndex()) and then reverse, it runs the Actions in the same order, causing the migration to fail (since the table will be dropped and then keys/indexes to try to be subsequently dropped).

Is there anyway to change the behavior to match an actual reversal?

@nafg
Copy link
Owner

nafg commented Jun 25, 2020

Hmm, I guess there should be a .reverse on https://github.com/nafg/slick-migration-api/blob/master/src/main/scala/slick/migration/api/TableMigration.scala#L66

Can you send a PR with tests?

@halfmatthalfcat halfmatthalfcat linked a pull request Jun 25, 2020 that will close this issue
@anovstrup anovstrup linked a pull request Dec 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants