لقد حاولت تحديث منتدى Discourse إلى أحدث إصدار 2.2.0.beta5 على بيئة الاختبار، لكن العملية فشلت.
الخطأ هو:
I, INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
StandardError: حدث خطأ ما، وقد تم إلغاء هذه الهجرة وجميع الهجرات اللاحقة:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_polls_on_post_id_and_name"
DETAIL: Key (post_id, name)=(662593, poll) already exists.
لقد قمت بتسجيل الدخول إلى قاعدة بيانات PostgreSQL وتحققت من عدم وجود أي قيم في جدول polls، لذا فمن الغريب سبب ظهور خطأ يقول: “Key (post_id, name)=(662593, poll) already exists.”:
=> SELECT * FROM polls;
id | post_id | name | close_at | type | status | results | visibility | min | max | step | anonymous_voters | created_at | updated_at
----±--------±-----±---------±-----±-------±--------±-----------±----±----±-----±-----------------±-----------±-----------
(0 rows)
Can someone from development team take a look to this question ?
We are blocked with update of Discourse forum to the latest version, because of this error.
And also we cannot install additional plugin, as docker container is not compiled and as a result is not running.
It turns out that the problem was that the poll had been duplicated in a quote block, and the migration didn’t know to ignore it. It was in a PM, apparently as an example of how polls worked. I deleted the duplicate and the migration ran fine.