do not include create or insert into databasechangelog table when using updateSQL goal with maven

When i use the updateSQL goal to creat the sql statements, i do not want liquibase to add the insert into databasechangelog statements, Is there a way i can go that.

There is no way currently outside creating an extension to override the MarkChangeSetRanGenerator class.


Nathan

Hi,
I’ve just wanted to post the question but found this one, which is not so old. I’m in need for this functionality and have been for quite a time. I’m using it for making the SQL diff for minor version upgrade of our software where I only update the necessary tables as needed. It would be great if there were some new command like updateSqlRaw which will only ouptut the real SQL changes without the one for databasechangelog.

I would do it myself but I’m not a Java developer nor do I know the internals of liquibase. But I’ll gladly donate the implementation of this feature.

Thank You

Trigve

I just created https://github.com/liquibase/liquibase-nochangelogupdate which is an extension to suppress inserting into the databasechangelog table.


Let me know how it works for you.


Nathan

Thanks for reply and extension,
unfortunately it looks like it is still ouputting  the databasechangelock changes. I’m using the updateSql, this is my command I use inside my batch files (also with some variables which you could ignore):

  1. call %BIN_LIQUIBASE_PATH%\liquibase.bat --defaultsFile=%BIN_LIQUIBASE_PATH%\liquibase.properties --outputDefaultSchema=false --changeLogFile=update.xml --url=jdbc:postgresql:%DATABASE%:@localhost:5432: updateSql -Dschema=%DBSCHEMA% > %DIFF_SQL_INTERNAL%
I’ve placed liquibase-nochangelogupdate-1.0.jar to lib directory inside liquibase installation.

Hope I didn’t forget some step to activate the extension?

Thank You

Trigve

I think I see the problem. I had added a liquibase.ext.nochangelogupdate.enabled property to control enabling the extension but then was not handling the case where no property was specified (it was defaulting to not enabled).


I pushed out a 1.1 release that should fix the problem.


Nathan

Thanks for looking it. I don’t want to sound rude but do you have the build (.jar) of the new version by any chance? Because I don’t have environment set up for building liquibase and plugins.

Thank You

Trigve

Yes, I did. It is  at https://github.com/liquibase/liquibase-nochangelogupdate/releases


Nathan

Hmm I see there .jar for version 1.0 only. And using diff there isn’t any difference to the previous one. Or did I miss something?

Thank You

Trigve

Thanks for the .jar upload. It worked but I’ve got the problem with this system property:

  1. liquibase.ext.nochangelogupdate.enabled
Because it is system property I don’t know how to set it (as command line argument) to affect only some instances of liquibase. Because what I found on the net, the one possibility is to use -DXXX=value as “java” command line argument and when I set it in liquibase.bat it affects all instances of course. But I need to selectively turn it off/on in my workflow. So could I somehow set the system parameter through the liquibase command options? Or through some environment variables? Becuase AFAIK the liquibase’s “-D” param option is only local to liquibase.

Thank You

Trigve

After the testing and tweaking my scripts it looks like all is working fine.

Can I somehow support the project through paypal?

Thanks a lot!

Trigve

https://github.com/liquibase/liquibase-nochangelogupdate/releases/tag/liquibase-nochangelogupdate-1.1 is the 1.1. release. It should be on the releases page, although it looks like I had forgot to attach the .jar file (still getting used to the github release process).


Nathan

Through the command line you need to specify -Dliquibase.ext.nochangelogupdate.enabled=[true|false] as a java param. 


Looking at liquibase.bat, it looks like it is not respecting the JAVA_OPTS environment variable like it should. I put in a fix for 3.0.6, but locally you can change the “set JAVA_OPTS=” line to “IF NOT DEFINED JAVA_OPTS set JAVA_OPTS=” and then set the JAVA_OPTS environment variable before running liquibase.


Nathan

Good to hear it’s working for you. 


If you’d like to donate, there is a link on the sourceforge page http://sourceforge.net/projects/liquibase/ 

that leads to https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=5be3NXFOVTNYzW1sqYyeD-WAFJ-LL-1Dmf7YhpeUcifjCyiVurO83eL_aIi&dispatch=5885d80a13c0db1f8e263663d3faee8d0038486cd0d9a2f3f8e698d26650388a


Donations of any type are always very appreciated.


Nathan