Bug 19066: Update Database

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Squashing for cleaner history

Bug 19066: (QA follow-up) Move db update to perl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Kyle Hall 2017-08-09 09:50:21 -04:00 committed by Nick Clemens
parent fb98450172
commit bf75f24351
2 changed files with 12 additions and 0 deletions

View file

@ -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";
}

View file

@ -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`),