Refactored db migrations