I have a software wich uses multiple schemas. I made db.changelog-master.xml to maintain different releases and db.changelog-S16.xml to current sprint (it's currently sprint 16 going on). db.changelog-S16.xml is looking like this:
<?xml version="1.0" encoding="UTF-8"?>
<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.1.xsd">
<include file="my_schema_1.xml" relativeToChangelogFile="true" />
</databaseChangeLog>
Problem here is, that I want to make one changelog which could update all the schemas in one but I have failed to find a way to hardcode the schemaname in the changelog. Can it be obtained to the changelog via generateChangelog somehow (so the schemanames would be in my_schema_1.xml), or can I type it to the changelog? What I am looking for would be like this:
<?xml version="1.0" encoding="UTF-8"?>
<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.1.xsd">
<TAG WHERE I COULD INSERT SCHEMANAME>
<include file="my_schema_1.xml" relativeToChangelogFile="true" />
<TAG WHERE I COULD INSERT SCHEMANAME>
<include file="my_schema_2.xml" relativeToChangelogFile="true" />
etc...
</databaseChangeLog>
Because now it is only possibly to change schema in the update clause when running the liquibase from the commandline. This would be handy too when I am making customer databases to their servers. I could just make customer_master.xml and hardcode their schemanames in it and then run it to their server from the scratch. So far only place I have found to insert schema name is when you make the commandline call. That would mean that I would have to update each schema differently or make some powershell script to do them for me...