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

Improve support for DB2[z] empty table precondition #5043

Conversation

MichaelKern-IVV
Copy link
Contributor

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Adds statements for DB2 to the TableIsEmptyGenerator

@MalloD12 MalloD12 changed the base branch from master to 3.10.x October 13, 2023 21:52
@MalloD12 MalloD12 changed the base branch from 3.10.x to master October 13, 2023 21:52
@MalloD12 MalloD12 added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Oct 13, 2023
@MalloD12 MalloD12 self-assigned this Oct 13, 2023
@MalloD12 MalloD12 self-requested a review October 13, 2023 21:58
Copy link
Contributor

@MalloD12 MalloD12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me. I manually test it against a DB2 instance by deploying a create table change and then the below changeset:

<changeSet id="tableIsEmptyShouldFail" author="flautert">
        <preConditions onFail="MARK_RAN">
            <tableIsEmpty tableName="csvdata"/>
        </preConditions>
        <!-- if table is dropped then next changesets will fail, thus it is an indirect check -->
        <dropTable tableName="csvdata" />
    </changeSet>

Which dropped the csvdata table successfully. See below:
Screenshot 2023-10-13 at 9 03 35 PM

Thanks @MichaelKern-IVV!

Signed-off-by: filipe <flautert@liquibase.org>
@filipelautert filipelautert added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Oct 23, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.4% 82.4% Coverage
0.0% 0.0% Duplication

@filipelautert filipelautert changed the title Support the empty table precondition for DB2 Improve support for DB2[z] empty table precondition Jan 15, 2024
@filipelautert filipelautert merged commit acfd4c3 into liquibase:master Jan 15, 2024
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBDB2LUW DBDB2Z SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions TypeEnhancement
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants