Skip to content

Commit

Permalink
No longer require caveat on unique \%options
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair McGowan-Douglas committed Nov 3, 2015
1 parent 5789527 commit 05e063c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/DBIx/Class/ResultSource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ name.
The options hashref will be passed to
L<SQL::Translator::Schema::Constraint/new>; the intention being to
allow the C<deferrable> flag to be set. You should avoid putting
C<name>, C<fields>, or C<type> in here.
allow the C<deferrable> flag to be set, but you may find others
useful. Note that C<name>, C<type>, and C<fields> will be ignored.
Unique constraints are used, for example, when you pass the constraint
name as the C<key> attribute to L<DBIx::Class::ResultSet/find>. Then
Expand Down
2 changes: 1 addition & 1 deletion lib/SQL/Translator/Parser/DBIx/Class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ sub parse {
foreach my $uniq (sort keys %unique_constraints) {
if (!$source->_compare_relationship_keys($unique_constraints{$uniq}, \@primary)) {
$table->add_constraint(
%{ $unique_constraints_extra{$uniq} // {} },
type => 'unique',
name => $uniq,
fields => $unique_constraints{$uniq},
%{ $unique_constraints_extra{$uniq} // {} },
);
}
}
Expand Down

0 comments on commit 05e063c

Please sign in to comment.