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)
Mon, Nov 11, 4:56 PM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:06 AM
Unknown Object (File)
Sat, Oct 19, 5:04 AM
Unknown Object (File)
Sep 28 2024, 9:19 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
No Lint Coverage
Unit
No Test Coverage

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