From 8e3b2eb6f5c664cd21712c847d060a010dd33ca1 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 12 Jun 2017 10:07:53 -0400 Subject: [PATCH] Bug 18786 - Update database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc VĂ©ron --- installer/data/mysql/atomicupdate/bug_18786.perl | 10 ++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 11 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_18786.perl diff --git a/installer/data/mysql/atomicupdate/bug_18786.perl b/installer/data/mysql/atomicupdate/bug_18786.perl new file mode 100644 index 0000000..7617bc5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18786.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if ( !column_exists( 'accountlines', 'payment_type' ) ) { + $dbh->do( "ALTER TABLE accountlines ADD `payment_type` varchar(80) default NULL AFTER accounttype" ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18786 - Add ability to create custom payment types)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f2890b5..4f10643 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2717,6 +2717,7 @@ CREATE TABLE `accountlines` ( `description` mediumtext, `dispute` mediumtext, `accounttype` varchar(5) default NULL, + `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE `amountoutstanding` decimal(28,6) default NULL, `lastincrement` decimal(28,6) default NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- 2.1.4