-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
+1,698
−372
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* First draft of the changes to allow smooth checksum upgrade. * Use a Enum to define Checksum versions.
StevenMassaro
commented
May 24, 2023
liquibase-standard/src/main/java/liquibase/changelog/MockChangeLogHistoryService.java
Show resolved
Hide resolved
StevenMassaro
commented
May 24, 2023
Comment on lines
253
to
255
databaseChecksumsCompatible = !md5sumRS.stream() | ||
.filter(m -> !m.get("MD5SUM").toString().startsWith(CheckSum.getCurrentVersion() + ":")) | ||
.findAny().isPresent(); |
There was a problem hiding this comment.
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();
StevenMassaro
commented
May 24, 2023
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); | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed?
… that we always use the same filters.
[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
DAT-14892 - Makes sure we are asserting the expressions
# Conflicts: # liquibase-standard/src/main/java/liquibase/changelog/visitor/ValidatingVisitor.java
…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
filipelautert
approved these changes
Jun 15, 2023
# 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Impact
Description
Things to be aware of
Things to worry about
Additional Context