fix migration, add indexse, add tests on models