From 208d4c6a74a1cc5fe89d4990eaba39c1851b8208 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Wed, 20 Nov 2013 14:34:36 +0100 Subject: [PATCH] Bug 11275: make deleteditems.materials be of type text Bug 7278 has made items.materials of type text. It must be the same in deleteditems column. Signed-off-by: Katrin Fischer Passes all tests and QA script. Tested: - definition of materials now matches between items and deleteditems - database update works correctly Signed-off-by: Jonathan Druart The only difference between tables items and deleteditems is deleteditems.marc Amended patch: Add a missing SetVersion in updatedb.pl Signed-off-by: Galen Charlton (cherry picked from commit 8aa6e51b6f684f98077dd1c3df1f847bef8d40ba) Signed-off-by: Fridolin SOMERS (cherry picked from commit e312ac25eae6b436c5ad71a2493520b5b5600564) Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 7af3d1a84d..d2fbc0bd22 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -781,7 +781,7 @@ CREATE TABLE `deleteditems` ( `cn_source` varchar(10) default NULL, -- classification source used on this item (MARC21 952$2) `cn_sort` varchar(30) default NULL, -- normalized form of the call number (MARC21 952$o) used for sorting `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (MARC21 952$8) - `materials` varchar(10) default NULL, -- materials specified (MARC21 952$3) + `materials` text default NULL, -- materials specified (MARC21 952$3) `uri` varchar(255) default NULL, -- URL for the item (MARC21 952$u) `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (MARC21 952$y) `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 5ea1f7b7fe..227d1744d2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6949,6 +6949,13 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.13.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do("ALTER TABLE deleteditems MODIFY materials text;"); + print "Upgrade to $DBversion done (Bug 11275: alter deleteditems.materials from varchar(10) to text)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 2.39.5