Move index logic to mgdschema part & also set index for non-association links