updateSQL (sql output) without DATABASECHANGELOG/DATABASECHANGELOGLOCK in the script

Hello everybody,

When I generate a sql output with the command mvn liquibase:updateSQL, it’s work fine. But in the file generated, there are the lines about DATABASECHANGELOG/DATABASECHANGELOGLOCK tables (insert,update,…)
I want a file WITHOUT that because in my production env, I don’t want tables databasechangelog and databasechangelock tables.

Is there an option to export SQL without these lines  ?

Thank you

No, there isn’t an option for that since the assumption is that we want to track which changes have been applied to the production database as well.

You could create a feature request on liquibase.jira.com, however


Is this feature available now?

ANy updates on this feature

I have the same problem. My current workaround is to filter out these lines programmatically (I run liquibase from a Java program), but it would be much nicer if it was an option.

I would also like the ability to somehow inject comments in the generated SQL, perhaps by annotations in the changeset refactorings.

Is there at least a way to accomplish this programmatically?


There would be a few ways to do it problematically. The tables are created by the CreateDatabaseChangeLogTableGenerator and CreateDatabaseChangeLogLockTableGenerator classes in liquibase.sqlgenerator.core. If you create an extension (liquibase.org/extensions) that override those classes with a generateSql() method that returns null, liquibase will never run any SQL related to the tables.