Bug 8612: DBRev 17.06.00.001
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Jun 2017 15:27:12 +0000 (12:27 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Jun 2017 15:36:13 +0000 (12:36 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha.pm
installer/data/mysql/atomicupdate/bug_8612.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index b65a733..1209710 100644 (file)
--- 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 (file)
index 4e0ea01..0000000
+++ /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';
index 55633e5..fea0a0a 100755 (executable)
@@ -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.