Bug 22521: DBRev 18.12.00.055
authorNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 17:01:10 +0000 (17:01 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 17:01:10 +0000 (17:01 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha.pm
Koha/Schema/Result/Accountline.pm
installer/data/mysql/atomicupdate/bug_22521.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 0523841..3206259 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 = "18.12.00.054";
+$VERSION = "18.12.00.055";
 
 sub version {
     return $VERSION;
index 3775f70..6864e00 100644 (file)
@@ -67,7 +67,7 @@ __PACKAGE__->table("accountlines");
 
   data_type: 'varchar'
   is_nullable: 1
-  size: 5
+  size: 16
 
 =head2 status
 
@@ -136,7 +136,7 @@ __PACKAGE__->add_columns(
   "description",
   { data_type => "longtext", is_nullable => 1 },
   "accounttype",
-  { data_type => "varchar", is_nullable => 1, size => 5 },
+  { data_type => "varchar", is_nullable => 1, size => 16 },
   "status",
   { data_type => "varchar", is_nullable => 1, size => 16 },
   "payment_type",
@@ -285,8 +285,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-10 19:55:44
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OaHSR4SeurCr7h6nizbtBg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 17:00:42
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2NOxgVuaRQ+6oTqgYDqzBg
 
 sub koha_objects_class {
     'Koha::Account::Lines';
diff --git a/installer/data/mysql/atomicupdate/bug_22521.perl b/installer/data/mysql/atomicupdate/bug_22521.perl
deleted file mode 100644 (file)
index d437db3..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-$DBversion = 'XXX';    # will be replaced by the RM
-if ( CheckVersion($DBversion) ) {
-
-    $dbh->do(qq{
-        UPDATE
-          `account_offset_types`
-        SET
-          type = 'OVERDUE'
-        WHERE
-          type = 'Fine';
-    });
-
-    $dbh->do(qq{
-        UPDATE
-          `account_offset_types`
-        SET
-          type = 'OVERDUE_INCREASE'
-        WHERE
-          type = 'fine_increase';
-    });
-
-    $dbh->do(qq{
-        UPDATE
-          `account_offset_types`
-        SET
-          type = 'OVERDUE_DECREASE'
-        WHERE
-          type = 'fine_decrease';
-    });
-
-    if ( column_exists( 'accountlines', 'accounttype' ) ) {
-        $dbh->do(
-            qq{
-            ALTER TABLE `accountlines`
-            CHANGE COLUMN `accounttype`
-              `accounttype` varchar(16) DEFAULT NULL;
-          }
-        );
-    }
-
-    $dbh->do(qq{
-        UPDATE
-          accountlines
-        SET
-          accounttype = 'OVERDUE',
-          status = 'UNRETURNED'
-        WHERE
-          accounttype = 'FU';
-    });
-
-    $dbh->do(qq{
-        UPDATE
-          accountlines
-        SET
-          accounttype = 'OVERDUE',
-          status = 'FORGIVEN'
-        WHERE
-          accounttype = 'FFOR';
-    });
-
-    $dbh->do(qq{
-        UPDATE
-          accountlines
-        SET
-          accounttype = 'OVERDUE',
-          status = 'RETURNED'
-        WHERE
-          accounttype = 'F';
-    });
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 22521 - Update accountlines.accounttype to varchar(16), and map new statuses)\n";
-}
index 1d2feb4..e4d3651 100755 (executable)
@@ -18102,6 +18102,79 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 20128: Add permission for Advanced Cataloging Editor)\n";
 }
 
+$DBversion = '18.12.00.055';
+if ( CheckVersion($DBversion) ) {
+
+    $dbh->do(qq{
+        UPDATE
+          `account_offset_types`
+        SET
+          type = 'OVERDUE'
+        WHERE
+          type = 'Fine';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          `account_offset_types`
+        SET
+          type = 'OVERDUE_INCREASE'
+        WHERE
+          type = 'fine_increase';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          `account_offset_types`
+        SET
+          type = 'OVERDUE_DECREASE'
+        WHERE
+          type = 'fine_decrease';
+    });
+
+    if ( column_exists( 'accountlines', 'accounttype' ) ) {
+        $dbh->do(
+            qq{
+            ALTER TABLE `accountlines`
+            CHANGE COLUMN `accounttype`
+              `accounttype` varchar(16) DEFAULT NULL;
+          }
+        );
+    }
+
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'UNRETURNED'
+        WHERE
+          accounttype = 'FU';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'FORGIVEN'
+        WHERE
+          accounttype = 'FFOR';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'RETURNED'
+        WHERE
+          accounttype = 'F';
+    });
+    SetVersion($DBversion);
+    print "Upgrade to $DBversion done (Bug 22521 - Update accountlines.accounttype to varchar(16), and map new statuses)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.