Database structure modification.

Adds the country and B_country columns to the borrowers table.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Sébastien Hinderer 2009-08-01 13:05:55 +02:00 committed by Galen Charlton
parent 63b9b7655b
commit ed62c08288
3 changed files with 20 additions and 0 deletions

View file

@ -473,6 +473,7 @@ address text NOT NULL,
address2 text,
city text NOT NULL,
zipcode varchar(25) default NULL,
country text,
email text,
phone text,
mobile varchar(50) default NULL,
@ -484,6 +485,7 @@ B_streettype varchar(50) default NULL,
B_address varchar(100) default NULL,
B_city text,
B_zipcode varchar(25) default NULL,
B_country text,
B_email text,
B_phone text,
dateofbirth date default NULL,

View file

@ -444,6 +444,7 @@ CREATE TABLE `borrowers` (
`address2` text,
`city` mediumtext NOT NULL,
`zipcode` varchar(25) default NULL,
`country` text,
`email` mediumtext,
`phone` text,
`mobile` varchar(50) default NULL,
@ -455,6 +456,7 @@ CREATE TABLE `borrowers` (
`B_address` varchar(100) default NULL,
`B_city` mediumtext,
`B_zipcode` varchar(25) default NULL,
`B_country` text,
`B_email` text,
`B_phone` mediumtext,
`dateofbirth` date default NULL,

View file

@ -2535,6 +2535,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
print "Upgrade to $DBversion done (added a preference to hide the patrons name in the staff catalog)";
}
=item
Deal with borrowers
=cut
$DBversion = "3.01.00.039";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
# update borrowers table
#
$dbh->do("ALTER TABLE borrowers ADD `country` text AFTER zipcode");
$dbh->do("ALTER TABLE borrowers ADD `B_country` text AFTER B_zipcode");
print "Upgrade to $DBversion done (branches)\n";
SetVersion ($DBversion);
}
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table