Move entity reference constraint to field constraint