1

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 Answer 1

2

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.

5
  • Is there a workaround how could I use this on prod env without custom jar at this point? Commented Sep 14, 2018 at 13:23
  • 1
    Not that I am aware of. There is no mention of a way to skip transactions in the documentation. I had a quick look at the code but I can't see a way to override it without a code change. Sorry.
    – codemonkey
    Commented Sep 14, 2018 at 14:10
  • hey, I am still facing this issue even after upgrading to 5.2.0 (it is running with springboot application) - do you have any other suggestions? Commented Dec 31, 2018 at 13:17
  • @user1002065 Not sure. Does it fail with the same exception? I have replicated the error with 5.1.4 and then switched to 5.2.0 which fixed it, as expected. Is Spring Boot definitely using the correct version of Flyway? Is Flyway throwing an exception because of the previously failed migration..?
    – codemonkey
    Commented Jan 3, 2019 at 18:06
  • This issue is ocurring in 6.0.8 Community for SQL Server when calling sys.sp_grantdbaccess.
    – DWRoelands
    Commented Nov 22, 2019 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.