-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Description
GORM Playground Link
Description
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.