vermachint
vermachint

Reputation: 93

Using modifySql in liquibase formatted sql

I have changesets in a liquibase formatted sql file. I want to use the modifySql functionality with replace. I could not find the usage here and neither FormattedSqlChangeLogParser.java.

Is there a way to make it work? Here is what I have tried:

--changeset myuser:1 context:comm
--modifySql: replace: getutcdate with: current_date

My problem is that I have a particular date function (getutcdate) that is used in the sql following the changeset which does not work with h2. This is the reason I am trying to use modifySql to replace it with a function that h2 supports.

Upvotes: 0

Views: 263

Answers (1)

Jens
Jens

Reputation: 6383

There is an improvement ticket in liquibase jira that Nathan Voxland (creator of liquibase) created: https://liquibase.jira.com/browse/CORE-1431

Unfortunately it does not have a fixVersion (as of now) which (I guess) means it is not yet planed to be implemented. But the description also states that there is support for changelog parameters in formatted SQLs:

There is support currently for changelog parameters in formatted SQL but modifySql would be more convenient at times.

Maybe you can achieve what you're looking for with changelog parameters?

Upvotes: 1

Related Questions