From 2d512d5ce631a950e502eb59a3f486906073eeff Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 26 Oct 2018 11:02:58 +0000 Subject: [PATCH] Bug 21683: Database update Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../bug_21683_remove_column_accountno.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl 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 index 0000000000..02073805ba --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl @@ -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"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4778e034bc..7bd084439f 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -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, -- 2.21.0