add migrate and unit test