fix migration script and models