# FEHLER RecordNotUnique auf Index\_discourse\_solved\_solved\_topics\_on\_answer\_post\_id

**URL:** https://meta.discourse.org/t/error-recordnotunique-on-index-discourse-solved-solved-topics-on-answer-post-id/358875
**Category:** Support
**Tags:** solved
**Created:** [26. März 2025 um 06:39 UTC](https://meta.discourse.org/t/error-recordnotunique-on-index-discourse-solved-solved-topics-on-answer-post-id/358875 "2025-03-26T06:39:29Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [26. März 2025 um 17:04 UTC](https://meta.discourse.org/t/error-recordnotunique-on-index-discourse-solved-solved-topics-on-answer-post-id/358875/8 "2025-03-26T17:04:38Z")

</div>

Scheint mit diesem Patch behoben zu sein:

> <https://github.com/discourse/discourse-solved/commit/1805184cde87d2621f1252612f142f4bbbf03a79>
>
> We are seeing some errors when migrating and adding indexes on \`answer\_post\_id\`.…
> 
> \`\`\`
> \#\<StandardError:"An error has occurred, all later migrations canceled:\\n\\nPG::UniqueViolation: ERROR: could not create unique index \\"index\_discourse\_solved\_solved\_topics\_on\_answer\_post\_id\\"\\nDETAIL: Key (answer\_post\_id)=(13006) is duplicated.\\n"\>
> \`\`\`
> 
> This PR modifies the earlier migration, and also adds one before the addition of indexes to remove duplicates.

---

_[View the full topic](https://meta.discourse.org/t/error-recordnotunique-on-index-discourse-solved-solved-topics-on-answer-post-id/358875)._
