Skip to content
Permalink
Browse files

Add notifications to ther userProfileData => user move.

  • Loading branch information...
perlDreamer committed Dec 1, 2011
1 parent 3167e24 commit d672c3a221284c166c50c629eea8bccbcba2b9de
Showing with 3 additions and 0 deletions.
  1. +3 −0 share/upgrades/7.10.23-8.0.0/moveRequiredProfileFields.pl
@@ -12,6 +12,7 @@
toolbar uiLevel versionTagMode );

# Create the new columns
report "Creating new columns in the user table";
for my $fieldName ( @fields ) {
my $field = WebGUI::ProfileField->new( session, $fieldName );
my $fieldClass = $field->getFormControlClass;
@@ -21,13 +22,15 @@
}

# Update the table
report "Copying data for all users, this could take a while";
my @pairs = map { q{`users`.`} . $_ . q{`=`userProfileData`.`} . $_ . q{`} } @fields;
session->db->write(
q{ UPDATE `users`,`userProfileData` SET } . join( ", ", @pairs ) .
q{ WHERE `users`.`userId` = `userProfileData`.`userId` }
);

# Drop the old tables
report "Removing old columns";
for my $fieldName ( @fields ) {
session->db->write( qq{ ALTER TABLE userProfileData DROP COLUMN `$fieldName` } );
}

0 comments on commit d672c3a

Please sign in to comment.
You can’t perform that action at this time.