Skip to content

Conversation

shanehou
Copy link

@shanehou shanehou commented Apr 8, 2023

Explain your user case and expected results

Model User has only one field Name, with uniqueIndex tag. First time I run AutoMigrate, GORM will create two unique indexes called idx_users_name and name. Then every time I run AutoMigrate, GORM will create a new unique index called name_2, name_3 and so on.

If I use uniqueIndex:i_u_name to specify the name of the unique index, the first run would still create i_u_name and name indexes, and the following runs would still create name_2, name_3 indexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant