#765

Nightly job: clean up what's gone stale

The sessions table holds user sessions. Each one has a started_at start moment and an expires_at expiry. A nightly job purges the expired ones — their expiry is already in the past. Delete from sessions every row whose expires_at is less than the current moment. Then return id, user_id of the remaining sessions, ordered by id.

Just INSERT/UPDATE/DELETE — no trailing SELECT needed.

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid