From: Alastair McGowan-Douglas Date: Tue, 3 Nov 2015 13:29:49 +0000 (+0000) Subject: No longer require caveat on unique \%options X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05e063c83f4d30dd1d1f087e2e7dfd39535c4614;p=dbsrgits%2FDBIx-Class-Historic.git No longer require caveat on unique \%options --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 23be5ea..12eccc1 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 7552496..ba5e75d 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} // {} }, ); } }