Skip to content

Commit

Permalink
Forgot about multi column indexes and names having columns suddenly... (
Browse files Browse the repository at this point in the history
  • Loading branch information
tnosaj authored Apr 14, 2021
1 parent 65be25d commit cd1f1db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/MySQL/Diff/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ sub _parse {

if (/^(KEY|UNIQUE(?: KEY)?)\s+(\S+?)(?:\s+USING\s+(?:BTREE|HASH|RTREE))?\s*\((.*)\)(?:\s+USING\s+(?:BTREE|HASH|RTREE))?$/) {
my ($type, $key, $val) = ($1, $2, $3);
$self->{indices}{$val} = $val;
$self->{unique}{$val} = 1 if($type =~ /unique/i);
debug(4, "got ", defined $self->{unique}{$val} ? 'unique ' : '', "index key '$val': ($val)");
my $indexName = $val;
$indexName =~ tr/,/_/;
$self->{indices}{$indexName} = $val;
$self->{unique}{$indexName} = 1 if($type =~ /unique/i);
debug(4, "got ", defined $self->{unique}{$indexName} ? 'unique ' : '', "index key '$indexName': ($val)");
next;
}

Expand Down

0 comments on commit cd1f1db

Please sign in to comment.