make the migrate script capable of being imported with require