Bug 9701: DBRev 17.12.00.028
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 Apr 2018 13:48:17 +0000 (10:48 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 Apr 2018 13:50:34 +0000 (10:50 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha.pm
installer/data/mysql/atomicupdate/bug_9701-add_default_indicators.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 1b0ee8a..63766c6 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.12.00.027";
+$VERSION = "17.12.00.028";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_9701-add_default_indicators.sql b/installer/data/mysql/atomicupdate/bug_9701-add_default_indicators.sql
deleted file mode 100644 (file)
index 7cccd91..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE marc_tag_structure
-ADD COLUMN ind2_defaultvalue VARCHAR(1) NOT NULL DEFAULT '' AFTER authorised_value,
-ADD COLUMN ind1_defaultvalue VARCHAR(1) NOT NULL DEFAULT '' AFTER authorised_value;
index f83597c..02cb29f 100755 (executable)
@@ -15704,7 +15704,7 @@ if( CheckVersion( $DBversion ) ) {
     });
 
     SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 15492: Add a standalone self-checkin module)\n";
+    print "Upgrade to $DBversion done (Bug 15492 - Add a standalone self-checkin module)\n";
 }
 
 $DBversion = '17.12.00.025';
@@ -15732,7 +15732,7 @@ if( CheckVersion( $DBversion ) ) {
     }
 
     SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 19804: Add issuingrules.suspension_chargeperiod)\n";
+    print "Upgrade to $DBversion done (Bug 19804 - Add issuingrules.suspension_chargeperiod)\n";
 }
 
 $DBversion = '17.12.00.027';
@@ -15746,6 +15746,20 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 19289 - Add system preference UseACQFrameworkForBiblioRecords)\n";
 }
 
+$DBversion = '17.12.00.028';
+if( CheckVersion( $DBversion ) ) {
+    if( !column_exists( 'marc_tag_structure', 'ind1_defaultvalue' ) ) {
+        $dbh->do(q|
+            ALTER TABLE marc_tag_structure
+            ADD COLUMN ind2_defaultvalue VARCHAR(1) NOT NULL DEFAULT '' AFTER authorised_value,
+            ADD COLUMN ind1_defaultvalue VARCHAR(1) NOT NULL DEFAULT '' AFTER authorised_value;
+        |);
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 9701 - Add default indicators (marc_tag_structure.indX_defaultvalue))\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.