clean up some thingy slightly
This commit is contained in:
parent
70e6b8a03d
commit
675105b900
1 changed files with 6 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue