Skip to content

IntegrityError: update or delete on table "auth_user" violates foreign key constraint "emails_historicalemail_history_user_id_596aba09_fk_auth_user_id" on table "emails_historicalemail" #200

Description

@jmduke

Sentry Issue: APPLICATION-BACKEND-AVQ

Traceback (most recent call last):
  File "django/db/backends/base/base.py", line 303, in _commit
    return self.connection.commit()
  File "psycopg/connection.py", line 256, in commit
    self.wait(self._commit_gen())
  File "psycopg/connection.py", line 394, in wait
    return waiting.wait(gen, self.pgconn.socket, interval=interval)
  File "psycopg/waiting.py", line 357, in wait_poll
    s = gen.send(ready)
  File "psycopg/_connection_base.py", line 577, in _commit_gen
    yield from self._exec_command(b"COMMIT")
  File "psycopg/_connection_base.py", line 472, in _exec_command
    raise e.error_from_result(result, encoding=self.pgconn._encoding)
ForeignKeyViolation: update or delete on table "auth_user" violates foreign key constraint "emails_historicalemail_history_user_id_596aba09_fk_auth_user_id" on table "emails_historicalemail"
DETAIL:  Key (id)=(100015407) is still referenced from table "emails_historicalemail".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions