Subject: | Producer::PostgreSQL: bug with is_auto_increment and size |
Producer::PostgreSQL looks at the size property to determine whether to
output "bigserial" or "serial" for an auto-increment column. If size is
not present for some reason (hint: DBIx::Class::Schema::Loader omits it
for all fixed-size numeric types), then it always outputs "serial", even
if the original column type was "bigint".
Better option is to look for "bigint". Patch provided.
Subject: | perl-SQL-Translator-0.11006-pg-bigserial.patch |
diff -ru SQL-Translator-0.11006-orig/lib/SQL/Translator/Producer/PostgreSQL.pm SQL-Translator-0.11006/lib/SQL/Translator/Producer/PostgreSQL.pm
--- SQL-Translator-0.11006-orig/lib/SQL/Translator/Producer/PostgreSQL.pm 2010-06-03 03:54:59.000000000 -0500
+++ SQL-Translator-0.11006/lib/SQL/Translator/Producer/PostgreSQL.pm 2010-06-15 07:37:47.645976941 -0500
@@ -662,7 +662,7 @@
$data_type = 'character varying';
}
elsif ( $field->is_auto_increment ) {
- if ( defined $size[0] && $size[0] > 11 ) {
+ if ( $data_type eq 'bigint' ) {
$data_type = 'bigserial';
}
else {