I am using Liquibase 4.0 and I am executing DB changes using SQL scripts. So I am pointing the SQL files path in the master change log to execute the changes via Liquibase. Now I need to segregate them since I have a requirement to have different tablespace for both tables and indexes. Hence I tried to find an option for parameterization in Liquibase, but could not find so. My Masterchangelog for the change looks like:-
<changeSet author="sanjib" id="01_PR_001">
<sqlFile dbms="oracle"
endDelimiter=";"
path="../scripts/PR_001/PR_001.sql"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<rollback>
<dropTable cascadeConstraints="true" tableName="PERSON"/>
</rollback>
</changeSet>
The Liquibase.properties file looks like this:-
driver: oracle.jdbc.OracleDriver
classpath: ojdbc6.jar
url: jdbc:oracle:thin:@localhost:1521/xe
databaseChangeLogTablespaceName:DATA
username: sanjib
Now the main issue is that the table defined in the SQL script is not created under the user's tablespace. Instead, it is using the username from the properties file as tablespace name, hence facing the issue that Table cannot be created since tablespace is missing, which is an obvious error. Hence to create the DATABSAECHANGELOG & DATABASECHANGELOGLOCK table, I had to add the property 'databaseChangeLogTablespaceName' in the properties file, but the tables and indexes are not getting created.
So please help in fixing the 2 issues. How to point the installation via Liquibase to use the user's default tablespace instead of using the username as tablespace. Can we parameterize the Table's tablespace and index's tablespace using the above setup as defined in the XML file?