From 2b745e32a4de4073d06836fca200574451027409 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 23 Aug 2024 15:46:10 +0000 Subject: [PATCH] Bug 35044: DBRev 24.06.00.024 Signed-off-by: Katrin Fischer --- Koha.pm | 2 +- .../{atomicupdate/bug_35044.pl => db_revs/240600024.pl} | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) rename installer/data/mysql/{atomicupdate/bug_35044.pl => db_revs/240600024.pl} (87%) diff --git a/Koha.pm b/Koha.pm index a05b3b0f6d..4076616442 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "24.06.00.023"; +$VERSION = "24.06.00.024"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_35044.pl b/installer/data/mysql/db_revs/240600024.pl similarity index 87% rename from installer/data/mysql/atomicupdate/bug_35044.pl rename to installer/data/mysql/db_revs/240600024.pl index f64e70014d..a974da38a8 100755 --- a/installer/data/mysql/atomicupdate/bug_35044.pl +++ b/installer/data/mysql/db_revs/240600024.pl @@ -18,7 +18,8 @@ return { say_success( $out, "Added repeatable column to additional_fields table" ); } - if ( unique_key_exists ('additional_field_values', 'field_record') ) { + if ( unique_key_exists( 'additional_field_values', 'field_record' ) ) { + # Need to drop foreign key so that we can then drop the unique key $dbh->do( q{ @@ -40,7 +41,10 @@ return { `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE } ); - say_success( $out, "Removed UNIQUE KEY `field_record` (`field_id`,`record_id`) from the additional_field_values table" ); + say_success( + $out, + "Removed UNIQUE KEY `field_record` (`field_id`,`record_id`) from the additional_field_values table" + ); } my $number_of_entries = $dbh->do(q{DELETE FROM additional_field_values WHERE value = ''}); -- 2.39.5