Fix upgrade procedure from schema version 5 to version 6.