When attempting to run my Go application with GORM using the PostgreSQL driver, I encountered the following error:
# gorm.io/driver/postgres
../../../go/pkg/mod/gorm.io/driver/postgres@v1.5.5/migrator.go:411:26: m.GuessConstraintInterfaceAndTable undefined (type Migrator has no field or method GuessConstraintInterfaceAndTable)
Steps to Reproduce: 1. I'm using GORM v1.5.5 with the PostgreSQL driver. 2. Running the application with the command go run main.go triggers the issue.
I expect the application to run without any errors related to the GuessConstraintInterfaceAndTable method.
Comment From: github-actions[bot]
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 Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: mi6e4ka
Hello, I managed to solve the problem by rolling back to the postgres driver version 1.5.4, since 1.5.5 is broken and has already been removed from github
https://github.com/go-gorm/postgres/pull/195
Comment From: dereksangshi2000
Got the same error. Go version: 1.21.6 OS: mac (arm64)
gorm.io/driver/postgres v1.5.5 // indirect gorm.io/gorm v1.25.6 // indirect
m.GuessConstraintInterfaceAndTable undefined (type Migrator has no field or method GuessConstraintInterfaceAndTable)
BTW, Thanks @mi6e4ka for finding the reason.
Comment From: github-actions[bot]
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 Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: jasonchuan
Hello, I managed to solve the problem by rolling back to the postgres driver version 1.5.4, since 1.5.5 is broken and has already been removed from github go-gorm/postgres#195
I resotre it
Comment From: github-actions[bot]
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 Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: iTanken
https://github.com/go-gorm/postgres/issues/247#issuecomment-1928676433
https://go.dev/ref/mod#go-mod-file-exclude
require (
gorm.io/driver/postgres v1.5.4
)
exclude gorm.io/driver/postgres v1.5.5 // This release is a breaking change
Comment From: github-actions[bot]
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 Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: black-06
We have released v1.5.6 and retracted v1.5.5