Fixed wiring on database relations