From ed62c0828812a234376a6ac667f14ec8dcf1f296 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Hinderer?= Date: Sat, 1 Aug 2009 13:05:55 +0200 Subject: [PATCH] Database structure modification. Adds the country and B_country columns to the borrowers table. Signed-off-by: Galen Charlton --- installer/data/Pg/kohastructure.sql | 2 ++ installer/data/mysql/kohastructure.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/installer/data/Pg/kohastructure.sql b/installer/data/Pg/kohastructure.sql index 8c444fe9e4..69abd2469f 100644 --- a/installer/data/Pg/kohastructure.sql +++ b/installer/data/Pg/kohastructure.sql @@ -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, diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 1650802548..ac0b80b7b0 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -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, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e78484619c..4ce750d6d4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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 -- 2.39.2