Skip to content

fix:table name may not be the same as in the database#41

Open
xiiiew wants to merge 1 commit intoariga:masterfrom
xiiiew:master
Open

fix:table name may not be the same as in the database#41
xiiiew wants to merge 1 commit intoariga:masterfrom
xiiiew:master

Conversation

@xiiiew
Copy link

@xiiiew xiiiew commented Sep 22, 2022

When I use entimport to generate ent code, if the table name in the database ends with s, it will be trimmed. In order to make the generated code consistent with the database, it is recommended not to call this method.

for example, my table name is profit_and_loss, and the generated file name is profit_and_los.go

// old version
func typeName(tableName string) string {
	return inflect.Camelize(inflect.Singularize(tableName))
}

// new version
func typeName(tableName string) string {
	return inflect.Camelize(tableName)
}

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.

1 participant