[Dbix-class] create_ddl_dir with MySQL / InnoDB

Ryan D Johnson ryandjohnson at gmail.com
Fri Jun 6 18:56:36 BST 2008


"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.

/rdj




More information about the DBIx-Class mailing list