From: Ash Berlin Date: Sat, 1 Nov 2008 21:40:06 +0000 (+0000) Subject: Removed source_db and target_db accessors from Diff (throwback to old version, only... X-Git-Tag: v0.11008~280 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e30b71b8a966efca0b2ba36ec018d0aa4e1110b5;p=dbsrgits%2FSQL-Translator.git Removed source_db and target_db accessors from Diff (throwback to old version, only output_db is used) --- diff --git a/Changes b/Changes index 67f9245..98bba95 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,10 @@ * Added proper argument parsing and documentation to MySQL Parser and Producer (ribasushi) * Using DROP VIEW instead of OR REPLACE clause in the Pg producer, as replace only allows replacement with same number of columns (wreis) * Added support for DROP VIEW and fixed CREATE VIEW statement in the sqlite producer (wreis) +* Removed source_db and target_db accessors from Diff (throwback to old version, only output_db is used) + + +* Support for longer varchar fields in My # ---------------------------------------------------------- # 0.09001 2008-08-19 diff --git a/META.yml b/META.yml index e73af95..5e3eaf6 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- name: SQL-Translator -version: 0.09001 +version: 0.09002 author: - 'Ken Y. Clark ' abstract: SQL DDL transformations and more @@ -42,7 +42,7 @@ provides: file: lib/SQL/Translator/Parser/DB2/Grammar.pm SQL::Translator: file: lib/SQL/Translator.pm - version: 0.09001 + version: 0.09002 SQL::Translator::Diff: file: lib/SQL/Translator/Diff.pm SQL::Translator::Filter::DefaultExtra: diff --git a/lib/SQL/Translator/Diff.pm b/lib/SQL/Translator/Diff.pm index 743c105..9066181 100644 --- a/lib/SQL/Translator/Diff.pm +++ b/lib/SQL/Translator/Diff.pm @@ -13,7 +13,7 @@ use base 'Class::Accessor::Fast'; # Input/option accessors __PACKAGE__->mk_accessors(qw/ ignore_index_names ignore_constraint_names ignore_view_sql - ignore_proc_sql output_db source_schema source_db target_schema target_db + ignore_proc_sql output_db source_schema target_schema case_insensitive no_batch_alters ignore_missing_methods producer_options /); @@ -45,15 +45,14 @@ sub schema_diff { ## _db is the name of the producer/db it came out of/into ## results are formatted to the source preferences - my ($source_schema, $source_db, $target_schema, $target_db, $options) = @_; + my ($source_schema, $source_db, $target_schema, $output_db, $options) = @_; $options ||= {}; my $obj = SQL::Translator::Diff->new( { %$options, source_schema => $source_schema, - source_db => $source_db, target_schema => $target_schema, - target_db => $target_db + output_db => $output_db } ); $obj->compute_differences->produce_diff_sql; @@ -255,8 +254,8 @@ sub produce_diff_sql { } if ( @diffs ) { - if ( $self->target_db !~ /^(?:MySQL|SQLite)$/ ) { - unshift(@diffs, "-- Target database @{[$self->target_db]} is untested/unsupported!!!"); + if ( $self->output_db !~ /^(?:MySQL|SQLite)$/ ) { + unshift(@diffs, "-- Output database @{[$self->output_db]} is untested/unsupported!!!"); } return join '', map { $_ ? "$_;\n\n" : "\n" } ("-- Convert schema '$src_name' to '$tar_name':", @diffs); } diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index 86b32bf..3ce2c38 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -295,7 +295,7 @@ sub produce { }); } - if ($mysql_version > 5.0) { + if ($mysql_version >= 5.000001) { for my $view ( $schema->get_views ) { push @table_defs, create_view($view, { add_replace_view => $add_drop_table,