Bug 21683: Database update
authorJosef Moravec <josef.moravec@gmail.com>
Fri, 26 Oct 2018 11:02:58 +0000 (11:02 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 21 Mar 2019 18:19:22 +0000 (18:19 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql

diff --git a/installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl b/installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl
new file mode 100644 (file)
index 0000000..0207380
--- /dev/null
@@ -0,0 +1,11 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+
+    if( column_exists( 'accountlines', 'accountno' ) ) {
+        $dbh->do( "ALTER TABLE accountlines DROP COLUMN accountno" );
+    }
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
+}
index b7356ad..f641f32 100644 (file)
@@ -2673,7 +2673,6 @@ CREATE TABLE `accountlines` (
   `accountlines_id` int(11) NOT NULL AUTO_INCREMENT,
   `issue_id` int(11) NULL DEFAULT NULL,
   `borrowernumber` int(11) DEFAULT NULL,
-  `accountno` smallint(6) NOT NULL default 0,
   `itemnumber` int(11) default NULL,
   `date` date default NULL,
   `amount` decimal(28,6) default NULL,