From 1d8f12b9eb12810fbe7f54c80a0106243e20e340 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Mon, 8 Oct 2007 14:24:34 -0500 Subject: [PATCH] bugfix : some column add a wrong size In Koha 3.0, most short code have been resized to varchar(10). This includes itemtype, branchcode, patron category I've found some tables refering to an old-small-size definition Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- installer/kohastructure.sql | 15 +++++++-------- updater/update22to30.pl | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/installer/kohastructure.sql b/installer/kohastructure.sql index a30d742ea7..96873575ec 100644 --- a/installer/kohastructure.sql +++ b/installer/kohastructure.sql @@ -382,7 +382,7 @@ CREATE TABLE `biblioitems` ( `volume` mediumtext, `number` mediumtext, `classification` varchar(25) default NULL, - `itemtype` varchar(4) default NULL, + `itemtype` varchar(10) default NULL, `isbn` varchar(14) default NULL, `issn` varchar(9) default NULL, `dewey` varchar(30) default '', @@ -650,7 +650,7 @@ CREATE TABLE `deletedbiblioitems` ( `volume` mediumtext, `number` mediumtext, `classification` varchar(25) default NULL, - `itemtype` varchar(4) default NULL, + `itemtype` varchar(10) default NULL, `isbn` varchar(14) default NULL, `issn` varchar(9) default NULL, `dewey` double(8,6) default NULL, @@ -828,8 +828,8 @@ CREATE TABLE `issues` ( DROP TABLE IF EXISTS `issuingrules`; CREATE TABLE `issuingrules` ( - `categorycode` varchar(2) NOT NULL default '', - `itemtype` varchar(4) NOT NULL default '', + `categorycode` varchar(10) NOT NULL default '', + `itemtype` varchar(10) NOT NULL default '', `restrictedtype` tinyint(1) default NULL, `rentaldiscount` decimal(28,6) default NULL, `reservecharge` decimal(28,6) default NULL, @@ -844,8 +844,7 @@ CREATE TABLE `issuingrules` ( PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), KEY `categorycode` (`categorycode`), KEY `itemtype` (`itemtype`), - CONSTRAINT `issuingrules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `issuingrules_ibfk_2` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE + CONSTRAINT `issuingrules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- @@ -1284,14 +1283,14 @@ CREATE TABLE `special_holidays` ( DROP TABLE IF EXISTS `statistics`; CREATE TABLE `statistics` ( `datetime` datetime default NULL, - `branch` varchar(4) default NULL, + `branch` varchar(10) default NULL, `proccode` varchar(4) default NULL, `value` double(16,4) default NULL, `type` varchar(16) default NULL, `other` mediumtext, `usercode` varchar(10) default NULL, `itemnumber` int(11) default NULL, - `itemtype` varchar(4) default NULL, + `itemtype` varchar(10) default NULL, `borrowernumber` int(11) default NULL, `associatedborrower` int(11) default NULL, KEY `timeidx` (`datetime`) diff --git a/updater/update22to30.pl b/updater/update22to30.pl index 3d68bcd9c0..2eed298098 100755 --- a/updater/update22to30.pl +++ b/updater/update22to30.pl @@ -773,6 +773,14 @@ my $DBversion = "3.00.00.000"; ], biblioitems => [ + { + field => 'itemtype', + type => 'varchar(10)', + null => 'NOT NULL', + key => '', + default => '', + extra => '', + }, { field => 'lcsort', type => 'varchar(25)', @@ -841,6 +849,13 @@ my $DBversion = "3.00.00.000"; ], deletedbiblioitems => [ + { + field => 'itemtype', + type => 'varchar(10)', + null => 'NOT NULL', + default => '', + extra => '', + }, { field => 'dewey', type => 'varchar(30)', @@ -1164,6 +1179,18 @@ my $DBversion = "3.00.00.000"; null => 'NULL', }, ], + statistics => [ + { + field => 'branch', + type => 'varchar(10)', + null => 'NOT NULL', + }, + { + field => 'itemtype', + type => 'varchar(10)', + null => 'NOT NULL', + }, + ], systempreferences => [ { field => 'value', -- 2.39.5