Liquibase - liquibaseSchemaName parameter not working with Redshift

I’ve created a separate schema in Redshift for my changelog tables:

CREATE SCHEMA liquibase_non_prd;

ALTER DEFAULT PRIVILEGES IN SCHEMA liquibase_non_prd GRANT ALL ON TABLES TO GROUP readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA liquibase_non_prd GRANT ALL ON TABLES TO GROUP readwrite;

Liquibase creates my log tables but not in desired schema. Instead, I see them in public.

In my db.config file I do use liquibaseSchemaName parameter to no success.

cat <<eof > liquibase.properties
driver: com.amazon.redshift.jdbc42.Driver
url: jdbc:redshift://${bamboo_secret_deploy_host}:${bamboo_secret_deploy_port}/dbname?sslmode=verify-full
username: ${bamboo_secret_redshift_non_production_deploy_username}
password: ${bamboo_secret_redshift_non_production_deploy_password}
changeLogFile: src/main/resources/db/changelog/db.config-development.yml
liquibaseSchemaName: liquibase_non_prd
contexts: !norun
databaseChangeLogTableName: chg_lg_t
databaseChangeLogLockTableName: chg_lg_lck_t
clearCheckSums: TRUE
eof

mv liquibase.properties ${bamboo_result_artifactId}-${bamboo_result_version}/src/main/resources

In my bamboo logs I found below entry:

build   05-Jul-2022 18:43:32    [INFO]   'liquibaseSchemaName' in properties file is not being used by this task

Software version: liquibase-redshift 4.3.2
Ci-CD tool: Bamboo

Questions:

  1. Why is this param not used?
  2. How to get my desired schema populated with log tables?
  3. Can I enforce Liquibase to create liquibase_non_prd while running?

This sounds like it might be a bug. Can you submit a bug report here so our team can see if we can replicate the issue? How to Report Liquibase Issues and Bugs | Liquibase.org

1 Like

Below queries ran in order fixed the issue:

--run these ddls before first Liquibase run in target database
CREATE SCHEMA IF NOT EXISTS liquibase_non_prd;

GRANT ALL ON SCHEMA liquibase_non_prd TO GROUP readonly;
GRANT ALL ON SCHEMA liquibase_non_prd TO GROUP readwrite;

ALTER DEFAULT PRIVILEGES IN SCHEMA liquibase_non_prd GRANT ALL ON TABLES TO GROUP readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA liquibase_non_prd GRANT ALL ON TABLES TO GROUP readwrite;


--run these ddls after first Liquibase run in target database
GRANT ALL ON TABLE  liquibase_non_prd.chg_lg_lck_t TO GROUP readonly;
GRANT ALL ON TABLE  liquibase_non_prd.chg_lg_lck_t TO GROUP readwrite;

GRANT ALL ON TABLE  liquibase_non_prd.chg_lg_t TO GROUP readonly;
GRANT ALL ON TABLE  liquibase_non_prd.chg_lg_t TO GROUP readwrite;

@tabbyfoo - thx! I found a workaround but still worth incorporating into the tool :wink:

1 Like