How to specify defaultSchemaName for spring migration

Hi all:

Liquibase command line tool supports specifying schema through the option:

Does spring migration support specifying defaultSchemaName as well?


Not currently.  What you’ll have to do is create a subclass of liquibase.integration.spring.SpringLiquibase and override the createLiquibase(Connection conn) method with something like this:

    protected Liquibase createLiquibase(Connection c) throws DatabaseException {     Liquibase liquibase = super.createLiquibase(c);     liquibase.getDatabase().setDefaultSchemaName(SCHEMA_YOU_WANT);     return liquibase; }