Koha/installer/data/mysql/atomicupdate/0007-Opac-search-history.pl
Henri-Damien LAURENT feeafa8168 Adding Opac-SearchHistory feature
Enables ppl to store their search history and delete the whole history

Adding Storable required by Opac-Search-History

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:22:21 +02:00

24 lines
806 B
Perl

#! /usr/bin/perl
use strict;
use warnings;
use C4::Context;
my $dbh=C4::Context->dbh;
$dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('EnableOpacSearchHistory', '1', '', 'Enable or disable opac search history', 'YesNo')");
my $create = << END;
CREATE TABLE IF NOT EXISTS `search_history` (
`userid` int(11) NOT NULL,
`sessionid` varchar(32) NOT NULL,
`query_desc` varchar(255) NOT NULL,
`query_cgi` varchar(255) NOT NULL,
`total` int(11) NOT NULL,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
KEY `userid` (`userid`),
KEY `sessionid` (`sessionid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Opac search history results';
END
$dbh->do($create);
print "Upgrade done (added OPAC search history preference and table)\n";