Different versions of dbchangelog.xsd in project?

In our project are different developer creating different xml files.

I noticed that some start with

<?xml version="1.0" encoding="UTF-8"?>

others dont have that. (some of these files get included in another bigger xml changelog file, so I guess if you include these files with the xml version tag it would corrupt this bigger file?)

Also it seems that the xml files have different xsd versions.
e.g.

xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd"

compared to

        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                                        https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.15.xsd"

What is the xsd defining? Is it relevant that not all xml files have the same version?

The xsd is defining the syntax allowed for the xml Liquibase change-types (And probably other stuff also).

For example:

Imagine a new change-type “create-PK” was added to Liquibase in 4.19. Unless you are using the 4.19 xsd (or greater), the new change-type would not be recognized by Liquibase.

Hope that helps.

1 Like

how would you do it if you have several .xml files generated that later get incorporated into a bigger .xml file?

Is it normal that you would use newer versions for new .xml files or would you stay with version?

I see two options:

  • update all versions
  • leave it like it is and compose the big xml file of different versions.

at the moment the big .xml file includes the smaller .xml files and every smaller .xml has its own .xsd definition

e.g.

the big xml

<databaseChangeLog
<?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-4.9.xsd"
        objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">

    <include file="db/includes/init.xml"/>
    <include file="db/includes/create_test_table_1"/>
    <include file="db/includes/create_test_table_2"/>
   .....

every included .xml starts with databaseChangeLog tag which contains a specific version e.g.

<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
                                        https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd"
        objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">

so would that result in a consistent big xml file as each included xml file has its own databasechangelog tag which has its own version? So each of the part would define its own proper version.

The xsd can be different in each .xml file. It only needs to be updated if you need functionality provided by a new Liquibase version.

is there an good overview site over the different changes in versions?