This diff updates setup-db.js and adds a migration to introduce this new column and a corresponding index. The migration also makes sure to populate the new column, and to clear the existing container column when it populates the new one.
Details
Details
I tested the whole stack with the following steps:
- Ran the migration on a backup of my production keyserver database from September 2023. Confirm that the uploads table has the new column, that it has an index, and that it's populated for all cases where the old column matched a user. Confirm that only 32 rows were updated, which matched the number of users with avatars in a prior query
- Create a brand new database. Confirm that the Confirm that the uploads table has the new column, and that it has an index. Make sure DESCRIBE uploads; matches what it looked like in step 1
- Run the migration on my local multi-keyserver testing database. Make sure I'm still able to log in with an existing user. Confirm I can change the existing user's avatar to a photo and that there are no errors in the logs. Confirm that the avatar is still there if I log out and back in
- On the same database, try creating a new user with a photo avatar and confirm that it works, and that there are no errors in the logs. Confirm that the avatar is still there if I log out and back in
- Ran git grep container in the keyserver folder and reviewed every result to consider whether it needs to be updated
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
keyserver/src/database/migration-config.js | ||
---|---|---|
796 ↗ | (On Diff #40074) | I confirmed that this INNER JOIN makes sure that only rows that have a matching entry in the users table are updated |