[deploy] Add data update script to backfill public reaction count (#7932)
* Add data update script to backfill public rxn count * Reduce to two transactions instead of three
This commit is contained in:
parent
3b9fe2658e
commit
91b14d7d4b
1 changed files with 8 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
module DataUpdateScripts
|
||||
class UpdatePublicReactionsCountFromPositiveReactionsCount
|
||||
def run
|
||||
ActiveRecord::Base.connection.execute("UPDATE articles SET public_reactions_count = positive_reactions_count, previous_public_reactions_count = previous_positive_reactions_count")
|
||||
ActiveRecord::Base.connection.execute("UPDATE comments SET public_reactions_count = positive_reactions_count")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue