# 復元失敗 - 一意インデックスを作成できませんでした

**URL:** https://meta.discourse.org/t/restore-fails-could-not-create-unique-index/151380
**Category:** Self-hosting
**Created:** [2020 年 5 月 13 日午後 8:29 UTC](https://meta.discourse.org/t/restore-fails-could-not-create-unique-index/151380 "2020-05-13T20:29:04Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Wingtip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wingtip/32/102039_2.png) [@Wingtip](https://meta.discourse.org/u/Wingtip)
#### Post date: [2020 年 5 月 16 日午後 12:44 UTC](https://meta.discourse.org/t/restore-fails-could-not-create-unique-index/151380/9 "2020-05-16T12:44:31Z")

</div>

重複キーの問題も発生しています。公式の修正方法が文書化されていますか？

```plaintext
discourse=# REINDEX SCHEMA CONCURRENTLY public;
    ERROR: could not create unique index "index_incoming_referers_on_path_and_incoming_domain_id_ccnew"
DETAIL: Key (path, incoming_domain_id)=(/search/, 1905) is duplicated.

```

```plaintext

[1] pry(main)> IncomingReferer.where(path: "/m/search")
=> [#<IncomingReferer:0x0000557176d3f210 id: 44231, path: "/m/search", incoming_domain_id: 4>,
 #<IncomingReferer:0x0000557176d925c8 id: 42228, path: "/m/search", incoming_domain_id: 26>]

```

---

_[View the full topic](https://meta.discourse.org/t/restore-fails-could-not-create-unique-index/151380)._
