Bug 10215: Increase the size of opacnote and librariannote for table subscriptionhistory

We have librarians that are regularly hitting the maximum number of
characters for the note fields in subscription history. They would like
to be able to store at least 1000 characters here. Converting the
varchar(150) to text should do it.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Add public and private notes to a subscription history entry
   where each note is greater than 150 characters.
4) Save and view the notes, the notes should not be truncated.

Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8592474c3f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c42c44e932)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2013-05-07 12:49:03 -04:00 committed by Lucas Gass
parent 76b797bb5f
commit 0caaa8e884
3 changed files with 12 additions and 2 deletions

View File

@ -428,6 +428,7 @@ sub GetSubscriptionsFromBiblionumber {
} else {
$subs->{histenddate} = "";
}
$subs->{opacnote} //= "";
$subs->{opacnote} =~ s/\n/\<br\/\>/g;
$subs->{missinglist} =~ s/\n/\<br\/\>/g;
$subs->{recievedlist} =~ s/\n/\<br\/\>/g;

View File

@ -0,0 +1,9 @@
$DBversion = 'XXX';
if ( CheckVersion($DBversion) ) {
$dbh->do(q{ALTER TABLE subscriptionhistory CHANGE opacnote opacnote LONGTEXT NULL});
$dbh->do(q{ALTER TABLE subscriptionhistory CHANGE librariannote librariannote LONGTEXT NULL});
SetVersion ($DBversion);
print "Upgrade to $DBversion done (Bug 10215 - Increase the size of opacnote and librariannote for table subscriptionhistory)\n";
}

View File

@ -2146,8 +2146,8 @@ CREATE TABLE `subscriptionhistory` (
`histenddate` date default NULL,
`missinglist` LONGTEXT NOT NULL,
`recievedlist` LONGTEXT NOT NULL,
`opacnote` varchar(150) NOT NULL default '',
`librariannote` varchar(150) NOT NULL default '',
`opacnote` LONGTEXT NULL,
`librariannote` LONGTEXT NULL,
PRIMARY KEY (`subscriptionid`),
KEY `biblionumber` (`biblionumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;