# שגיאת שדרוג: הגירה היא חוסמת

**URL:** https://meta.discourse.org/t/upgrade-error-migration-is-a-blocker/255099
**Category:** Self-hosting
**Created:** [14 בפברואר,‏ 2023,‏ 1:01pm UTC](https://meta.discourse.org/t/upgrade-error-migration-is-a-blocker/255099 "2023-02-14T13:01:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [14 בפברואר,‏ 2023,‏ 1:01pm UTC](https://meta.discourse.org/t/upgrade-error-migration-is-a-blocker/255099/1 "2023-02-14T13:01:08Z")

</div>

Getting this:

`PG::DuplicateTable: ERROR: relation "index_users_on_username_lower_trgm" already exists`

So build is failing.

This seems to relate to: [discourse/db/migrate/20230201192925\_add\_trigram\_indexes\_to\_users.rb at 14cf8eacf1a679c08ea7df93aff17949d1a9c4df · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/14cf8eacf1a679c08ea7df93aff17949d1a9c4df/db/migrate/20230201192925_add_trigram_indexes_to_users.rb)

Shouldn’t I be able to do this to clear the problem?:

```plaintext
rake db:migrate:down VERSION=20230201192925

```

followed by:

```plaintext
rake db:migrate:up VERSION=20230201192925

```

Unfortunately the latter reproduces the problem, suggesting the down migration does not reset the state?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [14 בפברואר,‏ 2023,‏ 1:18pm UTC](https://meta.discourse.org/t/upgrade-error-migration-is-a-blocker/255099/2 "2023-02-14T13:18:56Z")

</div>

So I did the following to resolve:

```plaintext
cd /var/discourse
./launcher enter app
sudo -u discourse psql
\c discourse
DROP INDEX index_users_on_username_lower_trgm;
exit

```

Then just to be sure:

```plaintext
rake db:migrate:up VERSION=20230201192925

```

which ran successfully this time 🎉

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [16 במרץ,‏ 2023,‏ 1:19pm UTC](https://meta.discourse.org/t/upgrade-error-migration-is-a-blocker/255099/3 "2023-03-16T13:19:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
