Bug 30481 - Drop unique constraint deleteditemsstocknumberidx for deleteditems
Summary: Drop unique constraint deleteditemsstocknumberidx for deleteditems
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 30486
  Show dependency treegraph
 
Reported: 2022-04-07 09:23 UTC by Marcel de Rooy
Modified: 2023-12-28 20:43 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05


Attachments
Bug 30481: Drop unique constraint deleteditemsstocknumberidx (1.79 KB, patch)
2022-04-07 12:02 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30481: Drop unique constraint deleteditemsstocknumberidx (1.75 KB, patch)
2022-04-10 20:59 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 30481: Drop unique constraint deleteditemsstocknumberidx (1.81 KB, patch)
2022-04-10 21:00 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2022-04-07 09:23:45 UTC
Caused by inconsistencies between kohastructure and updatedatabase.
This unique key may be present in older databases.

L3267 ALTER TABLE deleteditems ADD UNIQUE INDEX deleteditemsstocknumberidx (stocknumber);

Note that this comment is not in kohastructure too:
L3264 ALTER TABLE deleteditems ADD stocknumber VARCHAR(32) DEFAULT NULL COMMENT "stores the inventory number of deleted items";
Comment 1 Marcel de Rooy 2022-04-07 09:25:24 UTC
Not sure if deleteditems.enumchron is correct too for older production dbs.
Comment 2 Katrin Fischer 2022-04-07 09:27:44 UTC
It's a rather old issue, actually this is a duplicate to bug 23330 that has some of the history. Closed not too long ago (by me), but I'd actually be quite happy to have this fixed.
Comment 3 Marcel de Rooy 2022-04-07 12:02:53 UTC
Created attachment 133075 [details] [review]
Bug 30481: Drop unique constraint deleteditemsstocknumberidx

Resolves a sync issue between database and schema caused by
differences between structure and upgrades. Note: newer
databases do not contain this index any longer.

Test plan:
Run dbrev.
Check SHOW CREATE TABLE deleteditems.
Verify that unique index has been dropped, regular index added.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2022-04-07 12:03:12 UTC
Trivial: Self SO
Comment 5 Victor Grousset/tuxayo 2022-04-10 20:59:32 UTC Comment hidden (obsolete)
Comment 6 Victor Grousset/tuxayo 2022-04-10 21:00:17 UTC
Created attachment 133136 [details] [review]
Bug 30481: Drop unique constraint deleteditemsstocknumberidx

Resolves a sync issue between database and schema caused by
differences between structure and upgrades. Note: newer
databases do not contain this index any longer.

Test plan:
Run dbrev.
Check SHOW CREATE TABLE deleteditems.
Verify that unique index has been dropped, regular index added.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2022-04-10 21:02:08 UTC
Looks good :)
Comment 8 Fridolin Somers 2022-04-13 13:58:29 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 9 Kyle M Hall 2022-04-15 12:08:39 UTC
Pushed to 21.11.x for 21.11.05