DB; add constraints on parent ids

Parent ids must be in job table, and child id cannot equal
a parent id.