# Unable to install Discourse Question Answer: ON CONFLICT DO NOTHING

**URL:** https://meta.discourse.org/t/unable-to-install-discourse-question-answer-on-conflict-do-nothing/238128
**Category:** Self-hosting
**Tags:** post-voting
**Created:** [September 5, 2022, 7:10am UTC](https://meta.discourse.org/t/unable-to-install-discourse-question-answer-on-conflict-do-nothing/238128 "2022-09-05T07:10:51Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [September 5, 2022, 11:53am UTC](https://meta.discourse.org/t/unable-to-install-discourse-question-answer-on-conflict-do-nothing/238128/4 "2022-09-05T11:53:18Z")

</div>

It’s looking like there’s an issue with the ‘vote\_history’ field:

```plaintext
I, [2022-09-05T19:39:21.422820 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2022-09-05 19:39:34.506 CST [819] discourse@discourse ERROR: cannot extract elements from a scalar
2022-09-05 19:39:34.506 CST [819] discourse@discourse STATEMENT: INSERT INTO question_answer_votes (post_id, user_id, created_at)
        SELECT
          X.post_id AS post_id,
          (X.value->>'user_id')::int AS user_id,
          (X.value->>'created_at')::timestamp AS created_at
        FROM (
          SELECT
            post_id,
            jsonb_array_elements(value::jsonb) AS value
          FROM post_custom_fields WHERE name = 'vote_history'
        ) AS X
        WHERE (X.value->>'action') != 'destroy'
        ORDER BY (X.value->>'created_at')::timestamp DESC
        ON CONFLICT DO NOTHING

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

```

There was another report of a similar error recently - [Bootstrap failed with exit code 1](https://meta.discourse.org/t/bootstrap-failed-with-exit-code-1/237270) Though no solution posted there yet.

Perhaps this is a conflict with having previously installed the Pavilion plugin? @Hifihedgehog, did your site also previously have that installed too?

---

_[View the full topic](https://meta.discourse.org/t/unable-to-install-discourse-question-answer-on-conflict-do-nothing/238128)._
