لقد قمت بنقل منتدى من name.com إلى forum.name.com لكن العملية فشلت:
خطأ: ERROR: duplicate key value violates unique constraint “unique_post_links”
التفاصيل: المفتاح (topic_id, post_id, url)=(246, 813, http://forum.name.com) موجود بالفعل.
تم تطبيق إعادة الربط جزئيًا فقط بسبب الخطأ المذكور أعلاه. يرجى إعادة تشغيل السكربت مرة أخرى.
لذا قمت بتشغيله مرة أخرى (وفشل مرة أخرى)، ثم نفذت أمر rake posts:rebake وفحصت المنتدى فوجدت بعض الحالات التي تحتوي على forum.forum.name.com. (لذا قمت بتنفيذ discourse remap forum.forum.name.com forum.name.com ثم rake posts:rebake لمحاولة إصلاح الأمر - مع بعض النجاح، حيث اضطررت لتغيير بعض الحالات يدويًا).
لدي بعض الأسئلة:
هل أمر discourse remap name.com forum.name.com ينطبق فقط على محتوى المنشورات؟ إذا لم يكن كذلك، هل يجب أن أراجع إعدادات الموقع (Site Settings) فقط للبحث عن المشاكل المحتملة؟
هل يجب تنفيذه ضمن نوع من المعاملات (Transaction)؟ (إذا كان الأمر كذلك، فلم يبدو أنه تم ذلك عندما فشل الأمر لدي).
I’ve checked all site settings and they’re fine (as are themes) and I guess all the above were done - can you see anything that should have been done that wasn’t? Do you think it is safe to continue as is or do you think it needs to be redone from scratch?
Also any ideas why duplicate key value violates unique constraint errors are becoming more frequent on Discourse? I’ve noticed a few topics on this and I think this is the third time I’ve had such an issue myself.
Not from the output, no. We only output tables with changes. No way to know if a table not in the list because it of the error, or simply because there were no instances of name.com in the (not listed) table.
Any ideas what the numbers signify? Number of changes?
What is the recommended way forward now? Fix the unique constraint error then reverse (go from forum.name.com back to name.com, then back again) or do something else?
Edit: done
I entered the app and Rails console then deleted the TopicLink in question then went from forum.name.com back to name.com, then back again.