Page MenuHomePhabricator

Create "echo_unread_wikis" table on wikishared database for Echo cross-wiki notifications
Closed, ResolvedPublic

Description

Code change: rECHOb85f978ddd2f: Track what wikis a user has unread notifications on / https://gerrit.wikimedia.org/r/#/c/248905/

This table keeps track of of a user's last unread notifications across all wikis for easy aggregate access. This is a global table, so it will be on the wikishared database.

Schema:

CREATE TABLE /*_*/echo_unread_wikis (
	# Primary key
	euw_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
	# Global user id
	euw_user INT UNSIGNED NOT NULL,
	# Name of wiki
	euw_wiki VARCHAR(30) NOT NULL,
	# unread alerts count on that wiki
	euw_alerts INT UNSIGNED NOT NULL,
	# Timestamp of the most recent unread alert
	euw_alerts_ts BINARY(14) NOT NULL,
	# unread messages count on that wiki
	euw_messages INT UNSIGNED NOT NULL,
	# Timestamp of the most recent unread message
	euw_messages_ts BINARY(14) NOT NULL
) /*$wgDBTableOptions*/;

CREATE UNIQUE INDEX /*i*/echo_unread_wikis_user_wiki ON /*_*/echo_unread_wikis (euw_user,euw_wiki);

See also: T119522: Set up and enable cross-wiki Echo database backend on beta cluster

Event Timeline

Legoktm created this task.Nov 24 2015, 5:31 PM
Legoktm raised the priority of this task from to Normal.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: jcrespo, Legoktm, Catrope.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 24 2015, 5:31 PM

Just to clarify (I think it is clear, but just in case): the actual action of creating a table is something that it is not dangerous, it is instantaneous and I will never block. It is not a schema change that needs to be done by a DBA (unlike an ALTER or a DROP).

I, however, would like to be pinged in terms of assuring the creations is justified and has the right properties, like:

  • It has a primary key
  • It follows mediawiki-agreed standards

Both of which seem ok here.

Of course, if you need help, explicitly say it. I would recommend using Wikimedia-Rdbms and Schema-change only for these kind of changes, and not #Database.

OK, thanks for the info. When we are ready, should I ping you to create the table? Or is that something we can do ourselves?

the actual action of creating a table is something that it is not dangerous, it is instantaneous and I will never block. It is not a schema change that needs to be done by a DBA (unlike an ALTER or a DROP).

You can do it without me, if you do not want, tell me and it will take me a second.

Catrope renamed this task from Create "echo_unseen_wikis" table on wikishared database for Echo cross-wiki notifications to Create "echo_unread_wikis" table on wikishared database for Echo cross-wiki notifications.Nov 30 2015, 6:01 PM
Catrope set Security to None.
Catrope closed this task as Resolved.Nov 30 2015, 6:16 PM
Catrope claimed this task.

I've created the table