From b5755796a80af3aacd3c4a112cde2158e91b51ec Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Jan 2024 15:33:40 +0000 Subject: [PATCH] Bug 35473: Also disable the plugin Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit 293d9c66ce16742de770a1c4133ab60128f30b6d) Signed-off-by: Fridolin Somers --- installer/data/mysql/db_revs/230600061.pl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/installer/data/mysql/db_revs/230600061.pl b/installer/data/mysql/db_revs/230600061.pl index b32763dbce..3defd4a34d 100755 --- a/installer/data/mysql/db_revs/230600061.pl +++ b/installer/data/mysql/db_revs/230600061.pl @@ -6,6 +6,7 @@ return { up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; + # Handle cases of roombookings plugin existing if ( TableExists('bookings') ) { if ( column_exists( 'bookings', 'bookingid' ) ) { @@ -37,21 +38,19 @@ return { $old_roomequipment_table TO $roomequipment_table, } ); + $dbh->do("ALTER TABLE $rooms_table RENAME INDEX $old_rooms_index TO $rooms_index"); + $dbh->do("ALTER TABLE $bookings_table RENAME INDEX $old_bookings_index TO $bookings_index"); + $dbh->do("ALTER TABLE $equipment_table RENAME INDEX $old_equipment_index TO $equipment_index"); $dbh->do( -"ALTER TABLE $rooms_table RENAME INDEX $old_rooms_index TO $rooms_index" - ); - $dbh->do( -"ALTER TABLE $bookings_table RENAME INDEX $old_bookings_index TO $bookings_index" - ); - $dbh->do( -"ALTER TABLE $equipment_table RENAME INDEX $old_equipment_index TO $equipment_index" - ); - $dbh->do( -"ALTER TABLE $roomequipment_table RENAME INDEX $old_roomequipment_index TO $roomequipment_index" - ); + "ALTER TABLE $roomequipment_table RENAME INDEX $old_roomequipment_index TO $roomequipment_index"); say "Migrated room reservations plugin to it's own namespace"; say "You MUST upgrade to the latest room reservation plugin to continue using it"; + $dbh->do( + "UPDATE plugin_data SET plugin_value = 0 WHERE plugin_class = 'Koha::Plugin::Com::MarywoodUniversity::RoomReservations' AND plugin_key = '__ENABLED__'" + ); + + say "Plugin disabled, please re-enable once you have upgraded it"; } } -- 2.39.5