ClassMetadata: Moved the duplicate indexes check and update code to a separate method.