I’m using Liquibase 4.3.3. I’m having trouble using the defaultSchemaName parameter in the application.yml file:
liquibase:
user: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
change-log: classpath:db-changelog/dbchangelog-master.yml
enabled: false
parameters:
defaultSchemaName: BOO_USER
In general, is there a way to specify a default schema, so all sql files with statements like:
foo.sql: CREATE TABLE FOO1…
foo2.sql: CREATE TABLE FOO2…
all go in the same schema without having to specify it?
Thanks,
Jerry
Hi @jerryrgcm,
This should work for a normal liquibase.properties file. Like it’s described in the documentation here: Create and Configure a liquibase.properties File
However, since you are calling the file application.yml, I’m wondering if you are running this from Spring or Spring Boot perhaps? In which case it would be spring.liquibase.default-schema
like you can see here: Using Liquibase with Spring Boot
Good question! And any more detail would be helpful.
-PJ
PJ,
Thanks for responding! Yes, I should have mentioned that I am running this from Spring and my target is RDS Oracle in AWS. Also, the spring deployment is run through Bamboo. My application.yml file looks like this:
spring:
main:
web-application-type: none
application:
name: Application
datasource:
url: ${DATABASE_URL}
username: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
liquibase:
user: ${DATABASE_USERNAME}
password: ${DATABASE_PASSWORD}
default-schema: BOO_USER
When I add the “default-schema” line, the deployment succeeds but doesn’t do anything – my test table is not in all_objects in the Oracle target at all. When I take it out, the table is created in the schema of the account connecting to the Oracle instance.
Is it possible that the Bamboo deployment overrides the default schema parameter?
Thanks again,
Jerry
Hi @jerryrgcm,
I don’t think that Bamboo would be overriding the parameter.
Can you see anything in the logs around the Liquibase portion that could give us more information?
-PJ