Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 57193
Status: open
Priority: 0/
Queue: SQL-Translator

Owner: Nobody in particular
Requestors: teohuiming [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: sqlt-graph: a patch to remove blank skipped table nodes
Date: Tue, 4 May 2010 16:44:15 +0800
To: bug-SQL-Translator [...]
From: Teo Hui Ming <teohuiming [...]>
Download (untitled) / with headers
text/plain 1.5k
Hi, As documented in """ skip_tables [..] Note that a skipped table node may still appear if another table has foreign key constraints pointing to the skipped table. If this happens no table field/index information will be included. """ When using --skip-tables (or --skip-tables-like) option in sqlt-graph, a skipped foreign table will still appear as a blank node in the diagram . Often we don't want to see these blank nodes in ER diagrams. In case anyone facing similar issue, here's a quick patch to remove the blank nodes. :-) Apply the patch to SQL::Translator::Producer::GraphViz Index: =================================================================== --- (revision 1689) +++ (working copy) @@ -563,6 +563,15 @@ for my $c ( $table->get_constraints ) { next unless $c->type eq FOREIGN_KEY; my $fk_table = $c->reference_table or next; + + # skip the foreign table if exist in + # 'skip_tables' or 'skip_tables_like' options. + if ( @skip_tables_like or keys %skip_tables ) { + next if $skip_tables{ $fk_table }; + for my $regex ( @skip_tables_like ) { + next if $fk_table =~ $regex; + } + } for my $field_name ( $c->fields ) { for my $fk_field ( $c->reference_fields ) { Cheers, -- Teo Hui Ming
Download (untitled) / with headers
text/plain 139b
Can you resubmit this patch including a way to explicitly enable this functionality e.g. prune_missing_relations => 1 or something. Cheers

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to