View | Details | Raw Unified | Return to bug 11430
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 1939-1944 CREATE TABLE saved_reports ( Link Here
1939
1939
1940
DROP TABLE IF EXISTS `search_history`;
1940
DROP TABLE IF EXISTS `search_history`;
1941
CREATE TABLE IF NOT EXISTS `search_history` ( -- patron's opac search history
1941
CREATE TABLE IF NOT EXISTS `search_history` ( -- patron's opac search history
1942
  `ìd` int(11) NOT NULL auto_increment, -- search history id
1942
  `userid` int(11) NOT NULL, -- the patron who performed the search (borrowers.borrowernumber)
1943
  `userid` int(11) NOT NULL, -- the patron who performed the search (borrowers.borrowernumber)
1943
  `sessionid` varchar(32) NOT NULL, -- a system generated session id
1944
  `sessionid` varchar(32) NOT NULL, -- a system generated session id
1944
  `query_desc` varchar(255) NOT NULL, -- the search that was performed
1945
  `query_desc` varchar(255) NOT NULL, -- the search that was performed
Lines 1948-1953 CREATE TABLE IF NOT EXISTS `search_history` ( -- patron's opac search history Link Here
1948
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date and time the search was run
1949
  `time` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date and time the search was run
1949
  KEY `userid` (`userid`),
1950
  KEY `userid` (`userid`),
1950
  KEY `sessionid` (`sessionid`)
1951
  KEY `sessionid` (`sessionid`)
1952
  PRIMARY KEY  (`id`)
1951
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Opac search history results';
1953
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Opac search history results';
1952
1954
1953
1955
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +17 lines)
Lines 9793-9798 if(CheckVersion($DBversion)) { Link Here
9793
    SetVersion($DBversion);
9793
    SetVersion($DBversion);
9794
}
9794
}
9795
9795
9796
9797
9798
9799
9800
9801
9802
$DBversion = "3.17.00.XXX";
9803
if ( CheckVersion($DBversion) ) {
9804
    $dbh->do(q|
9805
        ALTER TABLE search_history ADD COLUMN id INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY(id);
9806
    |);
9807
    print "Upgrade to $DBversion done (Bug 11430 - Add primary key for search_history)\n";
9808
    SetVersion($DBversion);
9809
}
9810
9811
9812
9796
=head1 FUNCTIONS
9813
=head1 FUNCTIONS
9797
9814
9798
=head2 TableExists($table)
9815
=head2 TableExists($table)
9799
- 

Return to bug 11430