Added history model to db and code