Or like so:
- cluster => [
+ cluster => [
{ name => 'cluster1', tables => [ 'table1', 'table2' ] },
{ name => 'cluster2', tables => [ 'table3', 'table4' ] },
]
=item * output_type (DEFAULT: 'png')
-This determines which
-L<output method|GraphViz/as_canon,_as_text,_as_gif_etc._methods>
+This determines which
+L<output method|GraphViz/as_canon, as_text, as_gif etc. methods>
will be invoked to generate the graph: C<png> translates to
C<as_png>, C<ps> to C<as_ps> and so on.
=item * fontname
-This sets the global font name (or full path to font file) for
+This sets the global font name (or full path to font file) for
node, edge, and graph labels
=item * fontsize
=item * show_fields (DEFAULT: true)
-If set to a true value, the names of the colums in a table will
+If set to a true value, the names of the columns in a table will
be displayed in each table's node
=item * show_fk_only
use SQL::Translator::Utils qw(debug);
use Scalar::Util qw/openhandle/;
-use vars qw[ $VERSION $DEBUG ];
-$VERSION = '1.59';
+our $DEBUG;
+our $VERSION = '1.60';
$DEBUG = 0 unless defined $DEBUG;
sub produce {
);
# join_pk_only/skip_fields implies natural_join
- $args->{natural_join} = 1
+ $args->{natural_join} = 1
if ($args->{join_pk_only} or scalar keys %skip_fields);
# usually we do not want direction when using natural join
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;
push @fmt_indexes, join (' ',
'*',
$args->{show_index_names}
- ? $index->name . ':'
+ ? $index->name . ':'
: ()
,
join (', ', $index->fields),
debug("Processing table '$table_name'");
- debug("Fields = ", join(', ', map { $_->name } @fields));
+ debug("Fields = ", join(', ', map { $_->name } @fields)) if $DEBUG;
for my $f ( @fields ) {
my $name = $f->name or next;
1;
-# -------------------------------------------------------------------
-
=pod
=head1 AUTHOR