mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
empty category_tag_stats table before running init job
This commit is contained in:
parent
2cf40096d1
commit
fdd8ce9722
1 changed files with 2 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
module Jobs
|
||||
class InitCategoryTagStats < Jobs::Onceoff
|
||||
def execute_onceoff(args)
|
||||
CategoryTagStat.exec_sql "DELETE FROM category_tag_stats"
|
||||
|
||||
CategoryTagStat.exec_sql <<~SQL
|
||||
INSERT INTO category_tag_stats (category_id, tag_id, topic_count)
|
||||
SELECT topics.category_id, tags.id, COUNT(topics.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue