move migration functions outside of bin\migrate so they are easier to script