remove some unnecessary code
[dbsrgits/SQL-Translator-2.0-ish.git] / lib / SQL / Translator / Producer / SQL / MySQL.pm
index 84cb9fb..2690f72 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
     
@@ -253,13 +253,10 @@ role SQL::Translator::Producer::SQL::MySQL {
         if( my $sql = $view->sql ){
           $create .= " AS (\n    ${sql}\n  )";
         }
-    #    $create .= "";
         return $create;
     }
     
     method create_table($table, $options) {
-#        my ($table, $options) = @_;
-    
         my $qt = $options->{quote_table_names} || '';
         my $qf = $options->{quote_field_names} || '';
     
@@ -338,7 +335,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 +460,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 +802,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;