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

/*PATCHHERE*/
DELETE FROM parts USING parts LEFT JOIN binaries on binaries.ID = parts.binaryID WHERE binaries.ID is null