From: Justin Hunter Date: Tue, 16 Jun 2009 00:12:37 +0000 (-0700) Subject: add index column, since moving to HashRef makes us lose ordering X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f991a2c58bd5f9634b82b58fdbf8d74cb1a8c4c0;p=dbsrgits%2FSQL-Translator-2.0-ish.git add index column, since moving to HashRef makes us lose ordering --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index 2badd35..06b79b1 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -5,47 +5,74 @@ use SQL::Translator::Types qw(Trigger); extends 'SQL::Translator::Object'; has 'name' => ( - is => 'ro', + is => 'rw', isa => Str, required => 1 ); has 'type' => ( - is => 'ro', + is => 'rw', isa => Str, required => 1 ); has 'size' => ( - is => 'ro', + is => 'rw', isa => Int, required => 1 ); has 'is_nullable' => ( - is => 'ro', + is => 'rw', isa => Bool, required => 1, default => 1 ); has 'is_auto_increment' => ( - is => 'ro', + is => 'rw', + isa => Bool, + required => 1, + default => 0 +); + +has 'is_primary_key' => ( + is => 'rw', + isa => Bool, + required => 1, + default => 0 +); + +has 'is_foriegn_key' => ( + is => 'rw', + isa => Bool, + required => 1, + default => 0 +); + +has 'is_unique' => ( + is => 'rw', isa => Bool, required => 1, default => 0 ); has 'default_value' => ( - is => 'ro', + is => 'rw', isa => Str, required => 0 ); has 'trigger' => ( - is => 'ro', + is => 'rw', isa => Trigger, required => 0 ); +has 'index' => ( + is => 'rw', + isa => Int, + required => 1 +); + 1;