Page MenuHomePhabricator

Convert "user_newtalk" table to use actors
Open, Needs TriagePublic

Description

Like other tables formerly did, the user_newtalk table uses 2 different columns to track users, the user_id and the user_ip. These should be combined into a reference to the actor table's actor_id

Current
--
-- Stores notifications of user talk page changes, for the display
-- of the "you have new messages" box
--
CREATE TABLE /*_*/user_newtalk (
  -- Key to user.user_id
  user_id int unsigned NOT NULL default 0,
  -- If the user is an anonymous user their IP address is stored here
  -- since the user_id of 0 is ambiguous
  user_ip varbinary(40) NOT NULL default '',
  -- The highest timestamp of revisions of the talk page viewed
  -- by this user
  user_last_timestamp varbinary(14) NULL default NULL
) /*$wgDBTableOptions*/;
-- Indexes renamed for SQLite in 1.14
CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
Proposed
--
-- Stores notifications of user talk page changes, for the display
-- of the "you have new messages" box
--
CREATE TABLE /*_*/user_newtalk (
  -- Key to actor.actor_id
  un_actor int unsigned NOT NULL default 0,
  -- The highest timestamp of revisions of the talk page viewed
  -- by this user
  user_last_timestamp varbinary(14) NULL default NULL
) /*$wgDBTableOptions*/;

CREATE INDEX /*i*/un_actor ON /*_*/user_newtalk (un_actor)

Changes to user_newtalk table:

  • add un_actor field, and drop user_id & user_ip fields
  • add un_actor index, and drop un_user_id & un_user_ip indexes

un_actor is not a primary key due to the issues with multiple rows laid out in T146585: Add a primary key to user_newtalk

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptNov 12 2019, 11:30 PM
DannyS712 moved this task from Unsorted to Others on the User-DannyS712 board.Nov 12 2019, 11:30 PM

Originally proposed in T167246#5658377, split into a separate task per @Anomie

Graham87 removed a subscriber: Graham87.Nov 13 2019, 1:31 AM
WDoranWMF added a subscriber: WDoranWMF.

Hi @DannyS712, we weren't planning to pick this up but we're happy to scheduling reviewing any patches for it.

WDoranWMF moved this task from Inbox to Icebox on the Platform Engineering board.Nov 20 2019, 3:22 PM
DannyS712 updated the task description. (Show Details)Nov 21 2019, 10:08 PM
DannyS712 updated the task description. (Show Details)Nov 21 2019, 10:13 PM
This comment was removed by DannyS712.
DannyS712 updated the task description. (Show Details)Nov 21 2019, 10:15 PM
DannyS712 moved this task from Unsorted to Change on the Schema-change board.Nov 29 2019, 6:46 AM
DannyS712 updated the task description. (Show Details)Dec 8 2019, 6:35 AM
DannyS712 removed DannyS712 as the assignee of this task.Dec 15 2019, 2:20 AM
Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:01 PM