Skip to content
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

Error in GORM migration: GuessConstraintInterfaceAndTable undefined #6821

Closed
kazimovzaman2 opened this issue Feb 4, 2024 · 9 comments
Closed
Assignees
Labels

Comments

@kazimovzaman2
Copy link

kazimovzaman2 commented Feb 4, 2024

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/[email protected]/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.

@github-actions github-actions bot added the type:missing reproduction steps missing reproduction steps label Feb 4, 2024
Copy link

github-actions bot commented Feb 4, 2024

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.ioSearch Before Asking

@mi6e4ka
Copy link

mi6e4ka commented Feb 4, 2024

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
pr
go-gorm/postgres#195

@dereksangshi2000
Copy link

dereksangshi2000 commented Feb 4, 2024

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.

Copy link

github-actions bot commented Feb 4, 2024

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.ioSearch Before Asking

@jasonchuan
Copy link
Contributor

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 pr go-gorm/postgres#195

I resotre it

Copy link

github-actions bot commented Feb 6, 2024

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.ioSearch Before Asking

@iTanken
Copy link
Contributor

iTanken commented Feb 6, 2024

go-gorm/postgres#247 (comment)

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

Copy link

github-actions bot commented Feb 6, 2024

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.ioSearch Before Asking

@black-06
Copy link
Contributor

black-06 commented Feb 6, 2024

We have released v1.5.6 and retracted v1.5.5

@black-06 black-06 closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants