From: Justin Hunter Date: Thu, 24 Sep 2009 23:58:52 +0000 (-0700) Subject: add is_valid method and a default for type X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e6d96f83365239baaf254385a177e39a4f2c6e3;p=dbsrgits%2FSQL-Translator-2.0-ish.git add is_valid method and a default for type --- diff --git a/lib/SQL/Translator/Object/Index.pm b/lib/SQL/Translator/Object/Index.pm index b22c041..865503a 100644 --- a/lib/SQL/Translator/Object/Index.pm +++ b/lib/SQL/Translator/Object/Index.pm @@ -37,8 +37,11 @@ class SQL::Translator::Object::Index extends SQL::Translator::Object { has 'type' => ( is => 'rw', isa => Str, - required => 1 + required => 1, + default => 'NORMAL', ); around add_column(Column $column) { $self->$orig($column->name, $column) } + + method is_valid { $self->table && scalar $self->get_columns ? 1 : undef } }