0
votes

I have a liqubase changelog.xml. It includes few "include file" with changes. For example, base script with creating a table and another one with adding a new field to this table.

Could I get sql-script with one "create table..." statement, which include all fields. And I don't want to connect to DB. Just use liquibase xml files and jar libs.

Version liquibase - 3.5.5.

I tried to run do this command: java -jar liquibase-core-3.5.5.jar --url=offline:mssql?outputLiquibaseSql=true --changeLogFile="changelog.xml" --outputFile="all.sql" updatesql

changelog.xml:

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
    <include file="base.sql" relativeToChangelogFile="true"/>
    <include file="changelog_20180719.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

but all.sql contains only sql from first included file (base.sql)

Thanks

1

1 Answers

0
votes

You can do that, you will need to use an 'offline' connection URL. Take a look at this recent question for an example. If you are targeting a different database, the URL will be different. liquibase databasechangelog table in updateSql mode