Reputation: 23
My IDE is Intellij. I have script migration file from version V1 to V10.
Given that I'm working on somebody else's project and have not so much experience, I need to delete a script (in order to delete a constraint) but when I run the plugin flyway:migrate I got the following:
Current version of schema "public": 10. Schema "public" is up to date. No migration necessary.
even though I have now up to V9 version.
What should I do to update the schema?
(By the way I noticed that if I add V11 script and run flyway:migration it gets updated to the newest. Why it doesn't work if delete a version?)
Upvotes: 0
Views: 1230
Reputation: 44535
Because database migration is not meant to work this way. If you want to remove a constraint which was introduced in an earlier script, you create a new script with a new version and drop the constraint in the new script. If you don't want to do that and you want to stick with deleting the old script, then you have to reinitialize the database and run all scripts starting from the first version again.
Upvotes: 1