From: Justin Hunter Date: Thu, 28 May 2009 22:00:13 +0000 (-0700) Subject: use SQL::Translator::Types X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eeb819a168d2689b686624e78ff260d36bca16fe;p=dbsrgits%2FSQL-Translator-2.0-ish.git use SQL::Translator::Types --- diff --git a/lib/SQL/Translator/Object/Constraint.pm b/lib/SQL/Translator/Object/Constraint.pm index a604611..6ac6e88 100644 --- a/lib/SQL/Translator/Object/Constraint.pm +++ b/lib/SQL/Translator/Object/Constraint.pm @@ -1,8 +1,9 @@ package SQL::Translator::Object::Constraint; use Moose; +use SQL::Translator::Types; has 'name' => (is => 'ro', isa => 'Str', required => 1); -has 'columns' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Column]', required => 1); +has 'columns' => (is => 'ro', isa => 'ArrayRef[Column]', required => 1); has 'type' => (is => 'ro', isa => 'Str', required => 1); 1; diff --git a/lib/SQL/Translator/Object/Index.pm b/lib/SQL/Translator/Object/Index.pm index 64d3554..4f645a1 100644 --- a/lib/SQL/Translator/Object/Index.pm +++ b/lib/SQL/Translator/Object/Index.pm @@ -1,8 +1,9 @@ package SQL::Translator::Object::Index; use Moose; +use SQL::Translator::Types; has 'name' => (is => 'ro', isa => 'Str', required => 1); -has 'columns' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Column]', required => 1); +has 'columns' => (is => 'ro', isa => 'ArrayRef[Column]', required => 1); has 'type' => (is => 'ro', isa => 'Str', required => 1); 1; diff --git a/lib/SQL/Translator/Object/Procedure.pm b/lib/SQL/Translator/Object/Procedure.pm index d34cc8d..580fee8 100644 --- a/lib/SQL/Translator/Object/Procedure.pm +++ b/lib/SQL/Translator/Object/Procedure.pm @@ -1,4 +1,7 @@ package SQL::Translator::Object::Procedure; use Moose; +has 'name' => (is => 'ro', isa => 'Str', required => 1); +has 'contents' => (is => 'ro', isa => 'Str', required => 1); + 1; diff --git a/lib/SQL/Translator/Object/Schema.pm b/lib/SQL/Translator/Object/Schema.pm index 7c151b9..4668ae0 100644 --- a/lib/SQL/Translator/Object/Schema.pm +++ b/lib/SQL/Translator/Object/Schema.pm @@ -1,8 +1,9 @@ package SQL::Translator::Object::Schema; use Moose; +use SQL::Translator::Types; -has 'tables' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Table]', required => 1); -has 'views' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::View]', required => 0); -has 'procedures' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Procedure]', required => 0); +has 'tables' => (is => 'ro', isa => 'ArrayRef[Table]', required => 1); +has 'views' => (is => 'ro', isa => 'ArrayRef[View]', required => 0); +has 'procedures' => (is => 'ro', isa => 'ArrayRef[Procedure]', required => 0); 1; diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index ac42c6e..4037ff0 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -1,9 +1,10 @@ package SQL::Translator::Object::Table; use Moose; +use SQL::Translator::Types; has 'name' => (is => 'ro', isa => 'Str', required => 1); -has 'columns' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Column]', required => 1); -has 'indexes' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Index]', required => 0); -has 'constraints' => (is => 'ro', isa => 'ArrayRef[SQL::Translator::Object::Constraint]', required => 0); +has 'columns' => (is => 'ro', isa => 'ArrayRef[Column]', required => 1); +has 'indexes' => (is => 'ro', isa => 'ArrayRef[Index]', required => 0); +has 'constraints' => (is => 'ro', isa => 'ArrayRef[Constraint]', required => 0); 1;