是否有 Rails 列类型的文档? - Is there documentation for the Rails column types?

问题:

I'm looking for more than the simple type listing that is found on this page :我正在寻找的不仅仅是此页面上的简单类型列表:

:primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean

But is there any documentation that actually defines these fields?但是是否有任何文档实际定义了这些字段?

Specifically:具体来说:

  • What's the difference between :string and :text ? :string:text什么区别?
  • Between :float and :decimal ?:float:decimal
  • What are the distinguishing features of :time , :timestamp , and :datetime ? :time , :timestamp:datetime的显着特征是什么?

Are the nuances of these types documented anywhere?这些类型的细微差别是否记录在任何地方?

EDIT: Points of DB-platform implementations are irrelevant to the question I'm trying to ask.编辑: DB 平台实现的要点与我要问的问题无关。 If, say, :datetime does not have a defined intended meaning in Rails documentation, then what do db-adapter-writers go by when choosing a corresponding column type?例如,如果:datetime在 Rails 文档中没有定义的预期含义,那么 db-adapter-writers 在选择相应的列类型时会怎么做?


解决方案:

参考一: https://en.stackoom.com/question/nssq
参考二: https://stackoom.com/question/nssq
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章