# Problem beim Upgrade: doppelter Schlüsselwert verletzt eindeutige Beschränkung

**URL:** <https://meta.discourse.org/t/problem-in-upgrade-duplicate-key-value-violates-unique-constraint/256826>\
**Category:** Self-hosting\
**Created:** [2. März 2023 um 14:32 UTC](https://meta.discourse.org/t/problem-in-upgrade-duplicate-key-value-violates-unique-constraint/256826 "2023-03-02T14:32:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Arta\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arta_s/32/537495_2.png) [@Arta\_S](https://meta.discourse.org/u/Arta_S)\
**Post date:** [2. März 2023 um 16:06 UTC](https://meta.discourse.org/t/problem-in-upgrade-duplicate-key-value-violates-unique-constraint/256826/3 "2023-03-02T16:06:03Z")

</div>

Soll ich die Zahl durch die Tag-ID ersetzen?

Das bekomme ich bis zu `tags=Tag.where("name like '%ووکامرس%'")`

```plaintext
root@Seven-Forums-app:/var/www/discourse# rails c
[1] pry(main)> tags=Tag.where("name like '%ووکامرس%'")
=> [#<Tag:0x00007f0cef631638
  id: 26,
  name: "ووکامرس",
  created_at: Fri, 27 Jul 2018 07:05:01.048694000 UTC +00:00,
  updated_at: Fri, 27 Jul 2018 07:05:01.048694000 UTC +00:00,
  pm_topic_count: 0,
  target_tag_id: nil,
  description: nil>,
 #<Tag:0x00007f0cef61bfb8
  id: 108,
  name: "حمل-و-نقل-ووکامرس",
  created_at: Thu, 16 May 2019 10:12:19.073070000 UTC +00:00,
  updated_at: Thu, 16 May 2019 10:12:19.073070000 UTC +00:00,
  pm_topic_count: 0,
  target_tag_id: nil,
  description: nil>,
 #<Tag:0x00007f0cef61bef0
  id: 312,
  name: "ووکامرس",
  created_at: Sat, 23 Jan 2021 12:56:26.583839000 UTC +00:00,
  updated_at: Sat, 23 Jan 2021 12:56:26.583839000 UTC +00:00,
  pm_topic_count: 0,
  target_tag_id: nil,
  description: nil>,
 #<Tag:0x00007f0cef61bdd8
  id: 317,
  name: "مشکل-ووکامرس",
  created_at: Wed, 17 Feb 2021 20:32:41.416170000 UTC +00:00,
  updated_at: Wed, 17 Feb 2021 20:32:41.416170000 UTC +00:00,
  pm_topic_count: 0,
  target_tag_id: nil,
  description: nil>]

```

---

_[View the full topic](https://meta.discourse.org/t/problem-in-upgrade-duplicate-key-value-violates-unique-constraint/256826)._
