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

DAT-13285 - Fix CheckSum generation issues + improvement #3914

Merged
merged 64 commits into from
May 5, 2023
Merged

Conversation

filipelautert
Copy link
Collaborator

@filipelautert filipelautert commented Mar 7, 2023

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

Fixes #4192
Fixes #3549

MalloD12 and others added 30 commits December 15, 2022 21:53
…rateCheckSum logic from createProcedure change
…same method logic for CreateView change, plus some minor refactorings.
…hich changed after upgrading algorithm version.
@MalloD12 MalloD12 changed the base branch from master to 1_9 April 18, 2023 15:45
@MalloD12 MalloD12 changed the base branch from 1_9 to master April 18, 2023 15:46
@MalloD12
Copy link
Collaborator

@filipelautert - @suryaaki2 - @XDelphiGrl: guys, I think I'm done with the latest changes we have decided to incorporate as part of this PR (SQLFile and Change objects which can specify body as part of a SQL file). Please feel free to review this again and let me know if you have any questions/requested changes.

Thanks,
Daniel.

@MalloD12
Copy link
Collaborator

@nvoxland would you mind having a look at this when you have a chance? But it's basically what we've seen/discussed earlier.

cc: @filipelautert - @suryaaki2

@MalloD12
Copy link
Collaborator

Adding a TEST note about the latest changes made here was an issue users reported here. The fix for this has ended up with changes on CreateProcedure, CreateView and SQLFile. This has been manually and unit tested by me, but if there is any other scenario anyone can think of I'm happy to add more.

Basically, the issue was property value was not being replaced in an indicated SQLFile. Here’s a changelog example of the discussed issue:

<?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-3.8.xsd">

  <property name="property1" value="value1" global="true"/>

  <changeSet author="x" id="1" runOnChange="true">
    <sql>
      drop synonym if exists synonym1;
      CREATE SYNONYM synonym1 FOR [${property1}].[dbo].[TEST1]
    </sql>
    <rollback>
    </rollback>
  </changeSet>

  <changeSet author="x" id="2" runOnChange="true">
    <sql>
      drop synonym if exists synonym2;
    </sql>
    <sqlFile
      path="synonym2.sql"/>
    <rollback>
    </rollback>
  </changeSet>

</databaseChangeLog> 

Where synonym2.sql content file was:

CREATE SYNONYM synonym1 FOR [${property1}].[dbo].[TEST1]

MalloD12 and others added 6 commits May 3, 2023 10:42
# Conflicts:
#	liquibase-standard/src/main/java/liquibase/change/core/CreateProcedureChange.java
…y changesets during checksum upgrade (#4193)

* Makes sure that we reset ChangeLogHistoryServiceFactory after upgradingCheckSums.

* Rollback DropAllCommand.java changes.

* Trigger Build

* Rollback changes

* Makes ReleaseLocks Command checksum upgrade consistent with ListLocks

* Fix null md5sum issues during checksum upgrades

* When updating checksums use the stored file path instead of the generated one as we changed the way that we store paths during the years

* Fix validate command

* Fix unexpected-changesets command

* Adding unit tests for PR 4210 .

---------

Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>
@suryaaki2 suryaaki2 merged commit d100bbb into master May 5, 2023
@suryaaki2 suryaaki2 deleted the DAT-13285 branch May 5, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Changing a property value doesn’t rerun a changeSet SQL checksum not resilient to all formatting changes
5 participants