Skip to content
Advertisement

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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement