-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Newer versions of GORM remove the unique index incorrectly #287
Comments
It's the same issue for me. It is introduced in 1.5.7 and caused by the changes in go-gorm/gorm#6822 |
I had to fallback to:
|
My bad. I wanted to specify gorm.io/gorm v1.25.7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GORM Playground Link
<I have no time for write tests for your "playground" while working at office, sorry. Maybe later>
Description
I use
gorm.io/driver/postgres v1.5.9
,gorm.io/gorm v1.25.11
andgo 1.22.6
in our project.Sample environment:
When I run this code in already initialized before database in older versions of GORM I got this (place
SmthDifferentID
instead ofFIELD
):After researching the issue, it was discovered that I have an existing record:
GORM tries delete the
uni_...
index instead ofidx_...
The text was updated successfully, but these errors were encountered: