我触发了用户的帖子删除。
由于帖子没有被删除,我查看了 sidekiq 和 /logs。删除过程返回了一个错误:
Job exception: PG::ForeignKeyViolation: ERROR: update or delete on table "reviewables" violates foreign key constraint "fk_rails_2fe5fa5cd0" on table "reviewable_notes"
DETAIL: Key (id)=(7870) is still referenced from table "reviewable_notes".
这个可审阅项(reviewable item)是在 15 天前被批准的,并且确实有三条笔记(notes)附加在它上面。
创建标记(flag)ID 为 7870 的用户也是我正试图删除其帖子的用户,我猜这就是问题所在。
但是我现在该怎么做才能消除这个错误并删除该用户的帐户呢?