ALTER TABLE  `releases` ADD  `updatedate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `adddate`;
ALTER TABLE  `releases` ADD INDEX  `ix_releases_updatedate` (`updatedate`);

ALTER TABLE  `predb` ADD  `updatedate` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE  `predb` ADD INDEX  `ix_predb_updatedate` (`updatedate`);

CREATE TABLE IF NOT EXISTS `sphinx` (
  `ID` int(11) NOT NULL,
  `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `maxID` int(11) NOT NULL,
  `updatedate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `lastmergedate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `nextmergedate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastrebuilddate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `nextrebuilddate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `sphinx` (`ID`, `name`, `maxID`, `updatedate`, `lastmergedate`, `nextmergedate`, `lastrebuilddate`, `nextrebuilddate`)
VALUES
    (1, 'releases', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
    (2, 'releasefiles', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
    (3, 'releasenfo', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
    (4, 'predb', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00');

INSERT INTO `site`
	(`setting`, `value`)
	VALUES
	('sphinxenabled', 0),
	('sphinxconfpath', ''),
	('sphinxbinpath', ''),
	('sphinxindexnzbs', 0),
	('sphinxindexnfos', 0),
	('sphinxindexreleasefiles', 0),
	('sphinxindexpredb', 0),
    ('sphinxmergefreq', '0200'),
    ('sphinxmergefreq_count', 10000),
    ('sphinxrebuildfreq_day', 'Monday'),
    ('sphinxrebuildfreq', '0300'),
	('sphinxserverhost', '127.0.0.1:9306'),
	('sphinxsearchfields', 'name,searchname');