Added recountTopic{Events|Attachments}() functions
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Skip thumbnails - they aren't attachments.
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Add num_attach on the messages table
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Upgrader sets num_attach per post
Add HAVING num_attach > 0
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Add HAVING num_events > 0
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Added recountMessageAttachments()
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Make that query smaller
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Small query change
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Now that num_attach is in the messages table, we can just use SUM()
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
No need for table alias when there is only 1 table
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Keep the num_events and num_attach up-to-date
Still need to do that admin ones
Not happy with the placement of the calls or the functions themselves but it is a start
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Add some recountMessagesAttachments(), recountTopicsEvents(), recountTopicsAttachments() which do the same as their singular equivalents but for many (or all) topics/messages. Can be useful in moderation or administrative functions
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>
Don't need such large columns
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>