Bug 11268: increase size of biblioitems.url

The URL field in biblioitems is defined as a varchar(255) which is large
enough for most URLs but not all. This patch converts it to a
TEXT field to make sure it is capable of storing all valid URLs.

Test Plan:
1) Attempt to a URL that is greater than 255 chacters long in a record
   (856$u in MARC21)
2) Save the record, note the url gets truncated
3) Apply this patch
4) Repeat step 1
5) Note the entire url is saved

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Kyle Hall 2013-11-18 14:18:15 -05:00 committed by Galen Charlton
parent f5ac575cf7
commit ecd8dabf76
2 changed files with 10 additions and 2 deletions

View file

@ -173,7 +173,7 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in
`place` varchar(255) default NULL, -- publication place (MARC21 260$a) `place` varchar(255) default NULL, -- publication place (MARC21 260$a)
`lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a) `lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a)
`marc` longblob, -- full bibliographic MARC record `marc` longblob, -- full bibliographic MARC record
`url` varchar(255) default NULL, -- url (MARC21 856$u) `url` text default NULL, -- url (MARC21 856$u)
`cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2) `cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2)
`cn_class` varchar(30) default NULL, `cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL, `cn_item` varchar(10) default NULL,
@ -775,7 +775,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t
`place` varchar(255) default NULL, -- publication place (MARC21 260$a) `place` varchar(255) default NULL, -- publication place (MARC21 260$a)
`lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a) `lccn` varchar(25) default NULL, -- library of congress control number (MARC21 010$a)
`marc` longblob, -- full bibliographic MARC record `marc` longblob, -- full bibliographic MARC record
`url` varchar(255) default NULL, -- url (MARC21 856$u) `url` text default NULL, -- url (MARC21 856$u)
`cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2) `cn_source` varchar(10) default NULL, -- classification source (MARC21 942$2)
`cn_class` varchar(30) default NULL, `cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL, `cn_item` varchar(10) default NULL,

View file

@ -7945,6 +7945,14 @@ if (CheckVersion($DBversion)) {
SetVersion($DBversion); SetVersion($DBversion);
} }
$DBversion = "3.15.00.XXX";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE biblioitems CHANGE url url TEXT NULL DEFAULT NULL");
$dbh->do("ALTER TABLE deletedbiblioitems CHANGE url url TEXT NULL DEFAULT NULL");
print "Upgrade to $DBversion done (Bug 11268 - Biblioitems URL field is too small for some URLs)\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS =head1 FUNCTIONS
=head2 TableExists($table) =head2 TableExists($table)