bug 3440: Database structure modification.
authorSébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
Fri, 24 Jul 2009 09:00:07 +0000 (11:00 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Sat, 1 Aug 2009 13:43:44 +0000 (09:43 -0400)
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 <gmcharlt@gmail.com>
installer/data/Pg/kohastructure.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 9243ad5..8c444fe 100644 (file)
@@ -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
 );
 
 -- 
index 2b2e0c9..591ab58 100644 (file)
@@ -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;
 
index 58497c8..ea126f8 100755 (executable)
@@ -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