Bug 5422: Separate state field for patron's addresses - database update

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Katrin Fischer 2011-04-07 11:41:30 +02:00 committed by Chris Cormack
parent 298919981c
commit 0ff09dc649
3 changed files with 16 additions and 1 deletions

View file

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

View file

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

View file

@ -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