Description

定义如下模型:

type VAPID struct {
    ID int
    VAPID string
}

然后调用 AutoMigrate(&VAPID{}) 自动迁移,结果数据库中出现的字段名为为 v_api_d,而非 vapid

可能是 gorm 内部对 api 这个字符串做了特别处理?

附:VAPID 常在 WebPush 中使用,全称 Voluntary Application Server Identification

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: dextercai

type VAPID struct {
    ID int 
    VAPID string `gorm:"column:vapid;" 
}