Commit af481ff1 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

helper for remove obsole field

parent 1986d0b2
......@@ -497,6 +497,24 @@ sub _upgrade_table {
return 1;
}
sub _remove_field {
my $self = shift;
my ($table, $field ) = @_;
my $dbh = $CONNECTOR->dbh;
return if $CONNECTOR->dbh->{Driver}{Name} !~ /mysql/i;
my $sth = $dbh->column_info(undef,undef,$table,$field);
my $row = $sth->fetchrow_hashref;
$sth->finish;
return if !$row;
warn "INFO: removing $field to $table\n" if $0 !~ /\.t$/;
$dbh->do("alter table $table drop column $field");
return 1;
}
sub _create_table {
my $self = shift;
my $table = shift;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment