[Dbix-class] AUTO_INCREMENT missing in generated sql file

Tom Lanyon tom at netspot.com.au
Sun Mar 4 01:17:42 GMT 2007


isaac-dbix at deeproot.co.in wrote:
> I have been trying to generate sql from the schemas using the following
>
>  print $schema->storage->deployment_statements($schema, 'MySQL');
>
> It does generate the sql. The only problem is that the resulting sql
> does not have AUTO_INCREMENT set for the id field(primary key).
>
> The schemas do have the PK::Auto (or  PK::Auto::MySQL) components
> loaded and id column is set as a primary key.
>
> Is there something else that I need to do, in order that the resulting
> sql contains AUTO_IMCREMENT for the id(with primary key) ?
>   
Have you set is_auto_increment true on that column?

package Some::Table::Class;
use base 'DBIx::Class';
__PACKAGE__->add_column( uid => { is_auto_increment => 1 } );


Tom



More information about the Dbix-class mailing list