Bug 14069 removed existing primary key on issues without questioning why one could exist. Note that the primary key was not in the kohastructure.sql and only existed on old DB. issues.itemnumber should be a unique key to avoid duplication of issues on the same item.
Created attachment 43219 [details] [review] Bug 14978: Add unique key constraint on issues.itemnumber The constraint might have existed before bug 14069. For these DB, this patch will restore it, for others, it will add it :) Test plan: > show create table issues; should not return "unique key itemnumber" Execute the updatedb entry twice > show create table issues; should return only one "unique key itemnumber"
Created attachment 43342 [details] [review] Bug 14978: Add unique key constraint on issues.itemnumber The constraint might have existed before bug 14069. For these DB, this patch will restore it, for others, it will add it :) Test plan: > show create table issues; should not return "unique key itemnumber" Execute the updatedb entry twice > show create table issues; should return only one "unique key itemnumber" Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 44246 [details] [review] [PASSED QA] Bug 14978: Add unique key constraint on issues.itemnumber The constraint might have existed before bug 14069. For these DB, this patch will restore it, for others, it will add it :) Test plan: > show create table issues; should not return "unique key itemnumber" Execute the updatedb entry twice > show create table issues; should return only one "unique key itemnumber" Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patch pushed to master. Thanks Jonathan!
Does this patch need to be backported to 3.20.x?
(In reply to Frédéric Demians from comment #5) > Does this patch need to be backported to 3.20.x? As bug 14069 is in 3.20.x I would say yes.
This patch has been pushed to 3.20.x, will be in 3.20.7.
Do we need to change the database update statements in later versions now to avoid errors/warnings?
Ah, I see it already includes a check for existence - so should be safe :)
*** Bug 15677 has been marked as a duplicate of this bug. ***