Bug 5671 Revised Patch #2 - Add a column of custom HTML to my summary
[koha.git] / installer / data / mysql / atomicupdate / 0007-Opac-search-history.pl
1 #! /usr/bin/perl
2 use strict;
3 use warnings;
4 use C4::Context;
5 my $dbh=C4::Context->dbh;
6
7 $dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('EnableOpacSearchHistory', '1', '', 'Enable or disable opac search history', 'YesNo')");
8
9 my $create = <<END;
10 CREATE TABLE IF NOT EXISTS `search_history` (
11   `userid` int(11) NOT NULL,
12   `sessionid` varchar(32) NOT NULL,
13   `query_desc` varchar(255) NOT NULL,
14   `query_cgi` varchar(255) NOT NULL,
15   `total` int(11) NOT NULL,
16   `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
17   KEY `userid` (`userid`),
18   KEY `sessionid` (`sessionid`)
19 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Opac search history results';
20 END
21
22 $dbh->do($create);
23
24 print "Upgrade done (added OPAC search history preference and table)\n";