fixes in db relations definitions