[CDBI] add new columns to a table will break exi sting class?

Matt S Trout dbix-class at trout.me.uk
Wed May 24 15:24:05 BST 2006


Perrin Harkins wrote:
> On Wed, 2006-05-24 at 16:24 +0800, pangaoyong wrote:
>> If I add more columns to a table, it will break existing class which
>> already use this table?
> 
> It will if the new column requires a value and doesn't default one.
> 
>> my second question is, could I use class::dbi if a table doesn't have
>> a primary key?
> 
> No, you must have a primary key.

You can often get round this by simply declaring the primary key as a 
composite of all columns - but it's very rare you *really* don't want a 
primary key. Usually lack of a primary key is just shoddy database design.



More information about the ClassDBI mailing list