Skip to content
Tim edited this page Jun 29, 2015 · 2 revisions

#Active Record - Data Types You might also find it useful to know generally what these data types are used for:

  • :string - is for small data types such as a title. (Should you choose string or text?)
  • :text - is for longer pieces of textual data, such as a paragraph of information
  • :binary - is for storing data such as images, audio, or movies.
  • :boolean - is for storing true or false values.
  • :date - store only the date
  • :datetime - store the date and time into a column.
  • :time - is for time only
  • :timestamp - for storing date and time into a column.(What's the difference between datetime and timestamp?)
  • :decimal - is for decimals (example of how to use decimals).
  • :float - is for decimals. (What's the difference between decimal and float?) - preferable to use floats!
  • :integer - is for whole numbers.
  • :primary_key - unique key that can uniquely identify each row in a table

Clone this wiki locally