From: Justin Hunter Date: Tue, 21 Jun 2011 18:24:34 +0000 (-0700) Subject: coerce from Column from Str X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a2b38aa4adeb964af8d85510e28205e26449213c;p=dbsrgits%2FSQL-Translator-2.0-ish.git coerce from Column from Str --- diff --git a/lib/SQL/Translator/Types.pm b/lib/SQL/Translator/Types.pm index 143f31b..2fc13f4 100644 --- a/lib/SQL/Translator/Types.pm +++ b/lib/SQL/Translator/Types.pm @@ -25,7 +25,8 @@ class SQL::Translator::Types { class_type Producer, { class => 'SQL::Translator::Producer' }; class_type Translator, { class => 'SQL::Translator' }; - coerce Column, from HashRef, via { SQL::Translator::Object::Column->new($_) }; + coerce Column, from HashRef, via { SQL::Translator::Object::Column->new($_) }, + from Str, via { SQL::Translator::Object::Column->new( name => $_ ) }; coerce Constraint, from HashRef, via { SQL::Translator::Object::Constraint->new($_) }; coerce ForeignKey, from HashRef, via { SQL::Translator::Object::ForeignKey->new($_) }; coerce Index, from HashRef, via { SQL::Translator::Object::Index->new($_) };