Revision history for DBIx::Class
+0.05990_03
+ - deploy now adds drop statements before creates
+ - deploy outputs debugging statements if DBIX_CLASS_STORAGE_DBI_DEBUG is set
+
0.05990_02 2006-03-10 13:31:37
- remove test dep on YAML
- additional speed tweaks for C3
$self->throw_exception($@) if $@;
eval "use SQL::Translator::Producer::${type};";
$self->throw_exception($@) if $@;
- my $tr = SQL::Translator->new();
+ my $tr = SQL::Translator->new(
+ # Print debug info
+ debug => 1,
+ # Print Parse::RecDescent trace
+ trace => 0,
+ # Don't include comments in output
+ no_comments => 1,
+ # Print name mutations, conflicts
+ show_warnings => 0,
+ # Add "drop table" statements
+ add_drop_table => 1,
+ # Validate schema object
+ validate => 1,
+ # Make all table names CAPS in producers which support this option
+ format_table_name => sub {my $tablename = shift; return uc($tablename)},
+ );
+
SQL::Translator::Parser::DBIx::Class::parse( $tr, $schema );
return "SQL::Translator::Producer::${type}"->can('produce')->($tr);
}
sub deploy {
my ($self, $schema, $type) = @_;
foreach(split(";\n", $self->deployment_statements($schema, $type))) {
+ $self->debugfh->print("$_\n") if $self->debug;
$self->dbh->do($_) or warn "SQL was:\n $_";
}
}