fix creation of entity ids in migration