manage database for history messages