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

add v8 and v9 checksum support (DAT-14872) #4310

Merged
merged 44 commits into from
Jun 20, 2023
Merged

add v8 and v9 checksum support (DAT-14872) #4310

merged 44 commits into from
Jun 20, 2023

Conversation

StevenMassaro
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

Things to be aware of

Things to worry about

Additional Context

Sorry, something went wrong.

* First draft of the changes to allow smooth checksum upgrade.

* Use a Enum to define Checksum versions.
Comment on lines 253 to 255
databaseChecksumsCompatible = !md5sumRS.stream()
.filter(m -> !m.get("MD5SUM").toString().startsWith(CheckSum.getCurrentVersion() + ":"))
.findAny().isPresent();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This stream statement could be simplified, I think:

                databaseChecksumsCompatible = md5sumRS.stream()
                        .filter(m -> !m.get("MD5SUM").toString().startsWith(CheckSum.getCurrentVersion() + ":"))
                        .noneMatch();

or this one, which is perhaps the most clear and easy to read:

                databaseChecksumsCompatible = md5sumRS.stream()
                        .filter(m -> m.get("MD5SUM").toString().startsWith(CheckSum.getCurrentVersion() + ":"))
                        .allMatch();

Comment on lines 257 to 273
//String md5sum = md5sumRS.get(0).get("MD5SUM").toString();
// if (!md5sum.startsWith(CheckSum.getCurrentVersion() + ":")) {
// executor.comment("DatabaseChangeLog checksums are an incompatible version. Setting them to null " +
// "so they will be updated on next database update");
// // FIXME
// // if (force is not set, throws exception.
// // outside we validate if there are runOnchange
// // if not, set the flag and call this method again
// // otherwise fail .
// databaseChecksumsCompatible = false;
// UpdateStatement updateStatement = new UpdateStatement(database.getLiquibaseCatalogName(),
// database.getLiquibaseSchemaName(), database.getDatabaseChangeLogTableName())
// .addNewColumnValue("MD5SUM", null);
//
// statementsToExecute.add(updateStatement);
// }
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this be removed?

filipelautert and others added 26 commits May 24, 2023 18:08

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[DAT-14885] Upgrade to v9 after running liquibase update command
[DAT-14885] - UpdateVisitor upgrade
Makes sure that CalculateChecksumCommandStep uses the stored checksum version if there is one.
provide option to set "current" checksum version, remove ChecksumVersions.latest (DAT-14931)
…sing the variable in the context to provide it.
DAT-14893 - Modify current generateChecksums method for backwards compatibility
@filipelautert filipelautert marked this pull request as ready for review June 13, 2023 20:43
@filipelautert filipelautert self-requested a review as a code owner June 13, 2023 20:43
…e-one-changeset commands (DAT-15139) (#4371)

* Upgrade the checksums when executing targeted Update-to-tag and update-one-changeset commands;
# Conflicts:
#	liquibase-standard/src/main/java/liquibase/command/core/AbstractUpdateCommandStep.java
# Conflicts:
#	liquibase-standard/src/main/java/liquibase/command/core/AbstractUpdateCommandStep.java
#	liquibase-standard/src/main/java/liquibase/command/core/ListLocksCommandStep.java
#	liquibase-standard/src/main/java/liquibase/command/core/helpers/DatabaseChangelogCommandStep.java
#	liquibase-standard/src/main/java/liquibase/sqlgenerator/core/MarkChangeSetRanGenerator.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants