Set ON DELETE constraint for Job.upstream_job

We do not want to get all its downstream jobs removed if we delete a
job.
Better frontend handling of Job <-> ApplicationJob relationship