Page MenuHomePhabricator

user_newtalk table is missing a primary key
Closed, DuplicatePublic

Description

The [[ https://www.mediawiki.org/wiki/Manual:User_newtalk_table | user_newtalk table]], used to store the IDs or IP addresses of users whose talk pages have been changed, is missing a primary key.

Table definition follows:

--
-- 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*/;

Please add a primary key or unique index to the table.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
OpenNone
DuplicateNone

Event Timeline

TK-999 created this task.Sep 3 2019, 9:53 PM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptSep 3 2019, 9:53 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Looking at the design of this table, it seems that once the actor migration finishes (T167246), it may be possible to replace the user_id / user_ip field duo here with an actor_id reference, which could then naturally serve as a primary key.