Liquibase-test-harness defaultSchema

Our team develop modification of this elegant framework, and the main difference is usage of test containers on the startup rather than pre-configured manually docker containers. So, we added LTH as a dependency and customized TestConfig to map container props onto DatabaseUnderTest object. The only thing makes me struggle is the ability to set default schema. We use postgres schema in tests and dev, so, i wonder whether its possible to set up schema name and not to write it manually in each piece of changeset? As far as I even hardcoded value into DatabaseUnderTest.dbSchema, it doesn’t work and LTH as dependency seems hard to debug). Thanks.

Hi there, @tarmogoyf - welcome to the Liquibase community!

The easiest way to do what you’re attempting might be to provide the schema in the JDBC connection URL. Then the supporting files would need to be changed to remove the schema name. For instance, since you are testing with Postgres, then in expectedSQL files, you need to remove the public schema name (i.e. if it doesn’t match the default public schema name that we use).

Give that a try and let me know how it goes. :slight_smile:

You were right the solution was about mofidying expectedSql and remove schema name. Thanks and good luck in evolving such a great product!