From 5fba12369117cb56969289632d97288c1f97df09 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 1 Nov 2007 13:38:07 -0500 Subject: [PATCH] made key on deleteditems.barcode non-unique User could conceivable delete an item, add one with the same barcode, then delete it again. If key on deleteditems.barcode is unique, second deletion will not populate deleteditems. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- installer/kohastructure.sql | 2 +- updater/updatedatabase | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/installer/kohastructure.sql b/installer/kohastructure.sql index d6c7190741..bab3296002 100644 --- a/installer/kohastructure.sql +++ b/installer/kohastructure.sql @@ -820,7 +820,7 @@ CREATE TABLE `deleteditems` ( `uri` varchar(255) default NULL, `marc` longblob, PRIMARY KEY (`itemnumber`), - UNIQUE KEY `delitembarcodeidx` (`barcode`), + KEY `delitembarcodeidx` (`barcode`), KEY `delitembinoidx` (`biblioitemnumber`), KEY `delitembibnoidx` (`biblionumber`), KEY `delhomebranch` (`homebranch`), diff --git a/updater/updatedatabase b/updater/updatedatabase index 4b02b1efbf..c59de88cfa 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -534,6 +534,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.019"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE deleteditems + DROP KEY `delitembarcodeidx`, + ADD KEY `delitembarcodeidx` (`barcode`)"); + print "Upgrade to $DBversion done (dropped uniqueness of key on deleteditems.barcode)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5