X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FMySQL.pm;h=1f8c541d699bb4e07bad8c26df9d0aae9b7d485f;hb=fcc18942e8dfb0eee2391f0ea9a7841b76f94a65;hp=8ec60417f095158f7ada521711271bd3d8d82a31;hpb=b62fa4925be9fc3f0ef0fd32a31ea1ced60696cd;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index 8ec6041..1f8c541 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -156,9 +156,7 @@ sub preprocess_schema { # TYPE is a synonym, but ENGINE is the preferred option name. # - # We have to use the hash directly here since otherwise there is no way - # to remove options. - my $options = ( $table->{options} ||= []); + my $options = $table->options; # If multiple option names, normalize to the first one if (ref $opt_name) { @@ -612,7 +610,12 @@ sub create_field } # Null? - $field_def .= ' NOT NULL' unless $field->is_nullable; + if ( $field->is_nullable ) { + $field_def .= ' NULL'; + } + else { + $field_def .= ' NOT NULL'; + } # Default? SQL::Translator::Producer->_apply_default_value(