Added db relationships and added chainstore id to workorders