clean up some thingy slightly

This commit is contained in:
Graham Knop 2008-11-06 22:16:22 +00:00
parent 70e6b8a03d
commit 675105b900

View file

@ -11,8 +11,6 @@ package WebGUI::Asset::Wobject::Thingy;
#-------------------------------------------------------------------
use strict;
use warnings;
use version;
use Tie::IxHash;
use JSON;
use WebGUI::International;
@ -1284,19 +1282,20 @@ sub _updateFieldType {
my $thingId = shift;
my $assetId = shift;
my $dbDataType = shift;
my $db = $session->db;
my ($fieldType) = $self->session->db->quickArray("select fieldType from Thingy_fields where fieldId = "
.$self->session->db->quote($fieldId)." and assetId = ".$self->session->db->quote($assetId)
." and thingId = ".$self->session->db->quote($thingId));
.$db->quote($fieldId)." and assetId = ".$db->quote($assetId)
." and thingId = ".$db->quote($thingId));
if($newFieldType ne $fieldType){
my $thingyTableName = "Thingy_".$thingId;
my $columnName = "field_".$fieldId;
$error->info("changing column: $columnName, table: $thingyTableName");
$self->session->db->write(
"ALTER TABLE ".$session->db->dbh->quote_identifier($thingyTableName).
" CHANGE ".$self->session->db->dbh->quote_identifier($columnName)." "
.$session->db->dbh->quote_identifier($columnName)." ".$dbDataType
"ALTER TABLE ".$db->dbh->quote_identifier($thingyTableName).
" CHANGE ".$db->dbh->quote_identifier($columnName)." "
.$db->dbh->quote_identifier($columnName)." ".$dbDataType
);
}
return undef;