Adding history with database support