From 9bfaf8ed706999cb345c146817db0c005687b272 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 29 Jan 2014 15:40:35 -0800 Subject: [PATCH] no DEFAULT for mysql, patch from trs@bestpractical, CPAN#58505 --- DBSchema/DBD/mysql.pm | 9 +++++++++ MANIFEST | 1 + 2 files changed, 10 insertions(+) diff --git a/DBSchema/DBD/mysql.pm b/DBSchema/DBD/mysql.pm index c04a3d6..07d341a 100644 --- a/DBSchema/DBD/mysql.pm +++ b/DBSchema/DBD/mysql.pm @@ -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; } diff --git a/MANIFEST b/MANIFEST index f2e6e95..8b4d99e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -21,3 +21,4 @@ t/load-pg.t t/load-sqlite.t t/load-sybase.t t/load.t +t/mysql-text-default.t -- 2.11.0