Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquibase <loadData> with file relative to the script file

Tags:

liquibase

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?

like image 392
amorfis Avatar asked Sep 22 '14 14:09

amorfis


1 Answers

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
               ">
like image 93
gjoris Avatar answered Nov 13 '22 04:11

gjoris