有什么方法可以禁用从事务中进行的flyway SQL迁移 [英] Is there any way to disable flyway SQL migration from the transaction

查看:85
本文介绍了有什么方法可以禁用从事务中进行的flyway SQL迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行Flyway迁移以删除全文本索引,但无法在迁移内部运行:

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

它抛出一个错误:

消息:DROP FULLTEXT INDEX语句不能在用户事务内使用.

Message: DROP FULLTEXT INDEX statement cannot be used inside a user transaction.

据我从文档了解:

Flyway在单独的事务中运行每个迁移.

Flyway runs each migration in a separate transaction.

我很有趣,是否有任何方法可以在迁移之外运行SQL代码,或者以某种方式将其关闭?

I am interesting is there any way to run SQL code outside the migration or somehow turn it off for certain?

推荐答案

此问题已经已在Flyway主分支中修复,但尚未发布.

This problem has already been fixed in the Flyway master branch but is not yet in a release.

下一个版本 5.2.0 应该可以解决该问题.

The next version, 5.2.0, should resolve it.

同时,您可以自己从源代码构建.

5.2.0版发布不久了.

Version 5.2.0 was released a while back.

我创建了一个存储库,以使用Flyway复制错误5.1.4-或至少由于相同的基本问题,它在 CREATE FULLTEXT INDEX 上失败.如预期的那样,将版本更改为5.2.0可以解决此问题.

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.

这篇关于有什么方法可以禁用从事务中进行的flyway SQL迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆