From: Peter Rabbitson Date: Sun, 27 Feb 2011 15:59:58 +0000 (+0100) Subject: Make autoinc PKs show up in GraphViz X-Git-Tag: v0.11008~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4426fb843b45e91eb45ea7899e410fe932aa3c2d;p=dbsrgits%2FSQL-Translator.git Make autoinc PKs show up in GraphViz --- diff --git a/Changes b/Changes index 3f13aba..0228f43 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ * Correct postgis geography type insertion and linebreak fix for multiple geometry/geography columns * made PostgreSQL producer consistent with other producers in terms of quoting and allowing functions in constraints and indices +* Add distinction of autoinc and regular primary keys to the GraphViz producer # ---------------------------------------------------------- # 0.11007 2010-11-30 diff --git a/lib/SQL/Translator/Producer/GraphViz.pm b/lib/SQL/Translator/Producer/GraphViz.pm index 9ddc72d..e92d8b3 100644 --- a/lib/SQL/Translator/Producer/GraphViz.pm +++ b/lib/SQL/Translator/Producer/GraphViz.pm @@ -448,7 +448,7 @@ sub produce { my $constraints; if ($args->{show_constraints}) { my @constraints; - push(@constraints, 'PK') if $field->is_primary_key; + push(@constraints, $field->is_auto_increment ? 'PA' : 'PK') if $field->is_primary_key; push(@constraints, 'FK') if $field->is_foreign_key; push(@constraints, 'U') if $field->is_unique; push(@constraints, 'N') if $field->is_nullable;