Make autoinc PKs show up in GraphViz
Peter Rabbitson [Sun, 27 Feb 2011 15:59:58 +0000 (16:59 +0100)]
Changes
lib/SQL/Translator/Producer/GraphViz.pm

diff --git a/Changes b/Changes
index 3f13aba..0228f43 100644 (file)
--- 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
index 9ddc72d..e92d8b3 100644 (file)
@@ -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;