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)
Tue, Dec 17, 6:49 AM
Unknown Object (File)
Tue, Dec 17, 6:49 AM
Unknown Object (File)
Tue, Dec 17, 6:48 AM
Unknown Object (File)
Tue, Dec 17, 6:47 AM
Unknown Object (File)
Tue, Dec 10, 6:04 AM
Unknown Object (File)
Sat, Dec 7, 11:42 PM
Unknown Object (File)
Sat, Dec 7, 11:42 PM
Unknown Object (File)
Sat, Dec 7, 11:42 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