What is the difference between string and text in Rails?

Technology CommunityCategory: Ruby on RailsWhat is the difference between string and text in Rails?
VietMX Staff asked 3 years ago

The difference relies in how the symbol is converted into its respective column type in query language.

:string |                   VARCHAR                | :limit => 1 to 255 (default = 255)  
:text   | TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2 | :limit => 1 to 4294967296 (default = 65536)