From 62df06d80cc89dfb14b4bb161f8326ecfbfc7c29 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 29 Feb 2016 13:43:00 +0100 Subject: [PATCH] Bug 15516: Update old_reserves (reserve_group_id) Without it, deletion of reserves will fail Signed-off-by: Benjamin Rokseth --- installer/data/mysql/atomicupdate/bug_15516.sql | 3 +++ installer/data/mysql/kohastructure.sql | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/atomicupdate/bug_15516.sql b/installer/data/mysql/atomicupdate/bug_15516.sql index 60158bfbb5..cad3cc5f5e 100644 --- a/installer/data/mysql/atomicupdate/bug_15516.sql +++ b/installer/data/mysql/atomicupdate/bug_15516.sql @@ -6,3 +6,6 @@ CREATE TABLE reserve_group ( ALTER TABLE reserves ADD COLUMN reserve_group_id int unsigned NULL DEFAULT NULL; ALTER TABLE reserves ADD CONSTRAINT reserves_ibfk_6 FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) ON DELETE SET NULL ON UPDATE CASCADE; + +ALTER TABLE old_reserves ADD COLUMN reserve_group_id int unsigned NULL DEFAULT NULL; +ALTER TABLE old_reserves ADD CONSTRAINT old_reserves_ibfk_5 FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index bdbc04fdc1..6ac13ade57 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1780,7 +1780,9 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) - ON DELETE SET NULL ON UPDATE SET NULL + ON DELETE SET NULL ON UPDATE SET NULL, + CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) + ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- @@ -1933,6 +1935,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no) `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely) `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting + `reserve_group_id` int unsigned NULL DEFAULT NULL, -- The id of a group of titles reservations fulfilled when one title is picked PRIMARY KEY (`reserve_id`), KEY `old_reserves_borrowernumber` (`borrowernumber`), KEY `old_reserves_biblionumber` (`biblionumber`), -- 2.17.1