From 9d34a4caa10ef77dd62f681dba38a544e248755e Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Hinderer?= Date: Fri, 24 Jul 2009 11:00:07 +0200 Subject: [PATCH] bug 3440: Database structure modification. Adds 5 columns to the `branches` table: `branchzip`, `branchcity`, `branchcountry`, `branchurl` and `branchnote`. I/O operations for these fields are not included. Signed-off-by: Galen Charlton --- installer/data/Pg/kohastructure.sql | 7 ++++++- installer/data/mysql/kohastructure.sql | 5 +++++ installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/installer/data/Pg/kohastructure.sql b/installer/data/Pg/kohastructure.sql index 9243ad59c2..8c444fe9e4 100644 --- a/installer/data/Pg/kohastructure.sql +++ b/installer/data/Pg/kohastructure.sql @@ -540,12 +540,17 @@ branchname text NOT NULL, branchaddress1 text, branchaddress2 text, branchaddress3 text, +branchzip varchar(25) default NULL, +branchcity mediumtext, +branchcountry text, branchphone text, branchfax text, branchemail text, +branchurl mediumtext, issuing int default NULL, branchip varchar(15) default NULL, -branchprinter varchar(100) default NULL +branchprinter varchar(100) default NULL, +branchnotes mediumtext ); -- diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2b2e0c99e7..591ab58a99 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -569,12 +569,17 @@ CREATE TABLE `branches` ( `branchaddress1` mediumtext, `branchaddress2` mediumtext, `branchaddress3` mediumtext, + `branchzip` varchar(25) default NULL, + `branchcity` mediumtext, + `branchcountry` text, `branchphone` mediumtext, `branchfax` mediumtext, `branchemail` mediumtext, + `branchurl` mediumtext, `issuing` tinyint(4) default NULL, `branchip` varchar(15) default NULL, `branchprinter` varchar(100) default NULL, + `branchnotes` mediumtext, UNIQUE KEY `branchcode` (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 58497c8e74..ea126f8e5b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2467,6 +2467,25 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (added FilterBeforeOverdueReport syspref and new index on authorised_values)\n"; } +=item + + Deal with branches + +=cut + +my $DBversion = "3.01.00.038"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + # update branches table + # + $dbh->do("ALTER TABLE branches ADD `branchzip` varchar(25) default NULL AFTER `branchaddress3`"); + $dbh->do("ALTER TABLE branches ADD `branchcity` mediumtext AFTER `branchzip`"); + $dbh->do("ALTER TABLE branches ADD `branchcountry` text AFTER `branchcity`"); + $dbh->do("ALTER TABLE branches ADD `branchurl` mediumtext AFTER `branchemail`"); + $dbh->do("ALTER TABLE branches ADD `branchnotes` mediumtext AFTER `branchprinter`"); + print "Upgrade to $DBversion done (branches)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5