首页 > 解决方案 > Liquibase generateChangeLog doesn't retrieve all schemas with postgres

问题描述

I m new to liquibase and tried to generate a changelog from an existing database my database contains 3 schemas when I execute the following command :

    Liquibase --driver=org.postgresql.Driver 
              --classpath=postgresqljdbc4.jar 
              --changeLogFile=db.changelog.xml 
              --url="jdbc:postgresql://localhost:5432/my_bd" 
              --username=username 
              --password=password 
              generateChangeLog

the db.changelog.xml is generated but it retrieve only one schemas information

How to get all the schemas information

note that every schema contains tables

标签: postgresqlliquibase

解决方案


Liquibase only works with a single schema at a time, so you would need to tell it which schema to generate a changelog for, and do that three times. You can specify the schema for postgres in the url. See this question for details:

Is it possible to specify the schema when connecting to postgres with JDBC?

If you need to work with multiple schemas, you might want to look at Datical DB, as that product has the ability to work with multiple schemas in a single changelog.

(disclaimer: I work for Datical)


推荐阅读