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

Multiple many2many in single struct #3114

Closed
w4-hanggi opened this issue Jul 8, 2020 · 2 comments
Closed

Multiple many2many in single struct #3114

w4-hanggi opened this issue Jul 8, 2020 · 2 comments
Labels

Comments

@w4-hanggi
Copy link

w4-hanggi commented Jul 8, 2020

GORM Playground Link

go-gorm/playground#1

Description

I'm using gorm v0.2.19

type User struct {
	gorm.Model

	RecentlyViewedServices []Service `gorm:"many2many:recently_viewed_services;"`
	FavoriteServices       []Service `gorm:"many2many:favorite_services;"`
}

The first many2many is always ignored, the relation table of 'recently_viewed_services' will not be created.
And association for (Association("RecentlyViewedServices")) will update to FavoriteServices.

Is it a bug?
Or I made some mistakes?

Thank you.

@github-actions github-actions bot added the type:missing reproduction steps missing reproduction steps label Jul 8, 2020
@github-actions
Copy link

github-actions bot commented Jul 8, 2020

This issue has been automatically marked as stale as it missing playground pull request link, checkout https://github.com/go-gorm/playground for details, it will be closed in 2 days if no further activity occurs.

@jinzhu
Copy link
Member

jinzhu commented Jul 9, 2020

@jinzhu jinzhu closed this as completed Jul 9, 2020
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

2 participants