Hello. We use the AutoMigrate() function in our project. But we have a problem with the error: "insufficient arguments". The problem appeared with version 1.25.7. We were forced to roll back to an earlier version 1.25.6.
Our data for example:
// models
type RiverEdge struct {
ParentPortID uint32 `json:"parent_port_id"`
ChildPortID uint32 `json:"child_port_id"`
Cost float64 `json:"cost"`
}
type RiverPort struct {
ID uint32 `json:"id,omitempty"`
Name string `json:"name"`
}
// calling
func Run(db *gorm.DB, riverStore dao.RiverStore) error {
if err := db.AutoMigrate(&model.RiverPort{}, &model.RiverEdge{}); err != nil {
return err // insufficient arguments
}
// other code
}
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: bastianccm
Hi, I am experiencing the same on a postgres DB, it works fine with sqlite. I can't reproduce it yet on the gorm-playground :(
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: bastianccm
Hey, tracked it down, upgrading gorm.io/driver/postgres to v1.5.6 worked for me (it was broken in v1.5.4).
@bearatol can you verify if that fixes it for you too?
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: cylussec
For me, I got it working with the following versions:
gorm.io/driver/postgres v1.5.6
gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde
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: bearatol
@bastianccm Oh, thank you! I'll know that, but I've already changed my solution.
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: Hareis
i have a some problem
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 ✨