From: Peter Rabbitson Date: Thu, 24 Dec 2009 09:13:37 +0000 (+0000) Subject: Don't call the PK setter if no PK X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=36e9e24fcb3018db6a085d18c9557c9aa6cc4ceb;p=dbsrgits%2FDBIx-Class-Historic.git Don't call the PK setter if no PK --- diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index e760580..705d380 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -112,9 +112,11 @@ sub parse { my $f = $table->add_field(%colinfo) || $dbicschema->throw_exception ($table->error); } - $table->primary_key($source->primary_columns); my @primary = $source->primary_columns; + + $table->primary_key(@primary) if @primary; + my %unique_constraints = $source->unique_constraints; foreach my $uniq (sort keys %unique_constraints) { if (!$source->_compare_relationship_keys($unique_constraints{$uniq}, \@primary)) {