At the moment, deleteditemsstocknumberidx is a unique index, which means that an item will fail to delete if its "Inventory number" already exists in the deleteditems table. Its counterpart itemsstocknumberidx was renamed to itemstocknumberidx in version 3.03.00.042 (dating from April/May 2011) and made non-unique. I've worked on Koha since early 2012 and only today have I had someone stung by this problem. They've been storing "Copy number" in "Inventory number" for some reason, and it's caught them out.
It looks like we never dropped the unique index on the deleteditems table... but fixed it only for new installations: kohastructure.sql deleteditems KEY `delitemstocknumberidx` (`stocknumber`), 3.01.00.095 Added *items.stocknumber with a unique index 3.03.00.042 Removed the unique index from items.stocknumber But no mention of the same change for deleteditems.
We could probably close this one off as it only affects pre-3.04 versions of Koha. I think there are other cases where similar things have happened, so I'm sure upgraded databases vs new databases are already out of sync in other ways...
(In reply to David Cook from comment #2) > We could probably close this one off as it only affects pre-3.04 versions of > Koha.
(In reply to David Cook from comment #2) > We could probably close this one off as it only affects pre-3.04 versions of > Koha. > > I think there are other cases where similar things have happened, so I'm > sure upgraded databases vs new databases are already out of sync in other > ways... Yes, I have opened a few of these reports the last few days. Added some code on at least one of them. These patches are not very popular. But I would recommend to leave them open until they are fixed. These kind of sync problems could at some point cause issues..