From 94ab1fc0615748ef278eed7299c49b88b5941061 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 21 Oct 2007 15:11:39 -0500 Subject: [PATCH] updatedatabase for branch category types Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- installer/kohastructure.sql | 1 - updater/updatedatabase | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/installer/kohastructure.sql b/installer/kohastructure.sql index 59aa4f715c..2421c9573c 100644 --- a/installer/kohastructure.sql +++ b/installer/kohastructure.sql @@ -524,7 +524,6 @@ DROP TABLE IF EXISTS `branchrelations`; CREATE TABLE `branchrelations` ( `branchcode` char(10) NOT NULL default '', `categorycode` char(10) NOT NULL default '', - `relation` char(10) default NULL, PRIMARY KEY (`branchcode`,`categorycode`), KEY `branchcode` (`branchcode`), KEY `categorycode` (`categorycode`), diff --git a/updater/updatedatabase b/updater/updatedatabase index 5d635033f7..2d53946f6f 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -298,6 +298,16 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.011"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `branchcategories` CHANGE `categorycode` `categorycode` char(10) "); + $dbh->do("ALTER TABLE `branchcategories` CHANGE `categoryname` `categoryname` varchar(32) "); + $dbh->do("ALTER TABLE `branchcategories` ADD COLUMN `categorytype` varchar(16) "); + $dbh->do("ALTER TABLE `branchrelations` CHANGE `cateorycode` `cateorycode` char(10) "); + print "Upgrade to $DBversion done (added branchcategory type)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) -- 2.39.5