refactored todo databse migration