refactor db migrations