From: Ken Youens-Clark Date: Tue, 19 Aug 2003 15:43:52 +0000 (+0000) Subject: Added code to print out table comments. X-Git-Tag: v0.04~294 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a11fbaeacd0f444641a938b120be24d4f6a50302;p=dbsrgits%2FSQL-Translator.git Added code to print out table comments. --- diff --git a/lib/SQL/Translator/Producer/HTML.pm b/lib/SQL/Translator/Producer/HTML.pm index 82470a2..d598dc2 100644 --- a/lib/SQL/Translator/Producer/HTML.pm +++ b/lib/SQL/Translator/Producer/HTML.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::HTML; # ------------------------------------------------------------------- -# $Id: HTML.pm,v 1.5 2003-08-14 16:57:17 kycl4rk Exp $ +# $Id: HTML.pm,v 1.6 2003-08-19 15:43:52 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark # @@ -22,8 +22,9 @@ package SQL::Translator::Producer::HTML; use strict; use CGI; +use Data::Dumper; use vars qw[ $VERSION ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(header_comment); @@ -54,7 +55,7 @@ sub produce { for my $table ( $schema->get_tables ) { my $table_name = $table->name or next; my @fields = $table->get_fields or next; - $html .= $q->table( + $html .= $q->table( { -width => '100%' }, $q->Tr( { -bgcolor => 'khaki' }, @@ -63,6 +64,10 @@ sub produce { ) ); + if ( my @comments = $table->comments ) { + $html .= 'Comments:
'.join('
', @comments).'
'; + } + # # Fields #