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

查看:22
本文介绍了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"模式,它会连接数据库(检查您的访问权限)、获取数据库锁、生成/打印要应用的 SQL 语句(基于在 db 状态和您当前的 liquibase 更改集上)它还会打印 chageset id 在 db 的当前状态下丢失并释放 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天全站免登陆