X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FSQL%2FMySQL.pm;h=01e9c40d8752f34e382cb0f31b3c9960c0980136;hb=f77b076abfde2eaea012e7aa72ef70788eda94cb;hp=84cb9fb232a4fd36cbbd4f03019d8846822b6847;hpb=f48e6f551a4c6e9afdd8418d13f5a3bab1df72ab;p=dbsrgits%2FSQL-Translator-2.0-ish.git diff --git a/lib/SQL/Translator/Producer/SQL/MySQL.pm b/lib/SQL/Translator/Producer/SQL/MySQL.pm index 84cb9fb..01e9c40 100644 --- a/lib/SQL/Translator/Producer/SQL/MySQL.pm +++ b/lib/SQL/Translator/Producer/SQL/MySQL.pm @@ -131,8 +131,8 @@ role SQL::Translator::Producer::SQL::MySQL { for my $meth (qw/table reference_table/) { my $table = $schema->get_table($c->$meth) || next; # This normalizes the types to ENGINE and returns the value if its there - next if $extra_to_options->($table, 'mysql_table_type', ['ENGINE', 'TYPE']); - $table->options({ 'ENGINE' => 'InnoDB' }); + next if $extra_to_options->($table, 'mysql_table_type', ['ENGINE', 'TYPE']); +# $table->options( [ { ENGINE => 'InnoDB' } ] ); } } # foreach constraints @@ -338,7 +338,7 @@ role SQL::Translator::Producer::SQL::MySQL { my $collate = $table->extra->{'mysql_collate'}; my $union = undef; - for my $t1_option_ref ($table->_options) { + for my $t1_option_ref ($table->options) { my($key, $value) = %{$t1_option_ref}; $table_type_defined = 1 if uc $key eq 'ENGINE' or uc $key eq 'TYPE'; @@ -463,17 +463,16 @@ role SQL::Translator::Producer::SQL::MySQL { # Default? XXX Need better quoting! my $default = $field->default_value; -=cut - if ( defined $default ) { - SQL::Translator::Producer->_apply_default_value( - \$field_def, - $default, - [ - 'NULL' => \'NULL', - ], - ); - } -=cut + +# if ( defined $default ) { +# SQL::Translator::Producer->_apply_default_value( +# \$field_def, +# $default, +# [ +# 'NULL' => \'NULL', +# ], +# ); +# } if ( my $comments = $field->comments ) { $field_def .= qq[ comment '$comments']; @@ -806,6 +805,7 @@ HEADER_COMMENT use constant COLLISION_TAG_LENGTH => 8; method truncate_id_uniquely(Str $desired_name, Int $max_symbol_length) { + use Digest::SHA1 qw(sha1_hex); return $desired_name unless defined $desired_name && length $desired_name > $max_symbol_length;