refactor migration and include updated schema