Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add notifications to ther userProfileData => user move.
  • Loading branch information
perlDreamer committed Dec 1, 2011
1 parent 3167e24 commit d672c3a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions share/upgrades/7.10.23-8.0.0/moveRequiredProfileFields.pl
Expand Up @@ -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;
Expand All @@ -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` } );
}
Expand Down

0 comments on commit d672c3a

Please sign in to comment.