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

rename column not working #768

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

rename column not working #768

wants to merge 2 commits into from

Conversation

maxant
Copy link

@maxant maxant commented Oct 22, 2024

Explain your user case and expected results

I have a column in the database named NAME and in the struct I want to call it myName, so I have this struct:

type Organisation2 struct {
    ID    string `gorm:"primaryKey"`
	myName  string `gorm:"column:NAME"` // <<<< THIS SHOULD WORK, BUT ISN'T
}

func (Organisation2) TableName() string {
    return "T_ORGANISATION"
}

but when I read a row, the struct attribute myName is never filled

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