From: Justin Hunter Date: Wed, 19 Aug 2009 09:38:10 +0000 (-0700) Subject: add back compat attributes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b750d2f185523d7425967b675f9dd51ea659ef83;p=dbsrgits%2FSQL-Translator-2.0-ish.git add back compat attributes --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index dde964b..c7f1bb5 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -87,4 +87,7 @@ class SQL::Translator::Object::Column { return wantarray ? @sizes : join ',', @sizes; } + + method order { } + method is_unique { } } diff --git a/lib/SQL/Translator/Object/Constraint.pm b/lib/SQL/Translator/Object/Constraint.pm index c61cb79..3ce6a35 100644 --- a/lib/SQL/Translator/Object/Constraint.pm +++ b/lib/SQL/Translator/Object/Constraint.pm @@ -1,6 +1,6 @@ use MooseX::Declare; class SQL::Translator::Object::Constraint { - use MooseX::Types::Moose qw(HashRef Maybe Str); + use MooseX::Types::Moose qw(ArrayRef Bool HashRef Maybe Str); use MooseX::AttributeHelpers; use SQL::Translator::Types qw(Column); extends 'SQL::Translator::Object'; @@ -38,6 +38,32 @@ class SQL::Translator::Object::Constraint { required => 1 ); + has 'deferrable' => ( + is => 'rw', + isa => Bool, + default => 0 + ); + + has 'expression' => ( + is => 'rw', + isa => Str, + ); + + has 'options' => ( + is => 'rw', + isa => ArrayRef, + auto_deref => 1 + ); + + has 'extra' => ( + is => 'rw', + isa => HashRef, + auto_deref => 1, + ); + method get_fields { return $self->get_columns } method fields { return $self->column_ids } + method field_names { return $self->column_ids } + + method match_type { } } diff --git a/lib/SQL/Translator/Object/Index.pm b/lib/SQL/Translator/Object/Index.pm index d0251b9..d7ac8b5 100644 --- a/lib/SQL/Translator/Object/Index.pm +++ b/lib/SQL/Translator/Object/Index.pm @@ -1,6 +1,6 @@ use MooseX::Declare; class SQL::Translator::Object::Index { - use MooseX::Types::Moose qw(HashRef Str); + use MooseX::Types::Moose qw(ArrayRef HashRef Str); use MooseX::AttributeHelpers; use SQL::Translator::Types qw(Column); extends 'SQL::Translator::Object'; @@ -38,6 +38,18 @@ class SQL::Translator::Object::Index { required => 1 ); + has 'options' => ( + is => 'rw', + isa => ArrayRef, + auto_deref => 1 + ); + + has 'extra' => ( + is => 'rw', + isa => HashRef, + auto_deref => 1, + ); + method get_fields { return $self->get_columns } method fields { return $self->column_ids } } diff --git a/lib/SQL/Translator/Object/Schema.pm b/lib/SQL/Translator/Object/Schema.pm index 178e236..9d2389a 100644 --- a/lib/SQL/Translator/Object/Schema.pm +++ b/lib/SQL/Translator/Object/Schema.pm @@ -97,4 +97,12 @@ class SQL::Translator::Object::Schema { ); method is_valid { 1 } + + method order { } + method perform_action_when { } + method database_events { } + method fields { } + method on_table { } + method action { } + method extra { } } diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index 4ca5c6b..2655c19 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -1,6 +1,6 @@ use MooseX::Declare; class SQL::Translator::Object::Table { - use MooseX::Types::Moose qw(Bool HashRef Maybe Str); + use MooseX::Types::Moose qw(ArrayRef Bool HashRef Maybe Str); use MooseX::AttributeHelpers; use SQL::Translator::Types qw(Column Constraint Index Schema Sequence); use SQL::Translator::Object::Schema; @@ -107,8 +107,17 @@ class SQL::Translator::Object::Table { default => 0 ); + has 'options' => ( + is => 'rw', + isa => ArrayRef, + auto_deref => 1 + ); + method get_fields { return $self->get_columns } + method fields { return $self->column_ids } method primary_key(Str $column) { $self->get_column($column)->is_primary_key(1); } + + method order { } } diff --git a/lib/SQL/Translator/Object/View.pm b/lib/SQL/Translator/Object/View.pm index 625472f..175aed2 100644 --- a/lib/SQL/Translator/Object/View.pm +++ b/lib/SQL/Translator/Object/View.pm @@ -36,4 +36,7 @@ class SQL::Translator::Object::View { isa => Str, required => 1 ); + + method get_fields { return $self->get_columns } + method fields { return $self->column_ids } }