Help Needed: Generating Schema-Agnostic SQL with Liquibase

I’m working on generating SQL scripts using Liquibase in our UAT environment, with the intention of applying them to the production database. However, our Oracle schema names differ between UAT and Prod, and currently, the generated SQL includes schema-qualified table names like "uat_schema"."table_name", which causes compatibility issues.

I’d like to generate SQL scripts without including any schema name, so they can be safely used across different environments.

Does anyone know how to configure Liquibase (we’re using the Gradle plugin) to exclude the schema name from the generated SQL?
Or is there an established approach we follow in our team to handle this scenario?

Appreciate any guidance—thanks!

Hi @wjfqvi & welcome to the forums!

I don’t have a sample Gradle project handy to test your scenario and I have observed that when I use the CLI, I don’t get schema identifiers unless I ask for them explicitly using --include-schema=true

It could be that the default setting of include-schema for the Gradle plugin is different than the CLI. In that case you might be able to set it to false in your properties/defualts file, an environment variable or JVM arg.

  • Properties file - liquibase.command.includeSchema=false
  • Environment variable - LIQUIBASE_COMMAND_INCLUDE_SCHEMA=false
  • JVM arg - -DliquibaseIncludeSchema=false

Hope this helps.