From 4788d323b01e67fd500a0184878c9de40b94e3e9 Mon Sep 17 00:00:00 2001 From: lmstrand Date: Tue, 12 Mar 2024 11:49:30 +0200 Subject: [PATCH] Bug 36101: Drop constraint to items.itemnumber from old_reserves-table Signed-off-by: Lucas Gass --- installer/data/mysql/atomicupdate/bug_36101.pl | 15 +++++++++++++++ installer/data/mysql/kohastructure.sql | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_36101.pl diff --git a/installer/data/mysql/atomicupdate/bug_36101.pl b/installer/data/mysql/atomicupdate/bug_36101.pl new file mode 100644 index 0000000000..ac32138b02 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_36101.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "36101", + description => "Drop constraint to items.itemnumber from old_reserves-table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do(q{ALTER TABLE old_reserves DROP CONSTRAINT IF EXISTS old_reserves_ibfk_3;}); + + say $out "Dropped constraint old_reserves_ibfk_3 from old_reserves"; + + }, +}; \ No newline at end of file diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 16310f0f44..95b90d1115 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4914,7 +4914,6 @@ CREATE TABLE `old_reserves` ( KEY `old_reserves_ibfk_ig` (`item_group_id`), CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) 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 (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.30.2