Fix failing v4.13.1 migration for H2 deployments that pre-date v4.11.0#5100
Fix failing v4.13.1 migration for H2 deployments that pre-date v4.11.0#5100nscuro merged 1 commit intoDependencyTrack:masterfrom
Conversation
Relates to DependencyTrack#4906 Signed-off-by: nscuro <[email protected]>
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a migration error in v4.13.1 for H2 databases deployed before v4.11.0 by extending the NOT NULL constraint logic to H2 and adjusting SQL statements for each dialect.
- Enforce NOT NULL constraint on
POLICY_TAGS.TAG_IDfor both H2 and MSSQL - Add H2-specific
ALTER TABLEsyntax and wrap MSSQL drop/create index steps in dialect checks - Retain existing logic for index recreation and primary key enforcement
Comments suppressed due to low confidence (1)
src/main/java/org/dependencytrack/upgrade/v4131/v4131Updater.java:76
- MSSQL requires the
ONclause in a DROP INDEX statement (e.g.,DROP INDEX indexName ON POLICY_TAGS). Update this SQL to use the correct MSSQL syntax.
DROP INDEX "POLICY_TAGS"."%s"
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Description
Fixes failing v4.13.1 migration for H2 deployments that pre-date v4.11.0.
Addressed Issue
Relates to #4906
Additional Details
N/A
Checklist
This PR implements an enhancement, and I have provided tests to verify that it works as intendedThis PR introduces changes to the database model, and I have added corresponding update logicThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly