Bug 19036: DBRev 20.06.00.026
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 20 Aug 2020 10:27:33 +0000 (10:27 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 20 Aug 2020 10:31:59 +0000 (12:31 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha.pm
installer/data/mysql/atomicupdate/bug-19036.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index ba1f905..d567cca 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 = "20.06.00.025";
+$VERSION = "20.06.00.026";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug-19036.perl b/installer/data/mysql/atomicupdate/bug-19036.perl
deleted file mode 100644 (file)
index e92cf09..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$DBversion = 'XXX';
-if (CheckVersion($DBversion)) {
-    unless (column_exists('accountlines', 'credit_number')) {
-        $dbh->do('ALTER TABLE accountlines ADD COLUMN credit_number VARCHAR(20) NULL DEFAULT NULL COMMENT "autogenerated number for credits" AFTER debit_type_code');
-    }
-
-    unless (column_exists('account_credit_types', 'credit_number_enabled')) {
-        $dbh->do(q{
-            ALTER TABLE account_credit_types
-            ADD COLUMN credit_number_enabled TINYINT(1) NOT NULL DEFAULT 0
-                COMMENT "Is autogeneration of credit number enabled for this credit type"
-                AFTER can_be_added_manually
-        });
-    }
-
-    $dbh->do('INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES(?, ?, ?, ?, ?)', undef, 'AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice');
-
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 19036 - Add accountlines.credit_number, account_credit_types.credit_number_enabled and syspref AutoCreditNumber)\n";
-}
index 0569cb9..e98883a 100755 (executable)
@@ -22616,6 +22616,26 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 6725, "Adds PatronDuplicateMatchingAddFields system preference");
 }
 
+$DBversion = '20.06.00.026';
+if (CheckVersion($DBversion)) {
+    unless (column_exists('accountlines', 'credit_number')) {
+        $dbh->do('ALTER TABLE accountlines ADD COLUMN credit_number VARCHAR(20) NULL DEFAULT NULL COMMENT "autogenerated number for credits" AFTER debit_type_code');
+    }
+
+    unless (column_exists('account_credit_types', 'credit_number_enabled')) {
+        $dbh->do(q{
+            ALTER TABLE account_credit_types
+            ADD COLUMN credit_number_enabled TINYINT(1) NOT NULL DEFAULT 0
+                COMMENT "Is autogeneration of credit number enabled for this credit type"
+                AFTER can_be_added_manually
+        });
+    }
+
+    $dbh->do('INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES(?, ?, ?, ?, ?)', undef, 'AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice');
+
+    NewVersion( $DBversion, 19036, "Add accountlines.credit_number, account_credit_types.credit_number_enabled and syspref AutoCreditNumber" );
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
 my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';