Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquibase run changeset every time

I want to insert usernames to the database based on a system property. The system property value can be

users="user1;user2;user3"

This process must be repeatable, meaning that every time the applications is deployed, the migration/changeset must check the system property, and if it has changed and the users are not already in the database it should insert them. In order to achieve this I am thinking of using the customChange tag. But I want this change to run every time the liquibase runs. Is this possible using liquibase or should I create a custom contextLoadListener?

like image 393
Ervis Zyka Avatar asked Dec 18 '22 19:12

Ervis Zyka


1 Answers

A standard attribute available to all changesets is the runAlways attribute, which should do what you want. There is also a runOnChange attribute available.

Documentation on the attributes available is here: http://www.liquibase.org/documentation/changeset.html

like image 144
SteveDonie Avatar answered Dec 21 '22 10:12

SteveDonie