0

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

M.A.Bell
  • 326
  • 1
  • 13

1 Answers1

2

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)

SteveDonie
  • 7,440
  • 3
  • 36
  • 37
  • 1
    So the best way is to create a master changelog and include in it the changeLog of every schemas?? – M.A.Bell Apr 30 '18 at 14:32
  • 1
    That could be one possible approach. Datical has actually extended Liquibase quite a bit and can handle multiple schemas in a single changelog without using includes, so that is not the approach that we use. – SteveDonie Apr 30 '18 at 16:11