Rake posts:reorder_posts gives `UniqueViolation` error

I’m not sure I follow what you mean. I’m not sure what a “small action post” is, although if its a post about splitting topics, yes that could be the problem. I’m getting this error:

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.

When I go to that url:

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

The post is actually 2151, and its says “Split this topic on Dec 11, 2021”. The post immediately above is 2143, so I am guessing 2150 was moved to a different topic, and some table has the wrong reference to it.

1 Like