From 675105b900c490a62ffc4edec805c5dca0f34877 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 6 Nov 2008 22:16:22 +0000 Subject: [PATCH] clean up some thingy slightly --- lib/WebGUI/Asset/Wobject/Thingy.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index cddf0ee3b..ce58c042f 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -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;