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

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

WDoranWMF subscribed.

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

This comment was removed by DannyS712.