Is there any way to disable flyway SQL migration from the transaction

情到浓时终转凉″ 提交于 2021-01-28 12:56:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!