Rake posts:reorder_posts 出现 `UniqueViolation` 错误

我不确定你是什么意思。我不确定“small action post”是什么意思,不过如果它是关于分割帖子的,是的,那可能是问题所在。我遇到了这个错误:

PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "post_timings_unique" (PG::UniqueViolation)
DETAIL: Key (topic_id, post_number, user_id)=(54, 2150, 1) already exists.

当我访问这个网址时:

https://[site]/t/[slug]/54/2150

帖子实际上是 2151,并且显示“Split this topic on Dec 11, 2021”。它上面的帖子是 2143,所以我猜 2150 被移到了另一个帖子,并且某个表对它有了错误的引用。

1 个赞