Convert varchar fields to char in the db. Fixes bug #11126

This commit is contained in:
Colin Kuskie 2009-10-14 09:08:01 -07:00
parent b3858ef250
commit 27c1fe9423
2 changed files with 46 additions and 0 deletions

View file

@ -16,6 +16,7 @@
- fixed #11122: Survey icon is missing from admin console
- fixed #11107: linked image with caption
- fixed #10914: Shop: No email notifications sent when the cart has net value 0
- fixed #11126: WebGUI database has varchar fields
7.8.1
- mark $session->datetime->time as deprecated and remove its use from core code

View file

@ -34,6 +34,7 @@ my $session = start(); # this line required
fixTableDefaultCharsets($session);
correctWikiAttachmentPermissions( $session );
transactionsNotifications( $session );
fixBadVarCharColumns ( $session );
finish($session); # this line required
@ -126,6 +127,50 @@ sub transactionsNotifications {
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub fixBadVarCharColumns {
my $session = shift;
print "\tGive all revisionDate columns the correct definition... " unless $quiet;
my @dataSets = (
[ 'AdSku', 'assetId', "CHAR(22) BINARY NOT NULL" ],
[ 'AdSku', 'purchaseTemplate', "CHAR(22) BINARY NOT NULL" ],
[ 'AdSku', 'manageTemplate', "CHAR(22) BINARY NOT NULL" ],
[ 'AdSku', 'adSpace', "CHAR(22) BINARY NOT NULL" ],
[ 'AdSku', 'clickDiscounts', "CHAR(22) DEFAULT NULL" ],
[ 'AdSku', 'impressionDiscounts', "CHAR(22) DEFAULT NULL" ],
[ 'Collaboration', 'replyRichEditor', "CHAR(22) BINARY DEFAULT 'PBrichedit000000000002'" ],
[ 'Collaboration', 'replyFilterCode', "CHAR(30) BINARY DEFAULT 'javascript'" ],
[ 'DataForm', 'htmlAreaRichEditor', "CHAR(22) BINARY DEFAULT '**Use_Default_Editor**'" ],
[ 'MapPoint', 'website', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'address1', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'address2', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'city', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'state', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'zipCode', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'country', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'phone', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'fax', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'MapPoint', 'email', "CHAR(22) BINARY DEFAULT NULL" ],
[ 'Survey', 'onSurveyEndWorkflowId',"CHAR(22) BINARY DEFAULT NULL" ],
[ 'Survey_questionTypes', 'questionType', "CHAR(56) NOT NULL" ],
[ 'bucketLog', 'userId', "CHAR(22) BINARY NOT NULL" ],
[ 'bucketLog', 'Bucket', "CHAR(22) BINARY NOT NULL" ],
[ 'deltaLog', 'userId', "CHAR(22) BINARY NOT NULL" ],
[ 'deltaLog', 'assetId', "CHAR(22) BINARY NOT NULL" ],
[ 'deltaLog', 'url', "CHAR(255) NOT NULL" ],
[ 'passiveAnalyticsStatus', 'userId', "CHAR(255) NOT NULL" ],
[ 'passiveLog', 'url', "CHAR(255) NOT NULL" ],
[ 'passiveLog', 'userId', "CHAR(22) BINARY NOT NULL" ],
[ 'passiveLog', 'assetId', "CHAR(22) BINARY NOT NULL" ],
[ 'passiveLog', 'sessionId', "CHAR(22) BINARY NOT NULL" ],
);
foreach my $dataSet (@dataSets) {
$session->db->write(sprintf "ALTER TABLE `%s` MODIFY COLUMN `%s` %s", @{ $dataSet });
}
print "Done.\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------