mediawiki-extensions-Echo/db_patches/echo_unread_wikis.sql
Kunal Mehta b85f978ddd Track what wikis a user has unread notifications on
This implements a backend layer and database storage for tracking what
wikis a user has unread notifications on. It is not yet exposed via any
API.

Whenever the notification counts on the local wiki are reset, a deferred
update is queued to also update the central database table.

Change-Id: Id1498bdeb5811d6848dc66781ffca03e726eab90
2015-11-20 15:54:11 -08:00

19 lines
647 B
SQL

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);