X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FSchema%2FIndex.pm;h=2a8593e3683a0a5b37db0984204d3a8027d261a1;hb=ea93df61568d8fa52a9764a09c4351928ff9374d;hp=4a71063c04e20a73639f408deef2063b1dfdac14;hpb=11ad2df91bcc0674faa8fb5b6bab52c9e4a73762;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Schema/Index.pm b/lib/SQL/Translator/Schema/Index.pm index 4a71063..2a8593e 100644 --- a/lib/SQL/Translator/Schema/Index.pm +++ b/lib/SQL/Translator/Schema/Index.pm @@ -233,7 +233,7 @@ uppercase. if ( $type ) { $type = uc $type; - return $self->error("Invalid index type: $type") + return $self->error("Invalid index type: $type") unless $VALID_INDEX_TYPE{ $type }; $self->{'type'} = $type; } @@ -258,7 +258,7 @@ Determines if this index is the same as another my $other = shift; my $case_insensitive = shift; my $ignore_index_names = shift; - + return 0 unless $self->SUPER::equals($other); unless ($ignore_index_names) { @@ -269,17 +269,17 @@ Determines if this index is the same as another } #return 0 unless $self->is_valid eq $other->is_valid; return 0 unless $self->type eq $other->type; - + # Check fields, regardless of order - my %otherFields = (); # create a hash of the other fields + my %otherFields = (); # create a hash of the other fields foreach my $otherField ($other->fields) { - $otherField = uc($otherField) if $case_insensitive; - $otherFields{$otherField} = 1; + $otherField = uc($otherField) if $case_insensitive; + $otherFields{$otherField} = 1; } foreach my $selfField ($self->fields) { # check for self fields in hash - $selfField = uc($selfField) if $case_insensitive; - return 0 unless $otherFields{$selfField}; - delete $otherFields{$selfField}; + $selfField = uc($selfField) if $case_insensitive; + return 0 unless $otherFields{$selfField}; + delete $otherFields{$selfField}; } # Check all other fields were accounted for return 0 unless keys %otherFields == 0;