fix db relations