Implemented automatic migration for models.