From fe46e7d393f7e46ffe0d35a9131643b862da4617 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 15 Mar 2019 12:32:49 +0000 Subject: [PATCH] Bug 21846: DBRev 18.11.03.003 Signed-off-by: Nick Clemens (cherry picked from commit 3d462af21f3c13312b0ffb8496e55d277f703ebd) Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_21846.perl | 28 ------------------ installer/data/mysql/updatedatabase.pl | 29 +++++++++++++++++++ 3 files changed, 30 insertions(+), 29 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21846.perl diff --git a/Koha.pm b/Koha.pm index 3a339caae4..515c0007b4 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 = "18.11.03.002"; +$VERSION = "18.11.03.003"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_21846.perl b/installer/data/mysql/atomicupdate/bug_21846.perl deleted file mode 100644 index 7f168defc3..0000000000 --- a/installer/data/mysql/atomicupdate/bug_21846.perl +++ /dev/null @@ -1,28 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - - $dbh->do('SET FOREIGN_KEY_CHECKS=0'); - - # Change columns accordingly - $dbh->do(q{ - ALTER TABLE tags_index - MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; - }); - - $dbh->do(q{ - ALTER TABLE tags_approval - MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; - }); - - $dbh->do(q{ - ALTER TABLE tags_all - MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; - }); - - $dbh->do('SET FOREIGN_KEY_CHECKS=1'); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 21846 - Using emoji as tags has broken weights)\n"; - my $maintenance_script = C4::Context->config("intranetdir") . "/misc/maintenance/fix_tags_weight.pl"; - print "WARNING: (Bug 21846) You need to manually run $maintenance_script to fix possible issues with tags.\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2a681ace7d..7f09cd72a1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -17307,6 +17307,35 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 19575 - Use canonical field names and resolve aliased fields)\n"; } +$DBversion = '18.11.03.003'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do('SET FOREIGN_KEY_CHECKS=0'); + + # Change columns accordingly + $dbh->do(q{ + ALTER TABLE tags_index + MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; + }); + + $dbh->do(q{ + ALTER TABLE tags_approval + MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; + }); + + $dbh->do(q{ + ALTER TABLE tags_all + MODIFY COLUMN term VARCHAR(191) COLLATE utf8mb4_bin NOT NULL; + }); + + $dbh->do('SET FOREIGN_KEY_CHECKS=1'); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21846 - Using emoji as tags has broken weights)\n"; + my $maintenance_script = C4::Context->config("intranetdir") . "/misc/maintenance/fix_tags_weight.pl"; + print "WARNING: (Bug 21846) You need to manually run $maintenance_script to fix possible issues with tags.\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5