use Digest::SHA1 for sha1_hex
[dbsrgits/SQL-Translator-2.0-ish.git] / lib / SQL / Translator / Producer / SQL / MySQL.pm
index 84cb9fb..01e9c40 100644 (file)
@@ -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;