DROP TABLE IF EXISTS `search_history`;
CREATE TABLE IF NOT EXISTS `search_history` ( -- patron's opac search history
+ `ìd` int(11) NOT NULL auto_increment, -- search history id
`userid` int(11) NOT NULL, -- the patron who performed the search (borrowers.borrowernumber)
`sessionid` varchar(32) NOT NULL, -- a system generated session id
`query_desc` varchar(255) NOT NULL, -- the search that was performed
`time` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date and time the search was run
KEY `userid` (`userid`),
KEY `sessionid` (`sessionid`)
+ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Opac search history results';
SetVersion($DBversion);
}
-
$DBversion = "3.19.00.013";
if ( CheckVersion($DBversion) ) {
$dbh->do(q|
SetVersion ($DBversion);
}
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q|
+ ALTER TABLE search_history ADD COLUMN id INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY(id);
+ |);
+ print "Upgrade to $DBversion done (Bug 11430 - Add primary key for search_history)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)