protected function migrateEnrollment($enrollment)
    {
        $user = $this->migratePerson($enrollment->person);
        try {
            $enrollment = ScoolEnrollment::firstOrNew([
                'user_id'      => $user->id,
                'study_id'     => $this->translateStudyId($enrollment->study_id),
                'course_id'    => $this->translateCourseId($enrollment->course_id),
                'classroom_id' => $this->translateClassroomId($enrollment->group_id)
            ]);
            $enrollment->state='Validated';
            $enrollment->save();
            return $enrollment;
        } catch (\Exception $e) {
            $this->output->error(
                'Error migrating enrollment. ' . class_basename($e) . ' ' .  $e->getMessage());
            return null;
        }
    }