From: Justin Hunter Date: Sat, 22 Aug 2009 21:35:09 +0000 (-0700) Subject: add table for reference X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f49a2a4906626dd063b1df769906f189ad4f4ff6;p=dbsrgits%2FSQL-Translator-2.0-ish.git add table for reference --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index a487c3d..ea80e95 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -1,8 +1,16 @@ use MooseX::Declare; class SQL::Translator::Object::Column { use MooseX::Types::Moose qw(ArrayRef Bool HashRef Int Maybe Str); - use SQL::Translator::Types qw(ColumnSize Constraint Trigger); + use MooseX::MultiMethods; + use SQL::Translator::Types qw(ColumnSize Constraint Table Trigger); extends 'SQL::Translator::Object'; + + has 'table' => ( + is => 'rw', + isa => Table, + required => 1, + weak_ref => 1, + ); has 'name' => ( is => 'rw', diff --git a/lib/SQL/Translator/Object/Constraint.pm b/lib/SQL/Translator/Object/Constraint.pm index ed252a8..f5e5c21 100644 --- a/lib/SQL/Translator/Object/Constraint.pm +++ b/lib/SQL/Translator/Object/Constraint.pm @@ -1,9 +1,16 @@ use MooseX::Declare; class SQL::Translator::Object::Constraint { - use MooseX::Types::Moose qw(ArrayRef Bool HashRef Maybe Str); + use MooseX::Types::Moose qw(ArrayRef Bool HashRef Maybe Str Undef); use MooseX::AttributeHelpers; - use SQL::Translator::Types qw(Column); + use SQL::Translator::Types qw(Column Table); extends 'SQL::Translator::Object'; + + has 'table' => ( + is => 'rw', + isa => Table, + required => 1, + weak_ref => 1, + ); has 'name' => ( is => 'rw', diff --git a/lib/SQL/Translator/Object/Index.pm b/lib/SQL/Translator/Object/Index.pm index be3142d..4bfbd69 100644 --- a/lib/SQL/Translator/Object/Index.pm +++ b/lib/SQL/Translator/Object/Index.pm @@ -2,8 +2,15 @@ use MooseX::Declare; class SQL::Translator::Object::Index { use MooseX::Types::Moose qw(ArrayRef HashRef Str); use MooseX::AttributeHelpers; - use SQL::Translator::Types qw(Column); + use SQL::Translator::Types qw(Column Table); extends 'SQL::Translator::Object'; + + has 'table' => ( + is => 'rw', + isa => Table, + required => 1, + weak_ref => 1, + ); has 'name' => ( is => 'rw',