Check all the cascade deletions
Here is a log from postgres:
2018-08-19 16:44:46.817 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:44:46.817 UTC [71] DETAIL: Key (id)=(ea8d6a6f-d30b-494c-8d1a-962093f95375) is still referenced from table "users_groups".
2018-08-19 16:44:46.817 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '582af20d-e0ac-4cd9-a559-10fac467b8a7'
2018-08-19 16:46:51.051 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:46:51.051 UTC [71] DETAIL: Key (id)=(d6a85568-652c-4dde-9a00-e40a5160620c) is still referenced from table "users_groups".
2018-08-19 16:46:51.051 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'e99199c4-9763-4ee7-b9eb-e667348d6f2b'
2018-08-19 16:48:46.011 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:48:46.011 UTC [71] DETAIL: Key (id)=(7bbc7e52-bcf4-442d-8d69-6a487c7d9442) is still referenced from table "users_groups".
2018-08-19 16:48:46.011 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'bfece55b-7445-42aa-ab70-3da5bb3f98ba'
2018-08-19 16:52:31.575 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:52:31.575 UTC [71] DETAIL: Key (id)=(3dc2bb13-b0ec-4ff3-ba74-bbcea40d1a68) is still referenced from table "users_groups".
2018-08-19 16:52:31.575 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '73cfe41c-0276-4563-ba08-4180ee08eb65'
2018-08-19 16:52:31.832 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:52:31.832 UTC [71] DETAIL: Key (id)=(0ee71aa5-b01d-4d22-a5a7-0adcd7471eab) is still referenced from table "users_groups".
2018-08-19 16:52:31.832 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'b30a7153-8a9a-4e51-95d8-b77517ba22ac'
2018-08-19 16:55:59.270 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:55:59.270 UTC [71] DETAIL: Key (id)=(d0cbc348-bc73-469a-9b9f-e566f8ddb257) is still referenced from table "users_groups".
2018-08-19 16:55:59.270 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '16ff9861-37fc-431d-aa97-d7183863540b'
2018-08-19 16:55:59.761 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "projects_groups_group_id_fkey" on table "projects_groups"
2018-08-19 16:55:59.761 UTC [71] DETAIL: Key (id)=(06d81916-7678-4938-a15c-d7bf129982b8) is still referenced from table "projects_groups".
2018-08-19 16:55:59.761 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'a26d2cda-3050-4f70-a3f4-6680ecd05bd4'
2018-08-19 16:56:29.182 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:56:29.182 UTC [71] DETAIL: Key (id)=(693d189d-4176-4374-b7df-c7a522d2d8a7) is still referenced from table "users_groups".
2018-08-19 16:56:29.182 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'f32c6331-d7c8-441e-8d0e-b5fdd1e9293c'
2018-08-19 16:56:29.665 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "projects_groups_group_id_fkey" on table "projects_groups"
2018-08-19 16:56:29.665 UTC [71] DETAIL: Key (id)=(1d7ffd22-0198-47a5-af62-5464d0422b4f) is still referenced from table "projects_groups".
2018-08-19 16:56:29.665 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '465c90f7-8e9a-4647-9386-ad4624ff9977'
2018-08-19 16:57:51.276 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "users_groups_group_id_fkey" on table "users_groups"
2018-08-19 16:57:51.276 UTC [71] DETAIL: Key (id)=(9a3ef11e-b748-4b24-a9a9-91922b84f306) is still referenced from table "users_groups".
2018-08-19 16:57:51.276 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '2a9260d8-4dd7-41c5-941f-a82e7cb83184'
2018-08-19 16:57:51.747 UTC [71] ERROR: update or delete on table "group" violates foreign key constraint "projects_groups_group_id_fkey" on table "projects_groups"
2018-08-19 16:57:51.747 UTC [71] DETAIL: Key (id)=(1e6efd0c-f032-4857-964e-28bc9a8cf736) is still referenced from table "projects_groups".
2018-08-19 16:57:51.747 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = '6f10727e-4b10-4b6f-9790-77fdf168641a'
2018-08-19 16:57:53.499 UTC [71] ERROR: update or delete on table "role" violates foreign key constraint "users_roles_role_id_fkey" on table "users_roles"
2018-08-19 16:57:53.499 UTC [71] DETAIL: Key (id)=(07879831-629b-46c0-984c-6ba2c9f574c4) is still referenced from table "users_roles".
2018-08-19 16:57:53.499 UTC [71] STATEMENT: DELETE FROM course WHERE course.id = 'a2302d91-09a1-4934-bf80-e09ada1f0468'
^C2018-08-19 19:24:26.225 UTC [1] LOG: received fast shutdown request
2018-08-19 19:24:26.230 UTC [1] LOG: aborting any active transactions
2018-08-19 19:24:26.231 UTC [253] FATAL: terminating connection due to administrator command
2018-08-19 19:24:26.232 UTC [189] FATAL: terminating connection due to administrator command
2018-08-19 19:24:26.235 UTC [188] FATAL: terminating connection due to administrator command