Convert the task scheduler from gorm to sqlc. This makes the query considerably easier to read. No functional changes intended.