Create relations only if related attributes have been defined