现在的 tablename() 设置的自定义表名,是在设置了全局前缀表名之后覆盖的表名。如果我想用前缀和自定义表明,那就只能把前缀也放到 tablename() 函数里才行。 像其他的 orm 是会在获取到自定义表名后再加上全局的自定义前缀。 不知道 gorm 为什么要这样设计?有什么特殊的情况吗?如果这样设计,全局的前缀设置就有些局限性了。
例子: 全局的前缀 'tb_' 一个模型 tablename() 自定义表名 'sys_user' 期望用到的表名是 'tb_sys_user' 但是当前的 gorm 用到的表名是 'sys_user'
自定义表名没有和全局前缀关联起来
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 ✨