diffChangelog working only on public schema

I have two different redshift databases which have multiple schemas in them . When I use diffChangelog with appropriate parameters , liquibase generates a dbchangelog.sql file which consist of changesets. But those changesets are only with respect to public schema and doesn’t include other schemas. How to use diffChangelog to get changesets for all schemas ?

Hi @Ross

Could you please share the exact command you have tried to generate changelog file?

This will help to provide details about what went wrong.

Also please provide the Liquibase version you are currently using.

Thanks,
Rakhi Agrawal

Liquibase version : 4.3.5
Command used :
liquibase
–changeLogFile=dbchangelog.xml
–outputFile=mydiff.txt
–url=
–username=
–password=
diffChangeLog
–referenceUrl=
–referenceUsername=
–referencePassword=

Both databases are redshift

Hey @Ross

There are below ways you can achieve your goal:

  1. Using DB snapshot as provided on this link.

Run the diffChangeLog command specifying the snapshot (an offline mode) and the database with new changes:

liquibase
--referenceUrl=jdbc:postgresql://localhost:5432/MYDATABASE
--url=offline:postgresql?snapshot=mySnapshot.json
--changeLogFile=mydiffchangelog.xml
diffChangeLog

The generated changelog will contain new changes. Now, you can compare and confirm those changes.

  1. The other way is you can use below command:
liquibase
--changeLogFile=dbchangelog.xml
--outputFile=mydiff.txt
--url=
--username=
--password=
--defaultSchemaName=
diffChangeLog
--referenceUrl=
--referenceUsername=
--referencePassword=
--referenceDefaultSchemaName=

Just provide one schema name at a time to generate diff results. (Should work with more than one schema names as well, haven’t tried)

  1. You can also try this command:
liquibase
--changeLogFile=dbchangelog.xml
--outputFile=mydiff.txt
--url=
--username=
--password=
--schemas= <all comma separated schema names goes here>
diffChangeLog
--referenceUrl=
--referenceUsername=
--referencePassword=

This should also work.

Please give these a try and let us know the results.

Thanks!
Rakhi Agrawal

1 Like

Thank you very much @rakhi