From: Justin Hunter Date: Sat, 3 Oct 2009 04:59:10 +0000 (-0700) Subject: coerce HashRefs to Objects X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5605c1db47b377cf5cd9c1eb65142bbe54782c0;p=dbsrgits%2FSQL-Translator-2.0-ish.git coerce HashRefs to Objects --- diff --git a/lib/SQL/Translator/Types.pm b/lib/SQL/Translator/Types.pm index 6c95017..62cd428 100644 --- a/lib/SQL/Translator/Types.pm +++ b/lib/SQL/Translator/Types.pm @@ -21,7 +21,16 @@ class SQL::Translator::Types { class_type Translator, { class => 'SQL::Translator' }; coerce Column, from HashRef, via { SQL::Translator::Object::Column->new($_) }; + 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($_) }; + coerce PrimaryKey, from HashRef, via { SQL::Translator::Object::PrimaryKey->new($_) }; + coerce Procedure, from HashRef, via { SQL::Translator::Object::Procedure->new($_) }; + coerce Schema, from HashRef, via { SQL::Translator::Object::Schema->new($_) }; + coerce Sequence, from HashRef, via { SQL::Translator::Object::Sequence->new($_) }; + coerce Table, from HashRef, via { SQL::Translator::Object::Table->new($_) }; + coerce Trigger, from HashRef, via { SQL::Translator::Object::Trigger->new($_) }; + coerce View, from HashRef, via { SQL::Translator::Object::View->new($_) }; subtype Bit, as Int, where { $_ == 1 || $_ == 0 }; coerce Bit,