From 0ff09dc64993551d1b3cda3633605c73dacbacb7 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 7 Apr 2011 11:41:30 +0200 Subject: [PATCH] Bug 5422: Separate state field for patron's addresses - database update Signed-off-by: Magnus Enger Signed-off-by: Chris Cormack --- installer/data/mysql/kohastructure.sql | 3 +++ installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ kohaversion.pl | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 28dd5a60ae..478afd61e4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -206,6 +206,7 @@ CREATE TABLE `borrowers` ( `address` mediumtext NOT NULL, `address2` text, `city` mediumtext NOT NULL, + `state` mediumtext default NULL, `zipcode` varchar(25) default NULL, `country` text, `email` mediumtext, @@ -219,6 +220,7 @@ CREATE TABLE `borrowers` ( `B_address` varchar(100) default NULL, `B_address2` text default NULL, `B_city` mediumtext, + `B_state` mediumtext default NULL, `B_zipcode` varchar(25) default NULL, `B_country` text, `B_email` text, @@ -252,6 +254,7 @@ CREATE TABLE `borrowers` ( `altcontactaddress1` varchar(255) default NULL, `altcontactaddress2` varchar(255) default NULL, `altcontactaddress3` varchar(255) default NULL, + `altcontactstate` mediumtext default NULL, `altcontactzipcode` varchar(50) default NULL, `altcontactcountry` text default NULL, `altcontactphone` varchar(50) default NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7f76078eed..b42b6ed889 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4259,6 +4259,18 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = '3.03.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE borrowers ADD `state` mediumtext AFTER city;"); + $dbh->do("ALTER TABLE borrowers ADD `B_state` mediumtext AFTER B_city;"); + $dbh->do("ALTER TABLE borrowers ADD `altcontactstate` mediumtext AFTER altcontactaddress3;"); + $dbh->do("ALTER TABLE deletedborrowers ADD `state` mediumtext AFTER city;"); + $dbh->do("ALTER TABLE deletedborrowers ADD `B_state` mediumtext AFTER B_city;"); + $dbh->do("ALTER TABLE deletedborrowers ADD `altcontactstate` mediumtext AFTER altcontactaddress3;"); + print "Upgrade to $DBversion done (Add state field to patron's addresses)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index 6b33ee06ad..83304597a1 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.046'; + our $VERSION = '3.03.00.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5