Link Here
|
182 |
my $info = {}; |
182 |
my $info = {}; |
183 |
my $current_table = q{}; |
183 |
my $current_table = q{}; |
184 |
foreach my $line ( @schema_lines ) { |
184 |
foreach my $line ( @schema_lines ) { |
185 |
if( $line =~ /^CREATE TABLE `?(\w+)`?/ ) { |
185 |
if( $line =~ /^CREATE TABLE\s*(?:IF NOT EXISTS)?\s*`?(\w+)`?/ ) { |
186 |
$current_table = $1; |
186 |
$current_table = $1; |
187 |
} elsif( $line =~ /^\s+`?(\w+)`?.*COMMENT ['"](.+)['"][,)]?$/ ) { |
187 |
} elsif( $current_table && $line =~ /^\s+`?(\w+)`?.*COMMENT ['"](.+)['"][,)]?$/ ) { |
188 |
my ( $col, $comment ) = ( $1, $2 ); |
188 |
my ( $col, $comment ) = ( $1, $2 ); |
189 |
$comment =~ s/''/'/g; # we call quote later on |
189 |
$comment =~ s/''/'/g; # we call quote later on |
190 |
$info->{$current_table}->{$col} = $comment; |
190 |
$info->{$current_table}->{$col} = $comment; |
191 |
- |
|
|