history tracking using sqlite.