Summary
Code which writes to the CheckUser result tables should write a value for the agent_id column, as the default value of 0 means that the column needs population (as opposed to it's final value)
The populateCheckUserData.php should write an empty User-Agent when populating rows from the recentchanges table, as the default value of 0 means the row needs population (as opposed to it being it's final value)
Background
- T361198: Create a maintenance script to populate the cu_useragent table and agent_id columns with values from the agent columns is creating a maintenance script that populates the agent_id columns in the CheckUser result tables
- This looks for a value of 0 to determine if the column needs populating
- However, the default value of this column is 0 and so populateCheckUserData.php (along with other code that writes to these tables) needs to ensure that the value is set to be the cu_useragent value for an empty user agent
- Updating the CheckUserInsert service was done in T361174: Write to agent_id columns in the CheckUserInsert service when migration configuration allows it which handles most places that data is written to these tables
Acceptance criteria
- All code which writes to the CheckUser result tables populates a value for the agent_id column when the user agent migration is set to write new