move core profile fields into users table
this change will fix the problems with the userProfileData table being way too big. it also simplifies many basic user search tasks, not needing to join the userProfileData table
This commit is contained in:
parent
f43541c5c9
commit
2c51e6d4fd
15 changed files with 129 additions and 53 deletions
|
|
@ -607,7 +607,7 @@ sub isDuplicate {
|
|||
my $value = shift;
|
||||
my $userId = shift || $session->user->userId;
|
||||
|
||||
my $sql = qq{select count(*) from userProfileData where $fieldId = ? and userId <> ?};
|
||||
my $sql = qq{select count(*) from users join userProfileData using( userId ) where $fieldId = ? and userId <> ?};
|
||||
my $duplicate = $session->db->quickScalar($sql,[$value, $userId]);
|
||||
return ($duplicate > 0);
|
||||
}
|
||||
|
|
@ -918,7 +918,7 @@ sub set {
|
|||
}
|
||||
|
||||
# If the fieldType has changed, modify the userProfileData column
|
||||
if ($properties->{fieldType} ne $originalFieldType) {
|
||||
if ($properties->{fieldType} ne $originalFieldType && !$self->isProtected) {
|
||||
# Create a copy of the new properties so we don't mess them up
|
||||
my $fieldClass = $self->getFormControlClass;
|
||||
eval { WebGUI::Pluggable::load($fieldClass) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue