How do I add a binary type column with limit option to a MySQL database with migrations?
<snip />
Without a limit option! And even though it appears to migrate, the limit in the application definitely does not change.
I use the limit option, and although it does not appear in my schema file, it does change the size of the binary column. I haven't tested to see if it creates an upper bound, but it does change the BLOB type.
The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.
For example, a :limit=>256.kilobyte creates a MEDIUMBLOB instead of a BLOB (default).
If you want an upper bound on length, maybe create a validation in your model? http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M000942
~Rusty