);
#
-# Column types that do not support lenth attribute
+# Column types that do not support length attribute
#
my @no_length_attr = qw/
date time timestamp datetime year
# Normalize constraint names here.
my $c_name = $c->name;
- # Give the constraint a name if it doesn't have one, so it doens't feel
+ # Give the constraint a name if it doesn't have one, so it doesn't feel
# left out
$c_name = $table->name . '_fk' unless length $c_name;
}
for my $qual ( 'character set', 'collate', 'on update' ) {
my $val = $extra{ $qual } || $extra{ uc $qual } or next;
- $field_def .= " $qual $val";
+ if ( ref $val ) {
+ $field_def .= " $qual ${$val}";
+ }
+ else {
+ $field_def .= " $qual $val";
+ }
}
# Null?
my $reference_table_name = quote_table_name($c->reference_table, $qt);
- my @fields = $c->fields or next;
+ my @fields = $c->fields or return;
if ( $c->type eq PRIMARY_KEY ) {
return 'PRIMARY KEY (' . $qf . join("$qf, $qf", @fields). $qf . ')';
my ($table, $diff_hash, $options) = @_;
# InnoDB has an issue with dropping and re-adding a FK constraint under the
- # name in a single alter statment, see: http://bugs.mysql.com/bug.php?id=13741
+ # name in a single alter statement, see: http://bugs.mysql.com/bug.php?id=13741
#
# We have to work round this.