After 1.1.0 upgrade: relation "IDX_repo_unit_S" already exists #501

Closed
opened 2025-11-02 03:25:48 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @rain0r on GitHub (Mar 15, 2017).

  • Gitea version (or commit ref): 1.1.0
  • Git version: 2.12.0
  • Operating system: Gentoo Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

After upgrading to 1.1.0 via Gentoo portage I can't start gitea because of:

2017/03/15 12:27:52 [...itea/routers/init.go:54 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: CreateIndexes RepoUnit: pq: relation "IDX_repo_unit_S" already exists ...

Originally created by @rain0r on GitHub (Mar 15, 2017). - Gitea version (or commit ref): 1.1.0 - Git version: 2.12.0 - Operating system: Gentoo Linux - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description After upgrading to 1.1.0 via Gentoo portage I can't start gitea because of: `2017/03/15 12:27:52 [...itea/routers/init.go:54 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: CreateIndexes RepoUnit: pq: relation "IDX_repo_unit_S" already exists `...
GiteaMirror added the type/question label 2025-11-02 03:25:48 -06:00
Author
Owner

@lunny commented on GitHub (Mar 15, 2017):

Please drop the table repo_unit manually and start again.

@lunny commented on GitHub (Mar 15, 2017): Please drop the table `repo_unit` manually and start again.
Author
Owner

@rain0r commented on GitHub (Mar 22, 2017):

That worked.

@rain0r commented on GitHub (Mar 22, 2017): That worked.
Author
Owner

@strk commented on GitHub (Mar 22, 2017):

@lunny any way to make our migrations immune from this issue ? (might help when people try to migrate from a newer Gogs, for example)

@strk commented on GitHub (Mar 22, 2017): @lunny any way to make our migrations immune from this issue ? (might help when people try to migrate from a newer Gogs, for example)
Author
Owner

@lunny commented on GitHub (Mar 23, 2017):

It's hard to resolve this problem. Many operations cannot be reverted.

@lunny commented on GitHub (Mar 23, 2017): It's hard to resolve this problem. Many operations cannot be reverted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#501