From 5d4002ce9a649bf5d3be910731a9f965d6a6e94c 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 --- installer/data/mysql/atomicupdate/bug_15516.sql | 3 +++ installer/data/mysql/kohastructure.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_15516.sql b/installer/data/mysql/atomicupdate/bug_15516.sql index efd761e..8bf0786 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_5 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_4 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 923e010..0ace675 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1700,6 +1700,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b `lowestPriority` tinyint(1) NOT NULL, -- has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no) `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) + reserve_group_id int unsigned NULL DEFAULT NULL, PRIMARY KEY (`reserve_id`), KEY `old_reserves_borrowernumber` (`borrowernumber`), KEY `old_reserves_biblionumber` (`biblionumber`), @@ -1711,6 +1712,8 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL + CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) + ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 1.9.1