Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

sql - Does Liquibase support dry run?

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

Important question for us is if Liquibase supports dry run:

  • We need to run database changes on all schemas without commit to ensure we do not have problems.
  • In case of success all database changes run once again with commit.

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

Added after the answer

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:

Does Liquibase support control on transactions?

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.

Is it possible?

Added

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

Please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...