migrate db and prepare it before run