package SQL::Translator::Producer::MySQL;
# -------------------------------------------------------------------
-# $Id: MySQL.pm,v 1.8 2003-03-04 21:24:12 kycl4rk Exp $
+# $Id: MySQL.pm,v 1.9 2003-03-12 14:17:11 dlc Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
use strict;
use vars qw[ $VERSION $DEBUG ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 1 unless defined $DEBUG;
use Data::Dumper;
+use SQL::Translator::Utils qw(debug);
sub import {
warn "loading " . __PACKAGE__ . "...\n";
my $no_comments = $translator->no_comments;
my $add_drop_table = $translator->add_drop_table;
- debug("Beginning production\n");
+ debug("PKG: Beginning production\n");
my $create;
unless ( $no_comments ) {
}
for my $table ( keys %{ $data } ) {
- debug("Looking at table '$table'\n");
+ debug("PKG: Looking at table '$table'\n");
my $table_data = $data->{$table};
my @fields = sort {
$table_data->{'fields'}->{$a}->{'order'}
#
for (my $i = 0; $i <= $#fields; $i++) {
my $field = $fields[$i];
- debug("Looking at field '$field'\n");
+ debug("PKG: Looking at field '$field'\n");
my $field_data = $table_data->{'fields'}->{$field};
my @fdata = ("", $field);
$create .= "\n";
return $create;
}
-sub debug {
- if ($DEBUG) {
- map { warn "[" . __PACKAGE__ . "] $_" } @_;
- }
-}
-
1;
__END__