In removeOrphanedEvents.php, and in future code that deletes echo_event rows more proactively (T221262), we should also delete echo_target_page rows associated with the events that we're deleting.
We'll also need to write a script that finds already-orphaned echo_target_page rows and deletes them (or make this a flag in removeOrphanedEvents.php).