Migration: Make migration script tolerant of pre-existing indexes #602

Closed
opened 2025-11-02 03:29:38 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @sbrl on GitHub (Apr 1, 2017).

As per the conversation on gitter, the migration script should not error out if the index IDX_repo_unit_S or IDX_repo_unit_created_unix already exists. Here's an error I get during the migration process:

2017/04/01 11:31:11 [...itea/routers/init.go:54 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: CreateIndexes RepoUnit: index IDX_repo_unit_S already exists

Gogs version: 0.10.1.0228

Originally created by @sbrl on GitHub (Apr 1, 2017). As per the conversation on gitter, the migration script should not error out if the index `IDX_repo_unit_S` or `IDX_repo_unit_created_unix` already exists. Here's an error I get during the migration process: ``` 2017/04/01 11:31:11 [...itea/routers/init.go:54 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: CreateIndexes RepoUnit: index IDX_repo_unit_S already exists ``` **Gogs version:** 0.10.1.0228
GiteaMirror added the issue/staleissue/duplicate labels 2025-11-02 03:29:38 -06:00
Author
Owner

@strk commented on GitHub (Apr 1, 2017):

@lunny is there any way to check if an index exist via XORM ?

@strk commented on GitHub (Apr 1, 2017): @lunny is there any way to check if an index exist via XORM ?
Author
Owner

@tboerger commented on GitHub (Apr 1, 2017):

I think this will be fixed with 1.1.1

@tboerger commented on GitHub (Apr 1, 2017): I think this will be fixed with 1.1.1
Author
Owner

@strk commented on GitHub (Apr 1, 2017):

@tboerger you mean it's already fixed in 1.1 branch or do you know of a work in progress ? In either case, do you have links ?

@strk commented on GitHub (Apr 1, 2017): @tboerger you mean it's already fixed in 1.1 branch or do you know of a work in progress ? In either case, do you have links ?
Author
Owner

@sbrl commented on GitHub (Apr 1, 2017):

I'm using GItea 1.1.0, so I don't think it's fixed in the 1.1.x branch.

@sbrl commented on GitHub (Apr 1, 2017): I'm using GItea 1.1.0, so I don't think it's fixed in the 1.1.x branch.
Author
Owner

@strk commented on GitHub (Apr 1, 2017):

release/v1.1 branch is 9 commits ahead of 1.1.0

@strk commented on GitHub (Apr 1, 2017): `release/v1.1` branch is 9 commits ahead of `1.1.0`
Author
Owner

@sbrl commented on GitHub (Apr 1, 2017):

@lunny What's this a duplicate of?

@sbrl commented on GitHub (Apr 1, 2017): @lunny What's this a duplicate of?
Author
Owner

@stale[bot] commented on GitHub (Feb 16, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 16, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Mar 2, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Mar 2, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#602