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
SQLite: Migrations containing PRAGMA foreign_keys= should be marked as non-transactional #2190
Comments
This isn't trivial to solve as SQLite only supports a single transaction, via a single connection. Marking the migration as non-transactional isn't enough as it still poses issues with our schema history table management. The workaround is easy: don't begin or commit transaction within a migration. Flyway already wraps every migration in a transaction for you. Documented as a limitation. |
Sorry for my late reply. BTW I think execute something outside transaction is important, like the migration I wrote on original post, |
Your workaround should be fine for now. It could make sense for Flyway to automatically mark a migration containing |
Gotcha, thanks for your help. |
Fixed. Migration containing |
…d be marked as non-transactional
… should be marked as non-transactional
Which version and edition of Flyway are you using?
Flyway 5.2.1 (with Spring)
If this is not the latest version, can you reproduce the issue with the latest one as well?
this is the latest version in maven central.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API? I'm using Spring boot and it seems that Spring boot handles migration for me.
Which database are you using (type & version)?
SQLite JDBC 3.25.2
Which operating system are you using?
Windows 10
What did you do?
Execute the following migration:
What did you expect to see?
According to flyway documentation
So I expect flyway mark this migration as non-transactional
What did you see instead?
It still wrap this migration in a transaction.
The text was updated successfully, but these errors were encountered: