diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 23be5ea36..12eccc1a6 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -728,8 +728,8 @@ name. The options hashref will be passed to L; the intention being to -allow the C flag to be set. You should avoid putting -C, C, or C in here. +allow the C flag to be set, but you may find others +useful. Note that C, C, and C will be ignored. Unique constraints are used, for example, when you pass the constraint name as the C attribute to L. Then diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index 7552496d1..ba5e75d13 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -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} // {} }, ); } }