>>if the repair record is deleted the repair detail should be deleted automagically too?
If the the repair record doesn't exist, the repair detail can't exist. If you want to have the autodelete behavour you'll need to specify "ON DELETE CASCADE" (or something like that, it's been a while since I've actually used any of this stuff).