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

/*PATCHHERE*/
delete tvinfo
from tvinfo
inner join (select ID from tvinfo where ID not in (select tvinfoID from releases where tvinfoID is not null)) x on x.ID = tvinfo.ID
where mazeID is not null;

delete from tvinfo where releasetitle REGEXP '^[0-9][0-9] [0-9][0-9]' = 1;

update releases set tvinfoID = -1 where tvinfoID > 0 and tvinfoID not in (select ID from tvinfo);
