Website Clear Down DPCalendar Events

From CCCWiki
Jump to: navigation, search

To clear down DPCalendar events that are no longer required. Please follow run the following SQL via the phpAdmin console which is accessible via the Parallel administration panel.

 DELETE FROM ccc_dpcalendar_events WHERE id IN (
 	SELECT id FROM (
 		SELECT id FROM ccc_dpcalendar_events e
 			WHERE (original_id <> -1 AND end_date < '[date, e.g. 2015-07-01]') 
 				OR (original_id = -1 AND '[date, e.g. 2015-07-01]' > 
 				(SELECT MAX(end_date) FROM ccc_dpcalendar_events  WHERE original_id = e.id))
 	) x
 )