-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MUL unique index always causes field migration #5951
Comments
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
It seems that it cannot be reproduced. |
Since the merger last week this issue has come up again. Should |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
GORM Playground Link
No time to make it for now.
Description
Similar to #5950, the reason is field migration is checking
field.Unique
in this line:gorm/migrator/migrator.go
Line 481 in 7da24d1
For mysql environment,
columnType.Unique
is only true when column_key is equal toUNI
.https://github.com/go-gorm/mysql/blob/7746e77af41571f61e6154eccd46dce1c6da0a1d/migrator.go#L222
But composite indexes' column_key is
MUL
. Therefore it always causes field migration.The text was updated successfully, but these errors were encountered: