$mysql_table_type_to_options->($table);
- foreach my $c( $table->get_constraints ) {
+ foreach my $c ( $table->get_constraints ) {
next unless $c->type eq FOREIGN_KEY;
# Normalize constraint names here.
next if $mysql_table_type_to_options->($table);
$table->options( { 'ENGINE' => 'InnoDB' } );
}
+ } # foreach constraints
+
+ foreach my $f ( $table->get_fields ) {
+ my @size = $f->size;
+ if ( !$size[0] && $f->data_type =~ /char$/ ) {
+ $f->size( (255) );
+ }
}
+
}
}
$data_type = 'text';
@size = ();
}
- elsif ( $data_type =~ /char/i && ! $size[0] ) {
- @size = (255);
- }
elsif ( $data_type =~ /boolean/i ) {
$data_type = 'enum';
$commalist = "'0','1'";
data_type => "varchar",
default_value => undef,
is_nullable => 1,
+ size => 255,
},
{
name => "explicitemptystring",
data_type => "varchar",
default_value => "",
is_nullable => 1,
+ size => 255,
},
{
name => "emptytagdef",
default_value => "",
is_nullable => 1,
comments => "Hello emptytagdef",
+ size => 255,
},
{
name => "another_id",