When deleting rows from the job table, make sure the delete is cascaded to the dependencies and heartbeat tables.