In liquibase, I can include file with path relative to the current script file:
<include file="initialise/data.xml" relativeToChangelogFile="true"/>
In a change set, I can also point a file with the data I want to insert, e.g. like this:
<changeSet author="system-init" id="load-Company">
<loadData tableName="Company" file="liquibase/initialise/Company.csv">
However, this time I need to use path relative to the current directory where I run the liquibase command. Is it possible to somehow use script-relative path here?
This is solved in the latest version of Liquibase. See also: https://www.liquibase.org/2014/11/liquibase-3-3-0-released.html
Improvements
[CORE-549] – relativeToChangelogFile for loadData, loadUpdateData, sqlFile
Mind to update your XML schema location to the 3.3 version:
<xsi:schemaLocation="
http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd
">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With