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

addColumn ignores deleteCascade=true #3516

Closed
Mahoney opened this issue Nov 29, 2022 · 0 comments · Fixed by #5398
Closed

addColumn ignores deleteCascade=true #3516

Mahoney opened this issue Nov 29, 2022 · 0 comments · Fixed by #5398
Labels
DBPostgres good first issue This issue is an easy starter project for new contributors. TypeBug

Comments

@Mahoney
Copy link

Mahoney commented Nov 29, 2022

Environment

Liquibase Version: 4.17.2

Liquibase Integration & Version: Library call

Liquibase Extension(s) & Version: N/A

Database Vendor & Version: Postgresql 11

Operating System Type & Version:

Infrastructure Type/Provider: AWS

Description

The following YAML:

databaseChangeLog:

  - changeSet:
      id: an_id
      author: an_author
      changes:

        - addColumn:
            tableName: INVITATIONS
            columns:
              - column:
                  name: ORGANISATION_ID
                  type: BIGINT
                  constraints:
                    foreignKeyName: FK_INVITATION_ORGANISATION
                    referencedTableName: ORGANISATIONS
                    referencedColumnNames: ORGANISATION_ID
                    deleteCascade: true

does not generate the expected ON DELETE CASCADE in the foreign key creation.

It should. The documentation for addColumn references the documentation for column which documents the Constraints sub-tag as containing deleteCascade.

@nvoxland nvoxland added the good first issue This issue is an easy starter project for new contributors. label Jan 25, 2023
andreiyusupau added a commit to andreiyusupau/liquibase that referenced this issue Dec 17, 2023
Handling of deleteCascade config added to AddColumnGenerator.

Signed-off-by: Andrei Yusupau <andrei.yusupau@gmail.com>
@MalloD12 MalloD12 assigned MalloD12 and unassigned MalloD12 Jan 4, 2024
filipelautert pushed a commit that referenced this issue Jan 22, 2024
* Fix issue #3516 addColumn ignores deleteCascade=true
Handling of deleteCascade config added to AddColumnGenerator.

Signed-off-by: Andrei Yusupau <andrei.yusupau@gmail.com>

* Test updated to be tested against different DBs.

---------

Signed-off-by: Andrei Yusupau <andrei.yusupau@gmail.com>
Co-authored-by: rberezen <ruslan.berezenskyi@gmail.com>
Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBPostgres good first issue This issue is an easy starter project for new contributors. TypeBug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants