You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 3, 2026. It is now read-only.
Can't delete a project due to a foreign key constraint.
Usually all project data can be deleted running: mapswipe_workers --verbose delete --project-ids '["a", "b"]'
However this is not working when mapping has happened already.
expected behaviour:
all project data in all tables should be removed (in firebase and postgres)
Traceback (most recent call last):
File "/usr/local/bin/mapswipe_workers", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/mapswipe_workers/mapswipe_workers.py", line 462, in run_delete_project
if delete_project.delete_project(project_ids):
File "/usr/local/lib/python3.8/dist-packages/mapswipe_workers/firebase_to_postgres/delete_project.py", line 103, in delete_project
project.delete_from_postgres(project_id)
File "/usr/local/lib/python3.8/dist-packages/mapswipe_workers/project_types/project.py", line 587, in delete_from_postgres
p_con.query(sql_query, {"project_id": project_id})
File "/usr/local/lib/python3.8/dist-packages/mapswipe_workers/auth.py", line 74, in query
self._db_cur.execute(query, data)
psycopg2.errors.ForeignKeyViolation: update or delete on table "mapping_sessions" violates foreign key constraint "mapping_sessions_user_groups_mapping_session_id_fkey" on table "mapping_sessions_user_groups"
DETAIL: Key (mapping_session_id)=(4751127) is still referenced from table "mapping_sessions_user_groups".
Activity