Re: [CDBI] add new columns to a table will break exi sting class?
Matt S Trout <dbix-class-uY5y5/[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
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.