v4.13.1 Upgrade - Cannot define PRIMARY KEY constraint on nullable column in table 'POLICY_TAGS'. #4904
Replies: 5 comments 4 replies
-
|
How old is your DT instance? I booted up a new instance of 4.12.0 and back then it already created the columns on those tables as |
Beta Was this translation helpful? Give feedback.
-
|
As a workaround until the fix is released, run the following statements in your database: DROP INDEX "POLICY_TAGS"."POLICY_TAGS_N50";
ALTER TABLE "POLICY_TAGS" ALTER COLUMN "TAG_ID" BIGINT NOT NULL;
CREATE INDEX "POLICY_TAGS_N50" ON "POLICY_TAGS" ("TAG_ID");Then restart Dependency-Track. The migration should go through now. Edit: Modified comment to reflect the confirmed workaround. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply. Going back in the codebase, it appears that we started on 4.8.0. |
Beta Was this translation helpful? Give feedback.
-
|
Resolved by dropping index, altering table, and re-creating index. ALTER TABLE "POLICY_TAGS" ALTER COLUMN "TAG_ID" BIGINT NOT NULL; |
Beta Was this translation helpful? Give feedback.
-
|
We released 4.13.2 with a fix for this issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm receiving the following when upgrading to v4.13.1. Is this an issue with the update or does the DB need to be manually modified?
Error in executing upgrade class: org.dependencytrack.upgrade.v4131.v4131Updater
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot define PRIMARY KEY constraint on nullable column in table 'POLICY_TAGS'.
Beta Was this translation helpful? Give feedback.
All reactions