Add db functionality for adding and updating timestamp of records