in reply to Re^2: Persistence framework for MySQL 4.x (InnoDB)
in thread Persistence framework for MySQL 4.x (InnoDB)

How about:
BUG( id(pk), name ) LEG( id(pk), bug_id(fk), leg_number, length )
and a unique index on (bug_id, leg_number)?

Replies are listed 'Best First'.
Re^4: Persistence framework for MySQL 4.x (InnoDB)
by Anonymous Monk on Nov 01, 2006 at 15:41 UTC
    Why would you ever want to access a leg in without the context of the bug that it comes from? If you don't have a compelling reason to do so, and the leg is not used as the foreign key for another table, then there's no good reason to add the abstract key. You're never going to use it. Don't put it in there.
Re^4: Persistence framework for MySQL 4.x (InnoDB)
by mman (Novice) on Nov 01, 2006 at 14:28 UTC
    I think there's redundancy: leg_number is natural key, and LEG(id) is abstract data. Why you don't like multicolumn pks? Because some frameworks not support them? Is it so hard to code it down? I've taked a took at DBIx::Class. I don't know it yet, but looks promising.