Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SQLite clean fails due to violated foreign key constraints #2417
Which version and edition of Flyway are you using?
5.2.4 Community Edition
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
I'm on the latest version already
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Which database are you using (type & version)?
Which operating system are you using?
What did you do?
I use SQLite with activated foreign keys (when they're deactivated it works of course, but I need foreign key constraints in my project).
I created a small project that shows the problem perfectly:
This is the migration that is used:
It seems as if flyway tries to drop the tables in the wrong order.
What did you expect to see?
Database should be cleaned (all tables dropped)
What did you see instead?
I created two PRs for 5.2.x and 6.0.0 that fixes the problem.
The cause is that Flyway drops tables in a random order (I guess).
No, it does not work the way you implemented it.
Could you please re-open this issue?