coryd.dev/queries/jobs/update_scheduled_episodes.psql

6 lines
163 B
Text

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