DependencyTrack / DependencyTrack/dependency-track
Update to 4.11 with existing varbinary columns
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
MSSQL Server v16
If no datatype is specified in the model, there would be a column of type varbinary created.
Some of these 'wrong' column datatypes where fixed in 4.11 and created with the 'correct' datatype "text".
Varbinary columns in 4.10
TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT DATA_TYPE CHARACTER_MAXIMUM_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION
db_owner COMPONENT EXTERNAL_REFERENCES 13 NULL varbinary -1 NULL NULL NULL NULL
db_owner COMPONENT MANUFACTURE 21 NULL varbinary -1 NULL NULL NULL NULL
db_owner COMPONENT SUPPLIER 38 NULL varbinary -1 NULL NULL NULL NULL
db_owner SERVICECOMPONENT DATA 4 NULL varbinary -1 NULL NULL NULL NULL
db_owner SERVICECOMPONENT EXTERNAL_REFERENCES 7 NULL varbinary -1 NULL NULL NULL NULL
db_owner SERVICECOMPONENT PROVIDER_ID 14 NULL varbinary -1 NULL NULL NULL NULL
db_owner PROJECT EXTERNAL_REFERENCES 12 NULL varbinary -1 NULL NULL NULL NULL
db_owner PROJECT MANUFACTURE 24 NULL varbinary -1 NULL NULL NULL NULL
db_owner PROJECT SUPPLIER 33 NULL varbinary -1 NULL NULL NULL NULL
Varbinary columns in 4.11
TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT DATA_TYPE CHARACTER_MAXIMUM_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION
dbo COMPONENT EXTERNAL_REFERENCES 13 NULL varbinary -1 NULL NULL NULL NULL
dbo SERVICECOMPONENT DATA 4 NULL varbinary -1 NULL NULL NULL NULL
dbo SERVICECOMPONENT EXTERNAL_REFERENCES 7 NULL varbinary -1 NULL NULL NULL NULL
dbo SERVICECOMPONENT PROVIDER_ID 14 NULL varbinary -1 NULL NULL NULL NULL
dbo PROJECT EXTERNAL_REFERENCES 12 NULL varbinary -1 NULL NULL NULL NULL
Is there an update step or script to migrate the 4.10 these columns to 4.11?
What is planned to do with the left fields of type varbinary?
### Steps to Reproduce
1. Create a database and start with 4.10
2. Switch to 4.11 on this existing database
3. Column data type will not be changed from varbinary to text (droped an created).
### Expected Behavior
Column datatypes should be fixed automatically.
### Dependency-Track Version
4.11.1
### Dependency-Track Distribution
Executable WAR
### Database Server
Microsoft SQL Server
### Database Server Version
_No response_
### Browser
Microsoft Edge
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Research direction
Start with the 4.10-to-4.11 database migration path for Microsoft SQL Server and inspect how existing varbinary columns are handled when the expected type is text. Reproduce the upgrade using the listed COMPONENT, SERVICECOMPONENT, and PROJECT columns, then verify that the migration updates the remaining columns without losing data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100