问题
I'm trying to execute the Flyway migration to drop fulltext index but it could not be run inside the migration:
DROP FULLTEXT INDEX ON BusinessEntity
It throws an error:
Message: DROP FULLTEXT INDEX statement cannot be used inside a user transaction.
As I understand from the documentation:
Flyway runs each migration in a separate transaction.
I am interesting is there any way to run SQL code outside the migration or somehow turn it off for certain?
回答1:
This problem has already been fixed in the Flyway master branch but is not yet in a release.
The next version, 5.2.0, should resolve it.
In the meantime, you could build it from source yourself.
Update 2019-01-03
Version 5.2.0 was released a while back.
I have created a repository to replicate the error using Flyway 5.1.4 - or at least it fails on CREATE FULLTEXT INDEX
because of the same underlying problem. Changing the version to 5.2.0 fixes the problem, as expected.
来源:https://stackoverflow.com/questions/52332529/is-there-any-way-to-disable-flyway-sql-migration-from-the-transaction