To exute a sql tag (or sql statement) without writing in databasechangelog?

Is there any way to execute a sql tag (or sql statement) by liquibase without writing a row in the databasechangelog table?

My situation is the next:
I want to execute, more than once, a sql file with the same Author, same ID and same FileName. Sometimes the file is unchanged so I put runAlways=“true” in changeSet Tag. Other times the file is changed so a liquibase.exception.ValidationFailedException is launched to the user. To force the execution of the file in validationFailedException case, a user variable is used. If this variable is true, a liquibase xml is exuted previously:

    <?xml version="1.0" encoding="UTF-8"?> http://www.liquibase.org/xml/ns/dbchangelog/1.9"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">       update DATABASECHANGELOG SET MD5SUM=NULL WHERE AUTHOR='${author.name}'  AND ID='${id.change}';      

But I want to execute the tag that updates the md5sum to null using Liquibase without it writing a row (${Author-name}-Forcing md5Sum, ${id.change}, filename…) in the databasechangelog table.

There is a runOnChange=“true” attribute that you can use.  If you specify it on a changeSet, it will execute that change every time the checksum is different than what is stored in the database. 

You can use it along with the runAlways and have a changeSet always run and not complain if there is a checksum failure.  You may be able to use it on the changeSets that do change and avoid the work-around you are doing.

Does that help?

Nathan

I know about this changeSet property, but I has asked for two reasons:
- To introduce a possibility in liquibase to execute sql / sql file / refactoring tags with zero-change in databasechangelog. I think it is not possible at the moment because it is always necessary to put author and id with no null values.

  • Because I am lazy and I want to do this with the minimum code changes :P!

But if you say that it works with runAlways=“true”, and if user wants to force updated with runOnChange=“true” at the same time, I think it is a minimum change.

Many thanks!!