-- Clean up orphaned milestone submissions without submission_items
-- These submissions cannot be properly moderated due to missing required data

DELETE FROM content_submissions
WHERE submission_type = 'milestone'
  AND status = 'pending'
  AND id NOT IN (
    SELECT DISTINCT submission_id 
    FROM submission_items
  );