# ----------------------------------------------------------
#
# ----------------------------------------------------------
+* Add ignore_opts parser arg (to ignore table options) in Parser::MySQL (jgoulah)
* Skip tests for buggy Spreadsheet::ParseExcel versions (rbo)
* Add support for skip tables parser arg in Parser::DBI::MySQL (jgoulah)
* Changed behaviour of ::Producer::Oracle when returning an array of statements to make it compatible to DBI->do()
General Parser Options:
--skip Comma-separated list of tables to skip (only implemented in some parsers)
+ --ignore_opts Comma-separated list of table options to ignore
DBI Parser Options:
my $show_version; # Show version and exit script
my $skip;
my $skiplike;
+my $ignore_opts;
my $producer_db_user; # DSN for producer (e.g. Dumper, ClassDBI)
my $producer_db_password; # db_pass "
my $producer_dsn; # db_user "
'producer-db-pass:s'=> \$producer_db_password,
'skip:s' => \$skip,
'skiplike:s' => \$skiplike,
+ 'ignore_opts:s' => \$ignore_opts,
'add_truncate' => \$add_truncate,
'add-prefix' => \$add_prefix,
'prefix:s' => \$prefix,
db_password => $db_password,
mysql_parser_version => $mysql_parser_version,
skip => $skip,
+ ignore_opts => $ignore_opts,
},
producer_args => {
imap_file => $imap_file,
}
if ( my @options = @{ $tdata->{'table_options'} || [] } ) {
- $table->options( \@options ) or die $table->error;
+ my @cleaned_options;
+ my @ignore_opts = $translator->parser_args->{ignore_opts}?split(/,/,$translator->parser_args->{ignore_opts}):();
+ if (@ignore_opts) {
+ my $ignores = { map { $_ => 1 } @ignore_opts };
+ foreach my $option (@options) {
+ # make sure the option isn't in ignore list
+ my ($option_key) = keys %$option;
+ push(@cleaned_options, $option) unless (exists $ignores->{$option_key});
+ }
+ } else {
+ @cleaned_options = @options;
+ }
+ $table->options( \@cleaned_options ) or die $table->error;
}
for my $cdata ( @{ $tdata->{'constraints'} || [] } ) {