We are starting using liquibase for our application on the spring-boot. One of requirements use plain sql for liquibase. We have many sql files for initialization database. I check documentation https://www.liquibase.org/documentation/sql_format.html but not found information how can i create hierarchy of change log sql's files. Spring boot properties liquibase.change-log awaiting single file. I tried to separate file names by , or ; all times got error from spring-boot Cannot find changelog location...
So my question:
How can i declare execution of another file or files in "sql format"??
Like xml equivalent: <include file="second_changelog.sql"/>
<include file="third_changelog.sql"/>
Not worked example first_changelog.sql :
--liquibase formatted sql
--changeset author_1:1
UPDATE [dbo].[customers] SET name='HD_1' WHERE id = '11';
--import file=second_changelog.sql
--import file=third_changelog.sql
PS. Please do not suggest xml, because of i need only SQL
You can use one XML file which contains multiple references to plain sql (see for details https://www.liquibase.org/documentation/changes/sql_file.html)
Example:
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<changeSet id="init" author="author">
<sqlFile encoding="utf8" path="first_changelog.sql"/>
<sqlFile encoding="utf8" path="second_changelog.sql"/>
</changeSet>
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