From fc30a2c82c487fdf6da354cccd86c29b2c1d4aee Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 13 Feb 2018 14:07:37 -0300 Subject: [PATCH] Bug 20144: DBRev 17.12.00.015 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../bug_20144_update_borrowers_table.sql | 2 -- .../bug_xxxxx_export_format_default.sql | 3 -- .../bug_xxxxx_reserves.lowestPriority.sql | 2 -- installer/data/mysql/updatedatabase.pl | 36 +++++++++++++++++++ 5 files changed, 37 insertions(+), 8 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql delete mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql delete mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx_reserves.lowestPriority.sql diff --git a/Koha.pm b/Koha.pm index 2adaabdd1d..a8f7961afe 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 = "17.12.00.014"; +$VERSION = "17.12.00.015"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql b/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql deleted file mode 100644 index f1d5c46fc5..0000000000 --- a/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE borrowers MODIFY surname MEDIUMTEXT, MODIFY address MEDIUMTEXT, MODIFY city MEDIUMTEXT; -ALTER TABLE deletedborrowers MODIFY surname MEDIUMTEXT, MODIFY address MEDIUMTEXT, MODIFY city MEDIUMTEXT; diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql b/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql deleted file mode 100644 index 059958de3a..0000000000 --- a/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE export_format MODIFY csv_separator VARCHAR(2) NOT NULL DEFAULT ',', MODIFY field_separator VARCHAR(2), MODIFY subfield_separator VARCHAR(2); -ALTER TABLE export_format MODIFY encoding VARCHAR(255) DEFAULT 'utf8'; - diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx_reserves.lowestPriority.sql b/installer/data/mysql/atomicupdate/bug_xxxxx_reserves.lowestPriority.sql deleted file mode 100644 index 2eac0baefe..0000000000 --- a/installer/data/mysql/atomicupdate/bug_xxxxx_reserves.lowestPriority.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE reserves MODIFY lowestPriority tinyint(1) NOT NULL DEFAULT 0; -ALTER TABLE old_reserves MODIFY lowestPriority tinyint(1) NOT NULL DEFAULT 0; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b714dc5e3c..ff79092627 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15354,6 +15354,42 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 19790 - Remove additionalauthors.author from installer files)\n"; } +$DBversion = '17.12.00.015'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q| + ALTER TABLE borrowers + MODIFY surname MEDIUMTEXT, + MODIFY address MEDIUMTEXT, + MODIFY city MEDIUMTEXT + |); + $dbh->do(q| + ALTER TABLE deletedborrowers + MODIFY surname MEDIUMTEXT, + MODIFY address MEDIUMTEXT, + MODIFY city MEDIUMTEXT + |); + + $dbh->do(q| + ALTER TABLE export_format + MODIFY csv_separator VARCHAR(2) NOT NULL DEFAULT ',', + MODIFY field_separator VARCHAR(2), + MODIFY subfield_separator VARCHAR(2) + |); + $dbh->do(q| + ALTER TABLE export_format MODIFY encoding VARCHAR(255) NOT NULL DEFAULT 'utf8' + |); + + $dbh->do(q| + ALTER TABLE reserves MODIFY lowestPriority tinyint(1) NOT NULL DEFAULT 0 + |); + $dbh->do(q| + ALTER TABLE old_reserves MODIFY lowestPriority tinyint(1) NOT NULL DEFAULT 0 + |); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20144 - Adapt DB structure to work with new SQL modes)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5