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 <gmcharlt@gmail.com>
This commit is contained in:
Sébastien Hinderer 2009-07-24 11:00:07 +02:00 committed by Galen Charlton
parent 9693cb36a8
commit 9d34a4caa1
3 changed files with 30 additions and 1 deletions

View 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
);
--

View 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;

View file

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