You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flyway 10.0配置自定义:升级后pluginRegister方法缺失的替代方案

Flyway 10.x 替代9.x插件配置方案

Flyway 10.x对扩展插件的访问方式进行了重构,原pluginRegister方法已被移除,你可以通过FluentConfiguration的extensions属性来获取并修改PostgreSQL的配置扩展,实现和旧版本相同的功能。

修改后的Kotlin配置类如下:

@Profile("local")
class FlywayConfig : FlywayConfigurationCustomizer {    
    override fun customize(configuration: FluentConfiguration?) {
        configuration?.extensions?.getByType(PostgreSQLConfigurationExtension::class.java)?.isTransactionalLock = false
    }
}

核心变化是将configuration?.pluginRegister?.getPlugin(...)替换为configuration?.extensions?.getByType(...),两者功能一致,都是获取对应的PostgreSQL配置扩展实例,进而关闭事务锁。

内容的提问来源于stack exchange,提问作者Christofer Ohlsson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 16:32:01