Cannot migrate multiple times using one Liquibase instance
Description
Environment
Tomcat 8, Java 8, PostgreSQL 9.3
discovered while testing
Activity
Show:
Hendy Irawan June 30, 2015 at 8:18 AM
Update: A better workaround is possible: Use a single PostgresDatabase
and Liquibase
, but for each iteration/schema, create a Connection
and manually execute SET SCHEMA
as per CORE-1873, e.g.
The following code does not work as intended.
Given several schemas, Liquibase will only migrate the first schema. And "ignore" the rest. Note that from the logs, Liquibase seems to be trying to read the
databasechangelog
tables of each respective schema, but it seems it's misleading:The workaround is to create a fresh
PostgresDatabase
instance andLiquibase
instance for each iteration.However the goal is to reuse the parsing and preprocessing, and reuse as much as possible (including the JDBC connection).