Flyway和Liquibase在一起? [英] Flyway and liquibase together?

查看:634
本文介绍了Flyway和Liquibase在一起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分别研究了Liquibase和Flyway,并单独进行了比较,Liquibase似乎是满足我们需求的更好工具.一些消息来源提到同时使用Liquibase和Flyway. Liquibase似乎具有Flyway所拥有的一切,并且在回滚方面具有更大的灵活性. Flyway的主要优点似乎是不必使用XML,但是Liquibase允许您在XML中指定SQL文件.

I've looked at both Liquibase and Flyway individually and on an individual comparison alone, Liquibase seems like the better tool for our needs. Some sources mention using both Liquibase and Flyway together. Liquibase seems to have everything Flyway has and more flexibility when it comes to rollbacks. The main advantage of just Flyway seems to be not having to use XML, but Liquibase allows you to specify an SQL file in their XML.

基本上,我仍然不清楚使用Flyway& amp;的好处.如果有的话,Liquibase在一起将超过Liquibase.也许有办法做到这一点,即使Liquibase指的是有效的Flyway SQL文件,我也没有看到,即使您可以从技术上使用这两种工具,这两种工具也都必须独立运行,并且仍然存在相同的陷阱.

Basically, I'm still not clear on what the benefits of using Flyway & Liquibase together would be over just Liquibase, if there are any. Maybe there's a way to do it I'm not seeing as even if Liquibase was referring to valid Flyway SQL files, both tools would have to be run independently and still have the same pitfalls even though you could technically use either tool.

推荐答案

在我回答问题之前的一个小更正.假设

A small correction, before I answer question. The assumption

Liquibase似乎具有Flyway的所有功能

Liquibase seems to have everything Flyway has

不正确.在解析SQL时,Flyway令人眼前一亮.您可以使用由本机工具生成的未修改的SQL文件,该文件包含各种复杂性,例如PL/SQL包和过程,MySQL分隔符更改,T-SQL,PostgreSQL过程等.使用Liquibase,您必须将这些拆分成单独的语句,在SQL文件中添加额外的注释,...

isn't correct. Flyway shines when it comes to parsing SQL. You can use unmodified SQL files generated by your native tools containing all kinds of complexity like PL/SQL packages and procedures, MySQL delimiter changes, T-SQL, PostgreSQL procedures, ... With Liquibase you would have to split these in individual statements, add extra comments to the SQL files, ...

能够原样使用SQL文件的好处是避免了锁定.您可以获取现有的SQL文件,以最少的投资开始使用Flyway,如果以后不再适合您的需求,请稍后移开. Liquibase并非如此.

The beauty of being able to use your SQL files as-is is that you avoid lock-in. You can take your existing SQL files, start using Flyway with minimal investment and moved away later if it doesn't suit your needs anymore. Not so with Liquibase.

迁移向下的问题(将其视为补偿性交易,而不是回滚)在理论上确实听起来不错,但实际上几乎不需要.请参见 https://flywaydb.org/documentation/faq#downgrade

Also the issue of down migrations (think of them as compensating transactions, not rollbacks) is really something that sounds great in theory, but that is almost never needed in practice. See https://flywaydb.org/documentation/faq#downgrade

但是,当涉及到使用一种或两种方法时,我当然同意SteveDonie(Liquibase团队成员)的观点,即仅使用一种方法而不是同时使用这两种方法几乎总是更好的选择.

However when it comes down to using one or both, I certainly agree with SteveDonie (Liquibase team member) that using just one instead of the both together is almost always the better choice.

免责声明:我是Flyway的创建者

这篇关于Flyway和Liquibase在一起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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