Output yaml and resulting sql is ordering incorrectly for foreign keys on new columns

Description

When creating a diff on a database with a table that has an added column which has a foreign key on it, the output yaml puts the AddForeignKeyConstraint changeset BEFORE the addColumn changeset for the baseColumn. This obviously doesn't work at all when attempting to apply the diff.

  • changeSet:
    id: 1581737360210-984
    author: colin (generated)
    changes:

  • addForeignKeyConstraint:
    baseColumnNames: aminoAcidSequenceId
    baseTableName: extendedMeasurementValue
    constraintName: extnddMsrmnt_amnAcdSqnc_fk
    deferrable: false
    initiallyDeferred: false
    onDelete: CASCADE
    onUpdate: NO ACTION
    referencedColumnNames: id
    referencedTableName: aminoAcidSequence
    validate: true

  • changeSet:
    id: 1581737360210-1034
    author: colin (generated)
    changes:

  • addColumn:
    columns:

  • column:
    name: aminoAcidSequenceId
    type: int4
    tableName: extendedCategoryValue

Environment

postgres 11.6 linux liquibase .3.8.3

Reporter

Colin Wilson

Components

Affects versions

Priority

Major
Configure