# Mislukte upgrade: UniqueViolation: dubbele sleutelwaarde schendt unieke beperking "data\_explorer\_queries\_pkey"

**URL:** <https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667>\
**Category:** Self-hosting\
**Created:** [10 september 2020 om 19:30 UTC](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667 "2020-09-10T19:30:26Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [10 september 2020 om 20:29 UTC](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667/5 "2020-09-10T20:29:08Z")

</div>

Thanks! Not sure why it wasn’t starting the first time I tried.

It looks like I have a duplicate “10” id:

```
4374 | discourse-data-explorer | q:-10 | JSON | {"id":-10,"name":"Inactive Users with no posts","description":"analyze pre-Discourse signups.","sql":"SELECT\
n u.id,\n u.username_lower AS \"username\",\n u.created_at,\n u.last_seen_at\nFROM users u\nWHERE u.active = false\nORDER BY u.id\n","created_by":"-1",
"created_at":null,"group_ids":[],"last_run_at":"2019-10-21T04:03:35.548+00:00"}

4114 | discourse-data-explorer | q:-10 | JSON | {"id":-10,"name":"Inactive Users with no posts","description":"analyze pre-Discourse signups.","sql":"SELECT\
n u.id,\n u.username_lower AS \"username\",\n u.created_at,\n u.last_seen_at\nFROM users u\nWHERE u.active = false\nORDER BY u.id\n","created_by":"-1",
"created_at":null,"last_run_at":"2019-02-27T06:17:48.317+00:00"}

```

So I suppose I should run this:  
~~  
`DELETE from plugin_store_rows WHERE id = 10`~~

or should it be:

~~`DELETE from plugin_store_rows WHERE id = -10`~~

I’m curious - which one will be deleted by the command above - the first one it finds or both?

---

_[View the full topic](https://meta.discourse.org/t/failed-upgrade-uniqueviolation-duplicate-key-value-violates-unique-constraint-data-explorer-queries-pkey/163667)._
