Stop using bindFully on collections listing

RESOLVED FIXED in 5.0.6

Status

addons.mozilla.org Graveyard
Collections
RESOLVED FIXED
9 years ago
2 years ago

People

(Reporter: jbalogh, Assigned: jbalogh)

Tracking

unspecified
5.0.6

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
For reasons similar to bug 495512.
(Assignee)

Comment 1

9 years ago
Created attachment 381392 [details] [diff] [review]
 pulling less data for collection listing, denormalizing addonCount

Depends on the patch in bug 495512.
Attachment #381392 - Flags: review?(clouserw)
Attachment #381392 - Flags: review?(clouserw) → review-
Comment on attachment 381392 [details] [diff] [review]
 pulling less data for collection listing, denormalizing addonCount

Binding only users is fine, but I don't like updating the count every time with another query.

Normally we'd use a cron for this stuff but let's try out a trigger and see how we like it:

CREATE TRIGGER collections_update_addon_count AFTER INSERT ON addons_collections FOR EACH ROW
  UPDATE collections SET collections.addonCount = collections.addonCount+1 WHERE collections.id=NEW.collection_id;

works for me.  Also, you'll need to make one for AFTER DELETE.  

_updateAddonCount() might be a handy function to have around, but let's not call it from addAddonToCollection()
(Assignee)

Comment 3

9 years ago
Created attachment 381566 [details]
migration for addonCount column + triggers
(Assignee)

Comment 4

9 years ago
Created attachment 381569 [details] [diff] [review]
pulling less data for collection listing, denormalizing addonCount

Now with more trigger fingers.
Attachment #381392 - Attachment is obsolete: true
Attachment #381569 - Flags: review?(clouserw)
Comment on attachment 381569 [details] [diff] [review]
pulling less data for collection listing, denormalizing addonCount

thanks
Attachment #381569 - Flags: review?(clouserw) → review+
(Assignee)

Comment 6

9 years ago
r27151.  Will need updates on the preview db.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Keywords: push-needed
Resolution: --- → FIXED
removing "push-needed" from 105 AMO 5.0.6 bugs; filter on "I hate stephend!"
Keywords: push-needed
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.