Subject: | SQL::Translator::Parser::DBIx::Class loses auto_increment |
This is easy to fix. Basically, the SQLT parser assumes that the column_info in ResultSource
returns the same fields as used by SQLT. However, DBIC uses auto_increment and SQLT uses
is_auto_increment.
The fix is a two or three line change to make sure is_auto_increment => $column_info->
{auto_increment} when creating the SQLT schema objects.
The work around, in the meantime, is to do something like this when writing a deployment
script:
# HACK!! SQL::Translator::Parser::DBIx::Class does not correctly handle
# auto_increment. This fixes that...
for my $name ($schema->sources) {
my $source = $schema->source($name);
for my $col ($source->columns) {
$source->_columns->{$col}{is_auto_increment}
= $source->_columns->{$col}{auto_increment};
}
}
$schema->deploy({ add_drop_table => 1 });