Liquibase是否支持空运行? [英] Does Liquibase support dry run?

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

问题描述

我们有几个数据模式,我们研究了向Liquibase的迁移. (其中一种数据模式已经迁移到Liquibase).

We have couple of data schemas and we investigate the migration to Liquibase. (One of data schemas is already migrated to Liquibase).

对我们来说重要的问题是Liquibase是否支持空运行:

Important question for us is if Liquibase supports dry run:

  • 我们需要在所有架构上运行数据库更改而无需提交,以确保我们没有问题.
  • 如果成功,所有数据库更改将再次通过提交运行.

(该问题类似于 SQL Server查询空运行,但与Liquibase有关)

(The question similar to this SQL Server query dry run but related to Liquibase)

在回答之后添加

我阅读了有关updateSQL的文档,但不能满足空运行"的要求. 它只是生成SQL(在命令行,Ant任务和Maven插件中). 我将澄清我的问题:

I read documentation related to updateSQL and it is not answers the requirements of "dry run". It just generates the SQL (in command line, in Ant task and in Maven plugin). I will clarify my question:

Liquibase是否支持对交易的控制?

Does Liquibase support control on transactions?

我想在执行Liquibase变更日志之前打开事务,并在执行变更日志后回滚事务. 当然,我需要验证执行结果.

I want to open transaction before executing of Liquibase changelog, and to rollback the transaction after the changelog execution. Of course, I need to verify the result of the execution.

有可能吗?

已添加

在无法控制事务(或空运行)的情况下,我们无法将所有架构迁移到Liquibase.

Without control on transactions (or dry run) we can not migrate to Liquibase all our schemas.

请帮助.

推荐答案

您可以尝试"updateSQL"模式,它将连接db(检查您的访问权限),获取db锁,生成/打印要应用的SQL语句(基于在db状态下,并且您当前是liquibase更改集),它也会打印出db当前状态下缺少的chageset id并释放db锁定.

You can try "updateSQL" mode, it will connect db (check you access rights), acquire db lock, generate / print SQL sentences to be applied (based on db state and you current liquibase change sets) also it will print chageset id's missing in current state of db and release db lock.

这篇关于Liquibase是否支持空运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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