From 6e40ced5c27fa704b48ff4e1a226bb2693192545 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Jun 2017 12:27:12 -0300 Subject: [PATCH] Bug 8612: DBRev 17.06.00.001 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_8612.sql | 4 ---- installer/data/mysql/updatedatabase.pl | 13 +++++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_8612.sql diff --git a/Koha.pm b/Koha.pm index b65a733ef2..12097100dd 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.06.00.000"; +$VERSION = "17.06.00.001"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_8612.sql b/installer/data/mysql/atomicupdate/bug_8612.sql deleted file mode 100644 index 4e0ea01ac5..0000000000 --- a/installer/data/mysql/atomicupdate/bug_8612.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE export_format ADD used_for varchar(255) DEFAULT 'export_records' AFTER type; - -UPDATE export_format SET used_for = 'late_issues' WHERE type = 'sql'; -UPDATE export_format SET used_for = 'export_records' WHERE type = 'marc'; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 55633e51f8..fea0a0aafe 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14528,6 +14528,19 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (He pai ake te iti i te kore)\n"; } +$DBversion = '17.06.00.001'; +if( CheckVersion( $DBversion ) ) { + + unless ( column_exists( 'export_format', 'used_for' ) ) { + $dbh->do(q|ALTER TABLE export_format ADD used_for varchar(255) DEFAULT 'export_records' AFTER type|); + + $dbh->do(q|UPDATE export_format SET used_for = 'late_issues' WHERE type = 'sql'|); + $dbh->do(q|UPDATE export_format SET used_for = 'export_records' WHERE type = 'marc'|); + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 8612 - Add new column export_format.used_for)\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