projects
/
dbsrgits/SQL-Translator-2.0-ish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
9479c37
)
hack to make column auto_increment if it is changed to serial (pg)
Justin Hunter [Mon, 16 Nov 2009 19:54:16 +0000 (11:54 -0800)]
lib/SQL/Translator/Object/Column.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/SQL/Translator/Object/Column.pm
b/lib/SQL/Translator/Object/Column.pm
index
616fb08
..
25dfd30
100644
(file)
--- 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' => (