fixed relations in db by adding foreign keys and depencies