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
|
|
@ -163,11 +163,11 @@ sub getSql {
|
|||
return <<END_SQL;
|
||||
select
|
||||
r.Survey_responseId, r.username, r.userId, r.startDate,
|
||||
upd.email, upd.firstName, upd.lastName,
|
||||
u.email, u.firstName, u.lastName,
|
||||
s.timeLimit, s.doAfterTimeLimit,
|
||||
ad.title, ad.url
|
||||
from
|
||||
Survey_response r left outer join userProfileData upd on r.userId = upd.userId, Survey s, assetData ad
|
||||
Survey_response r left outer join users u on r.userId = u.userId, Survey s, assetData ad
|
||||
where
|
||||
r.isComplete = 0
|
||||
and s.timeLimit > 0
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ sub execute {
|
|||
SELECT email, count(distinct(tagId)) AS count
|
||||
FROM assetVersionTag
|
||||
JOIN assetData USING (tagId)
|
||||
JOIN userProfileData ON assetVersionTag.createdBy = userProfileData.userId
|
||||
JOIN users ON assetVersionTag.createdBy = users.userId
|
||||
WHERE isCommitted = 0
|
||||
AND DATE_ADD(FROM_UNIXTIME(creationDate), INTERVAL $daysLeftOpen DAY) < NOW()
|
||||
GROUP BY userId
|
||||
|
|
@ -108,7 +108,7 @@ sub _notify {
|
|||
my $i18n = shift;
|
||||
|
||||
my $hostname = $self->session->config->get('sitename')->[0];
|
||||
my($from) = $self->session->db->quickScalar(" SELECT email FROM userProfileData WHERE userId = 3 ");
|
||||
my($from) = $self->session->db->quickScalar(" SELECT email FROM users WHERE userId = 3 ");
|
||||
|
||||
my $s = $dataHashRef->{count} > 1 ? 's' : '';
|
||||
my $subject = sprintf($i18n->get('email subject'), $s, $hostname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue