/*UPDATEREVISION*/
INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('dbversion', '$Rev: 4060 $', now()) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), updateddate=now();

/*PATCHHERE*/

INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('elasticenabled', '0', now());
INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('elasticurl', 'localhost:9200', now());

CREATE TABLE `elasticsearch` (
	`name` VARCHAR(20) NOT NULL COLLATE 'utf8_unicode_ci',
	`maxID` INT(11),
	`updatedate` DATETIME,
	`lastrebuilddate` DATETIME,
	`nextrebuilddate` DATETIME,
	`indexname` VARCHAR(255) COLLATE 'utf8_unicode_ci',
	PRIMARY KEY (`name`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

insert into elasticsearch (name, maxID, updatedate, lastrebuilddate, nextrebuilddate, indexname) 
values ('releases', 0, null, null, null, null);

insert into elasticsearch (name, maxID, updatedate, lastrebuilddate, nextrebuilddate, indexname) 
values ('releasefiles', 0, null, null, null, null);

delete from movieinfo where title = '';

insert into groups (name, backfill_target, first_record, last_record, regexmatchonly, active)
select distinct groupname, 1, 0, 0, 1, 0 from releaseregex where groupname not in (select name from groups) and groupname != '.*';

INSERT IGNORE INTO site (`setting`, `value`, `updateddate` ) VALUES ('animetitle_banned', '0', now());

INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('elasticmaxresultwindow', '50000', now());
INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('elasticlogsuccess', '', now());
INSERT INTO site (`setting`, `value`, `updateddate` ) VALUES ('elasticlognoresults', '', now());