=head1 DESCRIPTION
-Creates a POD description of each table, field, index, and constraint.
-A good starting point for text documentation of a schema. You can
-easily convert the output to HTML or text using "perldoc" or other
+Creates a POD description of each table, field, index, and constraint.
+A good starting point for text documentation of a schema. You can
+easily convert the output to HTML or text using "perldoc" or other
interesting formats using Pod::POM or Template::Toolkit's POD plugin.
=cut
use strict;
-use vars qw[ $VERSION ];
-$VERSION = '1.59';
+use warnings;
+our $VERSION = '1.59';
use SQL::Translator::Schema::Constants;
use SQL::Translator::Utils qw(header_comment);
-# -------------------------------------------------------------------
sub produce {
my $t = shift;
my $schema = $t->schema;
$pod .= "=head3 INDICES\n\n";
for my $index ( @indices ) {
$pod .= "=head4 " . $index->type . "\n\n=over 4\n\n";
- $pod .= "=item * Fields = " .
+ $pod .= "=item * Fields = " .
join(', ', $index->fields ) . "\n\n";
$pod .= "=back\n\n";
}
$pod .= "=head3 CONSTRAINTS\n\n";
for my $c ( @constraints ) {
$pod .= "=head4 " . $c->type . "\n\n=over 4\n\n";
- $pod .= "=item * Fields = " .
+ $pod .= "=item * Fields = " .
join(', ', $c->fields ) . "\n\n";
if ( $c->type eq FOREIGN_KEY ) {
- $pod .= "=item * Reference Table = L</" .
+ $pod .= "=item * Reference Table = L</" .
$c->reference_table . ">\n\n";
- $pod .= "=item * Reference Fields = " .
- join(', ', map {"L</$_>"} $c->reference_fields ) .
+ $pod .= "=item * Reference Fields = " .
+ join(', ', map {"L</$_>"} $c->reference_fields ) .
"\n\n";
}