[Dbix-class] enum column values

kevin montuori montuori at gmail.com
Tue Mar 8 13:08:59 GMT 2011


On Tue, Mar 8, 2011 at 6:33 AM, Dave Howorth <dhoworth at mrc-lmb.cam.ac.uk> wrote:
> I have to connect to a database that is basically stable but where one
> particular ENUM column might have a different set of values when I
> connect to it each time. (I know this is not ideal). I'm looking for the
> least evil way to do this.

> Or perhaps there's a simpler way to do the whole thing?

Oh lord yes.  If you can, make yourself a lookup table and ditch the
enums.  There's a certain glittery appeal to enums when you start a
project ... over time, as your data grow, they become a massive
headache.  (I can tell a story about a 500M row table, MySQL 4, and an
enum change that, once all was said and done, involved a binary edit
of the format file.)

On the other hand, if you can't tweak your schema, I hope someone has
a reasonable answer for you, I'm afraid I don't.


k.

-- 
kevin montuori



More information about the DBIx-Class mailing list