Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiffChangeLog/GenerateChangeLog produces invalid XML in 4.3.3 #1803

Closed
nvoxland opened this issue Apr 15, 2021 · 1 comment
Closed

DiffChangeLog/GenerateChangeLog produces invalid XML in 4.3.3 #1803

nvoxland opened this issue Apr 15, 2021 · 1 comment

Comments

@nvoxland
Copy link
Contributor

nvoxland commented Apr 15, 2021

Environment

Liquibase Version: 4.3.3

Database Vendor & Version: Postgresql for sure, probably all

Description

When running diffChangelog or generateChangelog, addColumn elements are added BEFORE corresponding createTable elements.

Steps to Reproduce

  1. Create a database with:
<changeSet author="author_name" id="1">
        <createTable tableName="baseInfo">
            <column name="id" type="INTEGER">
                <constraints nullable="false" primaryKey="true" primaryKeyName="baseInfo_pkey"/>
            </column>
            <column name="first" type="VARCHAR(150)"/>
            <column name="middle" type="VARCHAR(150)"/>
            <column name="last" type="VARCHAR(150)"/>
        </createTable>
    </changeSet>
  1. Run “liquibase generateChangeLog”
  2. Generated generated changelog looks like:
<changeSet author="Edi(generated)" id="1618486085348-1">
        <addColumn tableName="baseInfo">
            <column name="id" type="int4">
                <constraints nullable="false"/>
            </column>
        </addColumn>
    </changeSet>
    <changeSet author="Edi (generated)" id="1618486085348-2">
        <createTable tableName="baseInfo">
            <column name="id" type="INTEGER">
                <constraints nullable="false" primaryKey="true" primaryKeyName="baseInfo_pkey"/>
            </column>
            <column name="first" type="VARCHAR(150)"/>
            <column name="middle" type="VARCHAR(150)"/>
            <column name="last" type="VARCHAR(150)"/>
            <column name="RandomId" type="INTEGER"/>
        </createTable>
    </changeSet>

which fails “liquibase update” because the addColumn command should not be there.

@sync-by-unito
Copy link

sync-by-unito bot commented Apr 19, 2021

➤ Pavlo Tytarchuk commented:

Verified with version 4.3.4 #54 . Moving to “Ready to Merge”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants