From 6248bd6e5024616875830980087e0ffc0389c365 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 15 Oct 2025 11:12:44 +0000 Subject: [PATCH] Bug 40504: atomicupdate --- .../data/mysql/atomicupdate/bug_40504.pl | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_40504.pl diff --git a/installer/data/mysql/atomicupdate/bug_40504.pl b/installer/data/mysql/atomicupdate/bug_40504.pl new file mode 100755 index 00000000000..86cf12d5080 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_40504.pl @@ -0,0 +1,23 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "40504", + description => "Add managedby column to illrequests table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'illrequests', 'managedby' ) ) { + $dbh->do( + q{ALTER TABLE illrequests ADD COLUMN managedby int(11) DEFAULT NULL COMMENT 'Staff member manager of request' AFTER borrowernumber} + ); + $dbh->do(q{ALTER TABLE illrequests ADD KEY illrequests_manfk (managedby)}); + $dbh->do( + q{ALTER TABLE illrequests ADD CONSTRAINT illrequests_manfk FOREIGN KEY (managedby) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE} + ); + + say_success( $out, "Added column 'illrequests.managedby'" ); + } + }, +}; -- 2.39.5