MySQL Column Data Type to Ruby class type (when using ActiveRecord)
For completeness sake, here's a summary of Rails migration types and their MySQL column data types.
Rails Migration Type to MySQL Column Data Type
Rails Migration Symbol | MySQL Data Type |
---|---|
:binary | blob |
:boolean | tinyint(1) |
:date | date |
:datetime | datetime |
:decimal | decimal |
:float | float |
:integer | int(11) |
:string | varchar(255) |
:text | text |
:time | time |
:timestamp | datetime |