mysql字段名与rails保留字冲突

jztan 2007-10-22 08:40:13
This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Info.inheritance_column to use another column for that information.

Extracted source (around line #153):

mysql字段名是rails的保留字,在不改字段名的情况下但find中又要引用怎么办?试了对字段加[]或对字段加表名也不行
...全文
199 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhongmao 2007-11-01
  • 打赏
  • 举报
回复
mysql中用`(tab键上面的那个)来转义关键字


eg.
select `mysql` from yourtable
python二级题库 2007-10-25
  • 打赏
  • 举报
回复
改字段好了,免得出问题。

2,763

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ruby/Rails
社区管理员
  • Ruby/Rails社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧