Ensures that foreign key relationships and indexes are given
syntactically valid names when their name length exceeds 64 characters
and they contained dot characters within the name. This is most often
relevant when a Postgres table name is fully qualified by including its schema
as part of its name
* optimize gormSourceDir replace
* fmt.Errorf adjust and Optimize for-break
* strings trim
* feat: avoid using the same name field and if..else optimization adjustment
* optimization callbacks/create.go Create func if...else logic
* fix: callbacks/create.go Create func
* fix FileWithLineNum func and add gormSourceDir unit test
* remove debug print and utils_filenum_test.go
* change the method of initializing slice and fixed the length to be specified as 0
* keep the association.go code in the var group
* keep the association.go code in the var group
* change to initializing in var group
* Change NameReplacer to an interface, allowing custom Replacers.
* Add NoLowerCase option to skip the snake_casing of names.
* Move sync.Map from global variable into member of NamingStrategy.
This maintains backward compatibility by making the smap optional - the
NamingStrategy still works if it is nil. gorm.Open activates it by
calling Init() if the given Namer is a schema.NamingStrategy.
Also, this changes the key stored in the smap to be the original name,
instead of the replaced name.
* Refactor NamingStrategy tests to add more assertions about how and when Replacers get called.
* Remove the name cache from NamingStrategy.