From bf75f243512364a6b83ebe766105bf444bc43097 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 9 Aug 2017 09:50:21 -0400 Subject: [PATCH] Bug 19066: Update Database Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize Squashing for cleaner history Bug 19066: (QA follow-up) Move db update to perl Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../bug_19066_add_accountlines_branchcode.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 12 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_19066_add_accountlines_branchcode.perl diff --git a/installer/data/mysql/atomicupdate/bug_19066_add_accountlines_branchcode.perl b/installer/data/mysql/atomicupdate/bug_19066_add_accountlines_branchcode.perl new file mode 100644 index 0000000000..426d997da5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_19066_add_accountlines_branchcode.perl @@ -0,0 +1,11 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'accountlines', 'branchcode' ) ) { + $dbh->do("ALTER TABLE accountlines ADD branchcode VARCHAR( 10 ) NULL DEFAULT NULL AFTER manager_id"); + } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 19066 - Add branchcode to accountlines)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 8a8ca49122..807ae72f9f 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2718,6 +2718,7 @@ CREATE TABLE `accountlines` ( `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `note` MEDIUMTEXT NULL default NULL, `manager_id` int(11) NULL, + `branchcode` VARCHAR( 10 ) NULL DEFAULT NULL, -- the branchcode of the library where a payment was made, a manual invoice created, etc. PRIMARY KEY (`accountlines_id`), KEY `acctsborridx` (`borrowernumber`), KEY `timeidx` (`timestamp`), -- 2.39.5