You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow users to customize the naming conventions for type and id columns when working with polymorphic associations in GORM, specifically for types specified using the gorm:"polymorphic" tag.
Motivation
In scenarios where GORM is integrated with a database migrated by another language or framework, the default naming conventions for type and id columns may not align with the existing database schema. The need for customization becomes apparent, especially for types specified using the gorm:"polymorphic" tag.
The current GORM implementation assumes standard names (<type>_id and <type>_type), making it challenging to seamlessly integrate with databases where these conventions differ. To address this, there is a proposal to enhance GORM, allowing individual users to specify custom type and id column names for any type marked with the gorm:"polymorphic" tag. This enhancement ensures that GORM can adapt to diverse database schemas without risking compatibility issues.
Describe the feature
Allow users to customize the naming conventions for type and id columns when working with polymorphic associations in GORM, specifically for types specified using the
gorm:"polymorphic"
tag.Motivation
In scenarios where GORM is integrated with a database migrated by another language or framework, the default naming conventions for type and id columns may not align with the existing database schema. The need for customization becomes apparent, especially for types specified using the
gorm:"polymorphic"
tag.The current GORM implementation assumes standard names (
<type>_id
and<type>_type
), making it challenging to seamlessly integrate with databases where these conventions differ. To address this, there is a proposal to enhance GORM, allowing individual users to specify custom type and id column names for any type marked with thegorm:"polymorphic"
tag. This enhancement ensures that GORM can adapt to diverse database schemas without risking compatibility issues.#6716
The text was updated successfully, but these errors were encountered: