I wondered, but now I’m getting the same error on another forum I manage
This is what I get on discourse v1.3.0.beta11 +23
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_topic_users_on_topic_id_and_user_id"
DETAIL: Key (topic_id, user_id)=(1325, 567) already exists.
: INSERT INTO topic_users(user_id, topic_id, notification_level, notifications_reason_id)
SELECT user_id, 1325, 3, 6
FROM category_users
WHERE notification_level = 3
AND category_id = 6
AND NOT EXISTS(SELECT 1 FROM topic_users WHERE topic_id = 1325 AND user_id = category_users.user_id)
)
I get this when I try to approve a post in the Known Issues Category on my other forum.. that forum has no category restrictions at all.
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_topic_users_on_topic_id_and_user_id"
DETAIL: Key (topic_id, user_id)=(1327, 567) already exists.
: INSERT INTO topic_users(user_id, topic_id, notification_level, notifications_reason_id)
SELECT user_id, 1327, 3, 6
FROM category_users
WHERE notification_level = 3
AND category_id = 6
AND NOT EXISTS(SELECT 1 FROM topic_users WHERE topic_id = 1327 AND user_id = category_users.user_id)
)