Page MenuHomePhabricator

[keyserver] Convert user ID to VARCHAR in MariaDB
ClosedPublic

Authored by ashoat on Mar 26 2023, 7:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 5:27 PM
Unknown Object (File)
Fri, May 10, 5:28 PM
Unknown Object (File)
Apr 14 2024, 7:28 PM
Unknown Object (File)
Apr 14 2024, 7:28 PM
Unknown Object (File)
Apr 14 2024, 7:27 PM
Unknown Object (File)
Apr 14 2024, 7:25 PM
Unknown Object (File)
Apr 3 2024, 4:00 AM
Unknown Object (File)
Mar 5 2024, 11:52 PM
Subscribers
None

Details

Summary

Identity service is going to own user IDs going forward, and they are no longer going to be exclusively numeric.

To pave the way for this, we're converting all user ID columns to VARCHAR(255) in the latin1 charset.

Linear task: https://linear.app/comm/issue/ENG-3279/migrate-mariadb-user-ids-to-varchar-type

Test Plan
  1. I tested by migrating an existing database and creating a new one
  2. I tested creating a new user
  3. I tested logging in an existing user
  4. I tested sending messages
  5. I tested sending / accepting a friend request
  6. I tested unfriending
  7. I tested blocking / unblocking

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
keyserver/src/database/setup-db.js
67 ↗(On Diff #24155)

I wasn't sure if this change would work correctly, as an id is also stored in ids table as a number, but the test plan seems to cover most of the things that might break.

This revision is now accepted and ready to land.Mar 27 2023, 2:20 AM
keyserver/src/database/setup-db.js
67 ↗(On Diff #24155)

For users registered via the new identity service mechanism, we won't be using the ids table at all. We'll only use the ids table for local AUTO_INCREMENT keyserver IDs