go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
90 stars 688 forks source link

Unexpected TableName parsing behaviour #648

Open eliaSchenker opened 1 year ago

eliaSchenker commented 1 year ago

Explain your user case and expected results

Table names containing some of the predefined abbrevations of the NamingStrategy: https://github.com/go-gorm/gorm/blob/e57e5d8884d801caa4ce0307bcd081f7e889e514/schema/naming.go#L109

will result in them being parsed incorrectly. For example the struct name FBIPassport should become fbi_passports, but as it contains IP it will be incorrectly parsed to fb_ipassports.