Page MenuHomePhabricator

[keyserver] Run migration to update thread pinned_counts
ClosedPublic

Authored by rohan on Aug 4 2023, 8:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 26, 12:53 PM
Unknown Object (File)
Mon, Sep 23, 2:20 AM
Unknown Object (File)
Sat, Sep 21, 11:25 PM
Unknown Object (File)
Fri, Sep 20, 8:44 PM
Unknown Object (File)
Fri, Sep 20, 8:44 PM
Unknown Object (File)
Fri, Sep 20, 8:44 PM
Unknown Object (File)
Fri, Sep 20, 8:44 PM
Unknown Object (File)
Wed, Sep 18, 9:02 PM
Subscribers

Details

Summary

Based on the changes made in D8683, we should also run a
safeguard migration to update the threads.pinned_count values to match
the number of messages in the database that are pinned for each thread.

Depends on D8683

Test Plan
  1. Pinned some messages
  2. Set the threads.pinned_count = 0 to emulate a corrupt state that could occur because of this bug (invalid pinned_count value)
  3. Run the query
  4. Ensure that the pinned count values updated

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Aug 4 2023, 8:51 AM
ashoat added inline comments.
keyserver/src/database/migration-config.js
495–505 ↗(On Diff #29546)
  1. You can just return the promise directly
  2. Skip the semicolon unless using multipleStatements: true
This revision is now accepted and ready to land.Aug 4 2023, 8:54 AM