[Bast-commits] r7561 -
DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI
rbuels at dev.catalyst.perl.org
rbuels at dev.catalyst.perl.org
Fri Sep 4 17:43:08 GMT 2009
Author: rbuels
Date: 2009-09-04 17:43:08 +0000 (Fri, 04 Sep 2009)
New Revision: 7561
Modified:
DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm
Log:
tweaked pg sequence discovery error message a bit more
Modified: DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-09-04 17:43:00 UTC (rev 7560)
+++ DBIx-Class/0.08/branches/pg_unqualified_schema/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-09-04 17:43:08 UTC (rev 7561)
@@ -80,17 +80,16 @@
EOS
- defined $seq_expr and length $seq_expr
- or $self->throw_exception( "no sequence found for $table.$col, check table definition, "
- . "or explicitly set the 'sequence' for this column in the "
- . $source->source_name
- . " class"
- );
-
- unless ( $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i ){
+ # if no default value is set on the column, or if we can't parse the
+ # default value as a sequence, throw.
+ unless ( defined $seq_expr and $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i ){
$seq_expr = '' unless defined $seq_expr;
- $schema = $schema . "." if defined $schema && length $schema;
- $self->throw_exception("could not parse nextval expression for $schema$table.$col: '$seq_expr'");
+ $schema = "$schema." if defined $schema && length $schema;
+ $self->throw_exception( "no sequence found for $schema$table.$col, check table definition, "
+ . "or explicitly set the 'sequence' for this column in the "
+ . $source->source_name
+ . " class"
+ );
}
return $1;
More information about the Bast-commits
mailing list