Page MenuHomePhabricator

Store username instead of user_id for contributions
Closed, ResolvedPublic

Description

Because of the need to export campaign details (as well as showing stats within the app), each contribution should store the actual username instead of the user_id.

This means that we don't need to run separate queries to the users table when generating stats that require usernames of users. This is important for T227515: Create single csv download of all contributions data

  1. Change the column name in the contributions table from 'user_id' to 'username'
  1. Update contribution saving routine to store username instead of id (api/post-contribution route)
  1. Update all other uses of user_id from contributions table to use username directly instead (mostly in the 'campaigns/<id>` route, where we need to convert user ids to usernames (around line 84). This step can now be removed and simply get username directly.

Event Timeline

NavinoEvans triaged this task as Medium priority.Jul 8 2019, 9:47 PM

Change 522197 had a related patch set uploaded (by Eugene233; owner: Eugene233):
[labs/tools/Isa@master] Store username instead of user_id for contributions

https://gerrit.wikimedia.org/r/522197

Change 522197 merged by jenkins-bot:
[labs/tools/Isa@master] Store username instead of user_id for contributions

https://gerrit.wikimedia.org/r/522197

Eugene233 moved this task from Incoming Bugs to Complete (deployed) on the ISA board.