[Dbix-class] create_ddl_dir with MySQL / InnoDB
Juan Camacho
jc5826 at gmail.com
Fri Jun 6 19:54:54 BST 2008
On Fri, Jun 6, 2008 at 1:56 PM, Ryan D Johnson <ryandjohnson at gmail.com> wrote:
> "Juan Camacho" <jc5826 at gmail.com> writes:
>
>> On a somewhat separate issue, do you know how I could get the
>> auto_increment added for the primary key in the SQL file? I just
>> noticed it wasn't there.
>
> Did you include ( is_auto_increment => 1 ) in the column definition?
>
> __PACKAGE__->add_columns(
> uid => {
> data_type => 'int',
> is_auto_increment => 1,
> },
> );
>
> The add_columns method, including the is_auto_increment column key is
> documented in the POD for DBIx::Class::ResultSource. Use man or perldoc
> to read the docs.
Thanks for the help.
FYI, up to now I've been using catalyst's DBIC::Schema helper to
statically create/update the various DBIC schema PM files and the
is_auto_increment flag is not automagically added. I probably haven't
had to use that flag since I'm using the PK::Auto component. I should
be able figure out how to get it done automatically -- or manually if
necessary.
Juan
More information about the DBIx-Class
mailing list