If I am using migrations to build my Db schema, is there any way to generate fixed-length fields for MySQL (i.e. char instead of varchar). I have tried STFW, but have come back with nothing to say that it is possible, but nothing that conclusively states it is impossible.
Why must it be a char field type? surely varchars are just as good, unless it’s a life-or-death situation to making your database as small as possible.
Why must it be a char field type? surely varchars are just as good, unless
it's a life-or-death situation to making your database as small as possible.
<snip>
Hi Ryan
Actually, varchars in mysql will on average use less space than a char field, unless you are maxing out your field length every time. But, varchars infer performance penalties when used as part of an index. From a DB design POV, it is a good idea to minimise the use of varchars.
I worked around, by using execute - works like a charm!