Fix issue 4733. Update the mysql, mssql, postgresql and oracle initialize files. #4736
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.
Fixes Issue
setting autoUpdate to false causes "Old database schema identified", but schema is up to date
The problem
In the commit, 811a9eb, the data.version in core/src/main/resources/dependencycheck.properties was updated to 5.2.1. Meanwhile, the database schema file and its version in core/src/main/resources/data/initialize.sql was updated to 5.2.1 as well.
However, the other initialize files and their versions, like core/src/main/resources/data/initialize_postgres.sql, haven't been updated.
Therefore, when somebody installes Dependency Check by using core/src/main/resources/data/initialize_postgres.sql, and when they run the goal check, the data.version is 5.2.1, but the database schema version is 5.2. And if they configure autoUpdate to false, an exception will be thrown in the file core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DatabaseManager.java in the method ensureSchemaVersion, from the line 512.
Description of Change
Updated the other initialize files and their versions by studying the commit 811a9eb.
Have test cases been added to cover the new functionality?
There is no functionality. Manually tested core/src/main/resources/data/initialize_postgres.sql.