Where can I find a list of data types that can be used in rails 3? (such as text, string, integer, float, date, etc.?) I keep randomly learning about new ones, but I'd love to have a list I could easily refer to.


Here are all the Rails3 (ActiveRecord migration) datatypes:

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

Source


It is important to know not only the types but the mapping of these types to the database types, too:

enter image description here

enter image description here

For, example, note that in MS SQL Server we are using:

  1. the old "datetime" instead "datetime2"
  2. decimal with its default precision
  3. text and varchar instead nvarchar
  4. int (not possible to use tiny int/small int/big int)
  5. image instead BLOB