Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

liquibase - execution order of changesets

As far as I understand, Liquibase execute the changesets according to the order they are written in the change log. I want the changeset to be ran in another order. Is there any way to change the execution order of changesets?

A prompt response for my question would be highly appreciated.

like image 862
Nava Avatar asked Jan 27 '15 07:01

Nava


People also ask

How are database changes specified in the Liquibase changelog?

All database changes are specified in the Liquibase changelog file. A change is contained in a changeset and changesets are added to the changelog in the order they need to be deployed.

What is a changeset tag in Liquibase?

The changeset tag is a unit of change that Liquibase executes on a database and which is used to group database Liquibase Change Types together. A list of changes created by multiple changeset s are tracked in a changelog. A changeset is uniquely tagged by both an author and an id attribute s ( author:id ), as well as the changelog file path.

How can I use Liquibase contexts for Environment separation?

Environment separation (DEV, QA, PROD) can be achieved using Liquibase contexts. This functionality is helpful in the following situations: Typically, changesets in Liquibase remain untouched after they are deployed. Subsequent database changes are made when new ‘roll forward’ changesets are added to the end of the changelog.

Why does Liquibase rerun a change set that has been modified?

If Liquibase notices that the change set ( update translations) has been modified since the last execution, it will rerun it. The change is recognized by calculating a hash of the new change set code and comparing it to the one saved in DATABASECHANGELOG.


1 Answers

The order of your changelog in Liquibase is the order that changes should be deployed (executed) if needed.

Liquibase relies on you to setup the correct order.

In order to use a dynamic order that matches the current situation you should use a compare & sync tools that will generate the relevant DDL based on your source control repository and your target environment.

Dbmaestro (for which I work) offers this feature

like image 98
DBAstep Avatar answered Sep 17 '22 16:09

DBAstep