0

I want to generate a SQL file from my changelog file which only contains the databasechangelog table and inserts in it the current state of the database. In the liquibase documentation there is an article (http://www.liquibase.org/2015/07/without-a-connection.html) where is written that you can set outputLiquibaseSql to data_only but in my case it does not work. My properties file looks like this:

driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath: sqljdbc42.jar
url: offline:mssql?outputLiquibaseSql=data_only
changeLogFile: cl.xml
outputFile: output.sql

but when I use updateSql via command-line it generates the SQL file with all statements and not only the databasechangelog table and INSERTS. Is there any fix for this? Or ist there another way to create a SQL file only with databasechangelog table INSERTS? I am using liquibase 3.5.5.

1 Answer 1

1

For me a combination of outputLiquibaseSql=true and changeLogSyncSQL worked. So the properties file looked like this:

driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
classpath: sqljdbc42.jar
url: offline:mssql?outputLiquibaseSql=true
changeLogFile: cl.xml
outputFile: output.sql

and then I used liquibase changeLogSyncSQL via command-line. Then liquibase generated a SQL file with only databasechangelog table statements.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.