Liquibase with multiple circuits

I have software using several circuits. I did db.changelog-master.xml to support different versions and db.changelog-S16.xml in the current sprint (sprint 16 is currently in progress). db.changelog-S16.xml is as follows:

<?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>

The problem is that I want to make one change log that could update all the schemas in one, but I could not find a way to hard-code the schemaname in the change log. Can it be obtained in the change log through generateChangelog somehow (so that the schemanames will be in my_schema_1.xml), or can I enter it in the change log? What I'm looking for will be as follows:

 <?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>

Liquibase . , . client_master.xml hardcode schemanames , . , , , - . , - powershell script, ...

+4
1

"schemaName", . , <createTable tableName="person" schemaName="customer">

, . , , , , <createTable tableName="person" schemaName="${primarySchema}">, , .

changeSet, , script.

+3

Source: https://habr.com/ru/post/1545978/


All Articles