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

feature: bring custom type and id column name to polymorphism #6716

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

alexisvisco
Copy link
Contributor

@alexisvisco alexisvisco commented Nov 29, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

This pull request enables users to customize the type and id column names for polymorphic associations in GORM.

User Case Description

Before this Pull Request

Previously, polymorphic associations were limited to default naming conventions (<type>_Type and <type>_ID).

After this Pull Request

Users can now specify custom type and id column names for polymorphic associations, offering greater adaptability to diverse database schemas.

close #6717

@jinzhu
Copy link
Member

jinzhu commented Dec 4, 2023

Could you please check these test cases for errors?

@alexisvisco
Copy link
Contributor Author

✅ I forgot updating RunMigrations function, now it's ok :)

@jinzhu jinzhu merged commit a2cac75 into go-gorm:master Dec 15, 2023
34 checks passed
@jinzhu
Copy link
Member

jinzhu commented Dec 15, 2023

Thank you for your pull request. Additionally, please ensure to update the documentation on gorm.io, which can be found at github.com/go-gorm/gorm.io ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allowing Customization of Type and ID Column Names for Polymorphic associations
2 participants