From 30f0e75d81fd93bd62af26a80a893de68b108752 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 --- 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 b32763dbcec..3defd4a34de 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.43.0