SELECT cron.schedule(
  '0 0 * * *',
  $$ UPDATE scheduled_episodes
     SET status = 'aired'
     WHERE air_date < CURRENT_DATE
     AND status = 'upcoming' $$);
