I need to delete hundreds of cohorts in Moodle because they are obsolote.
I figured out how to delete them with SQL: delete all items from mdl_cohort_members where thoses cohorts are used and then delete all item in mdl_cohort.
However, I would like to know if a cohort is used on any course before deleting it.
I saw things in mdl_enroll table, but cannot find the revelant cohort id.
So how can I get a list of all courses where a cohort has been used with the "cohort synchronisation" enrollement method?
Because I ddon't know what will happen in thèses cases if I delete the cohort.