| Migration column type... | Converts to MySQL field type... | Available options1 |
| :binary | TINYBLOB, BLOB, MEDIUMBLOB, or LONGBLOB2 | :limit => 1 to 4294967296 (default = 65536)2 |
| :boolean | TINYINT(1) | - |
| :date | DATE | - |
| :datetime | DATETIME | - |
| :decimal | DECIMAL | :precision => 1 to 63 (default = 10) :scale => 0 to 30 (default = 0)3 |
| :float | FLOAT | - |
| :integer | INT | :limit => 1 to 11 (default = 11) |
| :primary_key | INT(11) AUTO_INCREMENT PRIMARY KEY | - |
| :string | VARCHAR | :limit => 1 to 255 (default = 255) |
| :text | TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2 | :limit => 1 to 4294967296 (default = 65536)2 |
| :time | TIME | - |
| :timestamp | DATETIME | - |
Thursday, March 6, 2008
Ruby Rails column type to MySQL datatype
lifted from PackT.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment