update flat database