From 3f8bb003cce628781d581cfdc3ec688e904b3f2c Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sat, 12 Mar 2011 08:15:17 +1300 Subject: [PATCH] Bug 3624 : Follow up patch, to catch any installs that still have the missing columns --- installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d6b7322d71..e9da578618 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4051,6 +4051,25 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +# due to a mismatch in kohastructure.sql some koha will have missing columns in aqbasketgroup +# this attempts to fix that +$DBversion = '3.03.00.023'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'billingplace'"); + $sth->execute; + $dbh->do("ALTER TABLE aqbasketgroups ADD billingplace VARCHAR(10)") if ! $sth->fetchrow_hashref; + $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'deliveryplace'"); + $sth->execute; + $dbh->do("ALTER TABLE aqbasketgroups ADD deliveryplace VARCHAR(10)") if ! $sth->fetchrow_hashref; + $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'deliverycomment'"); + $sth->execute; + $dbh->do("ALTER TABLE aqbasketgroups ADD deliverycomment VARCHAR(255)") if ! $sth->fetchrow_hashref; + print "Upgrade to $DBversion done (Reconcile aqbasketgroups)\n"; + SetVersion ($DBversion); +} + + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index 6c5f07dc67..f092a9a38d 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.03.00.022'; + our $VERSION = '3.03.00.023'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5