X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=DBSchema.pm;h=b821d16ac2383f9a4f4d09d9c4eb9bad12f4b989;hb=e68fd260624a98ae998060abcd0a06e9070ad4a1;hp=95ac6301dc4e7c541caa6e75645e9c961a41dba4;hpb=e76b43f19f34f470799de5f35466419d0c3599f5;p=DBIx-DBSchema.git diff --git a/DBSchema.pm b/DBSchema.pm index 95ac630..b821d16 100644 --- a/DBSchema.pm +++ b/DBSchema.pm @@ -4,14 +4,14 @@ use strict; use vars qw($VERSION $DEBUG $errstr); use Storable; use DBIx::DBSchema::_util qw(_load_driver _dbh); -use DBIx::DBSchema::Table 0.04; +use DBIx::DBSchema::Table 0.05; use DBIx::DBSchema::Index; use DBIx::DBSchema::Column; use DBIx::DBSchema::ColGroup::Unique; use DBIx::DBSchema::ColGroup::Index; -$VERSION = "0.33"; -#$VERSION = eval $VERSION; # modperlstyle: convert the string into a number +$VERSION = "0.34_01"; +$VERSION = eval $VERSION; # modperlstyle: convert the string into a number $DEBUG = 0; @@ -289,7 +289,17 @@ sub sql_update_schema { } - # should eventually drop tables not in $new + # drop tables not in $new + foreach my $table ( $self->tables ) { + + if ( !$new->table($table) ) { + + warn "table $table should be dropped.\n" if $DEBUG; + + push @r, + $self->table($table)->sql_drop_table( $dbh ); + } + } warn join("\n", @r). "\n" if $DEBUG > 1;