On Jul 24, 1:09 pm, Patrick Berkeley <rails-mailing-l…@andreas- s.net> wrote:
How do I add a binary type column with limit option to a MySQL database
with migrations?
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).
On Jul 24, 1:09 pm, Patrick Berkeley <rails-mailing-l…@andreas- s.net> wrote:
How do I add a binary type column with limit option to a MySQL database
with migrations?
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).
That’s good info. I had been writing a custom validation to check the
length. I’m assuming each step up in BLOB type doubles the size. So,
TINYBLOB = 64k, BLOB = 128k, MEDIUMBLOB = 256k, LONGBLOB = 512k. Thanks.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.