mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 10:34:54 +00:00
d35c502b60
MediaWiki does not use foreign keys in the database schema Additional changes to the schema: - Mysql and sqlite creates index for each foreign keys, keep the index to allow fast joins with this columns by explicit statement on new wikis - Explicit create statement for the UNIQUE index on column eps_token_sha256 to make the index more visible on the sql file - Rename existing index to match the prefix for existing indexes Bug: T306473 Change-Id: I4bd29a6d0f9515e1a678c2a967799b90ef22f7b9
26 lines
1.2 KiB
SQL
26 lines
1.2 KiB
SQL
-- Stores push subscriptions associated with wiki users.
|
|
CREATE TABLE /*_*/echo_push_subscription (
|
|
eps_id INT UNSIGNED NOT NULL PRIMARY KEY auto_increment,
|
|
-- central user ID
|
|
eps_user INT UNSIGNED NOT NULL,
|
|
-- platform-provided push subscription token
|
|
eps_token BLOB NOT NULL,
|
|
-- SHA256 digest of the push subscription token (to be used as a uniqueness constraint, since
|
|
-- the tokens themselves may be large)
|
|
eps_token_sha256 CHAR(64) NOT NULL,
|
|
-- push provider ID, expected to reference values 'fcm' or 'apns'
|
|
eps_provider TINYINT UNSIGNED NOT NULL,
|
|
-- last updated timestamp
|
|
eps_updated TIMESTAMP NOT NULL,
|
|
-- push subscription metadata (e.g APNS notification topic)
|
|
eps_data BLOB,
|
|
-- APNS topic ID, references a row ID (ept_id) from echo_push_topic
|
|
eps_topic TINYINT UNSIGNED
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
CREATE UNIQUE INDEX /*i*/eps_token_sha256 ON /*_*/echo_push_subscription (eps_token_sha256);
|
|
CREATE INDEX /*i*/eps_provider ON /*_*/echo_push_subscription (eps_provider);
|
|
CREATE INDEX /*i*/eps_topic ON /*_*/echo_push_subscription (eps_topic);
|
|
CREATE INDEX /*i*/eps_user ON /*_*/echo_push_subscription (eps_user);
|
|
CREATE INDEX /*i*/eps_token ON /*_*/echo_push_subscription (eps_token(10));
|