working with multiple schemas on 3.x


I’ve read that liquibase now supports multiple schema but haven’t found it in documentation.

I’m looking forward to add version control to an already existing postgresql database with multiple schemas.

What is the best approach?

How can I  build a change log for multiple schemas at once?

How can tell to the liquibase command line tool to add schemaName attribute to generated change log?

Thanks in advance for the responce,

Many thanks for the new 3.0.3 release to the Liquibase Team!

Documentation has always been a bit behind, fortunately I am working on Liquibase full time now and can get through a lot more.

You can create a single changelog file that referenes multiple schemas. Liquibase will use the connection default schema to store the datatabasechangelog files unless you override it with the defaultSchema and/or liquibaseSchema flag. Within each change, you can specify a schemaName or similar attribute to control what schema to run the change against.

You cannot currently run generateChangeLog against multiple schemas at once, but if you want one changelog file that spans multiple schemas you can easily merge the created changelog files together.

You can use the --includeSchema attribute to control whether the generated changelog includes the schema name or not.