add id to history and rename former id to seq