IntegrityError when deleting a corpus if it has worker activities linked to a DataImport
Sentry Issue: ARKINDEX-BACKEND-C2
ForeignKeyViolation: update or delete on table "dataimport_dataimport" violates foreign key constraint "dataimport_workeract_process_id_96a889da_fk_dataimpor" on table "dataimport_workeractivity"
DETAIL: Key (id)=(9814a826-1134-401a-a4ef-bcf2810514d0) is still referenced from table "dataimport_workeractivity".
File "django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
IntegrityError: update or delete on table "dataimport_dataimport" violates foreign key constraint "dataimport_workeract_process_id_96a889da_fk_dataimpor" on table "dataimport_workeractivity"
DETAIL: Key (id)=(9814a826-1134-401a-a4ef-bcf2810514d0) is still referenced from table "dataimport_workeractivity".
(6 additional frame(s) were not displayed)
...
File "django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)