migrate database and create associations