2012-04-27 15:14:24 +00:00
|
|
|
-- Database Schema for Echo notification system
|
|
|
|
|
|
|
|
CREATE TABLE /*_*/echo_subscription (
|
|
|
|
sub_user int unsigned not null,
|
|
|
|
sub_event_type varchar(64) binary not null,
|
|
|
|
sub_page_namespace int unsigned null,
|
|
|
|
sub_page_title varchar(255) binary null,
|
|
|
|
sub_notify_type varchar(64) binary not null,
|
|
|
|
sub_enabled tinyint(1) unsigned not null default 1
|
|
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
|
2012-05-17 00:17:03 +00:00
|
|
|
CREATE UNIQUE INDEX /*i*/user_subscriptions ON /*_*/echo_subscription (sub_user,sub_event_type,sub_page_namespace,sub_page_title,sub_notify_type,sub_enabled);
|
|
|
|
CREATE INDEX /*i*/page_subscriptions ON /*_*/echo_subscription (sub_page_namespace,sub_page_title,sub_event_type,sub_user);
|
2012-04-27 15:14:24 +00:00
|
|
|
|
|
|
|
CREATE TABLE /*_*/echo_event (
|
|
|
|
event_id int unsigned not null primary key auto_increment,
|
|
|
|
event_timestamp binary(14) not null,
|
|
|
|
event_type varchar(64) binary not null,
|
2012-05-18 01:07:30 +00:00
|
|
|
event_variant varchar(64) binary null,
|
2012-04-27 15:14:24 +00:00
|
|
|
event_agent_id int unsigned null, -- The user who triggered it, if any
|
|
|
|
event_agent_ip varchar(255) binary null, -- IP address who triggered it, if any
|
|
|
|
event_page_namespace int unsigned null,
|
|
|
|
event_page_title varchar(255) binary null,
|
2012-07-27 22:16:19 +00:00
|
|
|
event_extra BLOB NULL
|
2012-04-27 15:14:24 +00:00
|
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
|
|
|
|
CREATE INDEX /*i*/type_page ON /*_*/echo_event (event_type,event_page_namespace,event_page_title,event_timestamp);
|
|
|
|
|
|
|
|
CREATE TABLE /*_*/echo_notification (
|
|
|
|
notification_event int unsigned not null,
|
|
|
|
notification_user int unsigned not null,
|
|
|
|
notification_timestamp binary(14) not null,
|
|
|
|
notification_read_timestamp binary(14) null
|
|
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
|
|
|
|
CREATE INDEX /*i*/user_timestamp ON /*_*/echo_notification (notification_user,notification_timestamp);
|
2012-05-17 00:17:03 +00:00
|
|
|
CREATE UNIQUE INDEX /*i*/user_event ON /*_*/echo_notification (notification_user,notification_event);
|
2012-11-27 01:53:35 +00:00
|
|
|
|
|
|
|
CREATE TABLE /*_*/echo_email_batch (
|
|
|
|
eeb_id int unsigned not null primary key auto_increment,
|
|
|
|
eeb_user_id int unsigned not null,
|
|
|
|
eeb_event_priority tinyint unsigned not null default 10, -- event priority
|
|
|
|
eeb_event_id int unsigned not null
|
|
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX /*i*/echo_email_batch_user_event ON /*_*/echo_email_batch (eeb_user_id,eeb_event_id);
|
|
|
|
CREATE UNIQUE INDEX /*i*/echo_email_batch_user_priority_event ON /*_*/echo_email_batch (eeb_user_id,eeb_event_priority,eeb_event_id);
|