我想将我在 postgresql 中的表命名为“fields”和“types”,以便在 rails 4 (ActiveRecord) 应用程序中使用——这些常用词是否可以作为名称接受,或者它们是否会与 rails 或 postgresql 冲突保留名称?
最佳答案
这可能是以下内容的副本:Reserved names with ActiveRecord models
这是关于 postgres 中保留字的附加信息:http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html
最终,答案是否定的,'fields' 不是 rails 或 postgres 的保留名称;但是,“类型”可能会导致一些问题。 Type 是一个 ActionView 方法,符合以下条件:http://api.rubyonrails.org/classes/ActionView/Template.html#method-i-type
关于ruby-on-rails - 'fields' 和 'types' 是否允许用于 rails postgresql 表的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28163105/