no DEFAULT for mysql, patch from trs@bestpractical, CPAN#58505
[DBIx-DBSchema.git] / DBSchema / DBD / mysql.pm
index c04a3d6..07d341a 100644 (file)
@@ -139,6 +139,15 @@ sub column_callback {
 
   }
 
+  # MySQL no longer supports defaults for text/blob columns
+  if ( $column_obj->type =~ /(TEXT|BLOB)/i
+       and defined $column_obj->default ) {
+
+    # There's no way to unset the default cleanly.
+    # An empty string isn't quite right.
+    $column_obj->{'default'} = undef;
+  }
+
   $hashref;
 
 }