From: Justin Hunter Date: Mon, 16 Nov 2009 19:54:16 +0000 (-0800) Subject: hack to make column auto_increment if it is changed to serial (pg) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1bc9e4adcb853516b1a9e150a088af0acbf1645;p=dbsrgits%2FSQL-Translator-2.0-ish.git hack to make column auto_increment if it is changed to serial (pg) --- diff --git a/lib/SQL/Translator/Object/Column.pm b/lib/SQL/Translator/Object/Column.pm index 616fb08..25dfd30 100644 --- a/lib/SQL/Translator/Object/Column.pm +++ b/lib/SQL/Translator/Object/Column.pm @@ -29,6 +29,7 @@ class SQL::Translator::Object::Column extends SQL::Translator::Object is dirty { isa => Str, required => 1, default => '', + trigger => sub { my ($self, $new, $old) = @_; $self->is_auto_increment(1) if $new =~ /^serial$/i; }, ); has 'sql_data_type' => (