From: Justin Hunter Date: Tue, 11 Aug 2009 02:50:15 +0000 (-0700) Subject: add compat methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=526e74d13172f0bdceb7bf58b3895b5118a756a8;p=dbsrgits%2FSQL-Translator-2.0-ish.git add compat methods --- diff --git a/lib/SQL/Translator/Object/Constraint.pm b/lib/SQL/Translator/Object/Constraint.pm index ef673ea..c61cb79 100644 --- a/lib/SQL/Translator/Object/Constraint.pm +++ b/lib/SQL/Translator/Object/Constraint.pm @@ -1,13 +1,13 @@ use MooseX::Declare; class SQL::Translator::Object::Constraint { - use MooseX::Types::Moose qw(HashRef Str); + use MooseX::Types::Moose qw(HashRef Maybe Str); use MooseX::AttributeHelpers; use SQL::Translator::Types qw(Column); extends 'SQL::Translator::Object'; has 'name' => ( is => 'rw', - isa => Str, + isa => Maybe[Str], required => 1 ); @@ -18,6 +18,7 @@ class SQL::Translator::Object::Constraint { provides => { exists => 'exists_column', keys => 'column_ids', + values => 'get_columns', get => 'get_column', }, curries => { @@ -36,4 +37,7 @@ class SQL::Translator::Object::Constraint { isa => Str, required => 1 ); + + method get_fields { return $self->get_columns } + method fields { return $self->column_ids } }