# Не удалось восстановить БД

**URL:** <https://meta.discourse.org/t/failed-to-restore-db/131137>\
**Category:** Self-hosting\
**Created:** [16.Октябрь.2019 06:38:28 UTC](https://meta.discourse.org/t/failed-to-restore-db/131137 "2019-10-16T06:38:28Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [16.Октябрь.2019 13:39:25 UTC](https://meta.discourse.org/t/failed-to-restore-db/131137/7 "2019-10-16T13:39:25Z")

</div>

> [@Rasin](#):
>
> Возможно, ошибка заключается в следующем:
> 
> ```plaintext
> PG::UniqueViolation: ERROR: could not create unique index "unique_index_categories_on_slug"
> DETAIL: Key (COALESCE(parent_category_id, '-1'::integer), slug)=(5, ) is duplicated.
> 
> ```

@daniel, я думаю, что в миграции по ссылке [FIX: Add unique index to prevent duplicate slugs for categories · discourse/discourse@c71da3f · GitHub](https://github.com/discourse/discourse/commit/c71da3f3352159f02276c9a49f1ed8c54c75010d) необходимо убедиться, что значения столбца уникальны, прежде чем создавать уникальный индекс.

---

_[View the full topic](https://meta.discourse.org/t/failed-to-restore-db/131137)._
