-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Remove unnecessary length constraints from VARCHAR(N) columns #579
Conversation
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.
Great work! Some additional changes are needed (inclusion of the new changelog file), and some are to be discussed I guess (whether or not to convert columns holding enum values to TEXT
as well).
Sorry for the many comments.
In some model classes there are attempts to truncate strings in order to fit the previously used length constraints, e.g.:
hyades-apiserver/src/main/java/org/dependencytrack/model/Component.java
Lines 417 to 419 in 6af80d3
public void setGroup(String group) { | |
this.group = StringUtils.abbreviate(group, 255); | |
} |
In order to get actual use out of this change, those abbreviate
calls should also be removed.
src/main/java/org/dependencytrack/model/IntegrityMetaComponent.java
Outdated
Show resolved
Hide resolved
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.
Great work!
Description
Create a database migration that converts VARCHAR(N) columns to TEXT to lift the artificial length constraints.
Keep the constraints for columns where the maximum value length is known, e.g. SHA256.
Addressed Issue
Closes DependencyTrack/hyades#1077
Checklist