Debian Codegraph @

extensions/Echo/sql/sqlite/tables-generated.sql

raw
1 -- This file is automatically generated using maintenance/generateSchemaSql.php.
2 -- Source: sql/tables.json
3 -- Do not modify this file directly.
4 -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 CREATE TABLE /*_*/echo_event (
6 event_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
7 event_type BLOB NOT NULL, event_variant BLOB DEFAULT NULL,
8 event_agent_id INTEGER UNSIGNED DEFAULT NULL,
9 event_agent_ip BLOB DEFAULT NULL,
10 event_extra BLOB DEFAULT NULL, event_page_id INTEGER UNSIGNED DEFAULT NULL,
11 event_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL
12 );
13
14 CREATE INDEX echo_event_type ON /*_*/echo_event (event_type);
15
16 CREATE INDEX echo_event_page_id ON /*_*/echo_event (event_page_id);
17
18
19 CREATE TABLE /*_*/echo_notification (
20 notification_event INTEGER UNSIGNED NOT NULL,
21 notification_user INTEGER UNSIGNED NOT NULL,
22 notification_timestamp BLOB NOT NULL,
23 notification_read_timestamp BLOB DEFAULT NULL,
24 notification_bundle_hash BLOB NOT NULL,
25 PRIMARY KEY(
26 notification_user, notification_event
27 )
28 );
29
30 CREATE INDEX echo_user_timestamp ON /*_*/echo_notification (
31 notification_user, notification_timestamp
32 );
33
34 CREATE INDEX echo_notification_event ON /*_*/echo_notification (notification_event);
35
36 CREATE INDEX echo_notification_user_read_timestamp ON /*_*/echo_notification (
37 notification_user, notification_read_timestamp
38 );
39
40
41 CREATE TABLE /*_*/echo_email_batch (
42 eeb_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
43 eeb_user_id INTEGER UNSIGNED NOT NULL,
44 eeb_event_priority SMALLINT UNSIGNED DEFAULT 10 NOT NULL,
45 eeb_event_id INTEGER UNSIGNED NOT NULL,
46 eeb_event_hash BLOB NOT NULL
47 );
48
49 CREATE UNIQUE INDEX echo_email_batch_user_event ON /*_*/echo_email_batch (eeb_user_id, eeb_event_id);
50
51 CREATE INDEX echo_email_batch_user_hash_priority ON /*_*/echo_email_batch (
52 eeb_user_id, eeb_event_hash, eeb_event_priority
53 );
54
55
56 CREATE TABLE /*_*/echo_target_page (
57 etp_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
58 etp_page INTEGER UNSIGNED DEFAULT 0 NOT NULL,
59 etp_event INTEGER UNSIGNED DEFAULT 0 NOT NULL
60 );
61
62 CREATE INDEX echo_target_page_event ON /*_*/echo_target_page (etp_event);
63
64 CREATE INDEX echo_target_page_page_event ON /*_*/echo_target_page (etp_page, etp_event);
65
66
67 CREATE TABLE /*_*/echo_push_provider (
68 epp_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
69 epp_name BLOB NOT NULL
70 );
71
72
73 CREATE TABLE /*_*/echo_push_subscription (
74 eps_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
75 eps_user INTEGER UNSIGNED NOT NULL,
76 eps_token BLOB NOT NULL,
77 eps_token_sha256 CHAR(64) NOT NULL,
78 eps_provider SMALLINT UNSIGNED NOT NULL,
79 eps_updated DATETIME NOT NULL,
80 eps_data BLOB DEFAULT NULL,
81 eps_topic SMALLINT UNSIGNED DEFAULT NULL
82 );
83
84 CREATE UNIQUE INDEX eps_token_sha256 ON /*_*/echo_push_subscription (eps_token_sha256);
85
86 CREATE INDEX eps_provider ON /*_*/echo_push_subscription (eps_provider);
87
88 CREATE INDEX eps_topic ON /*_*/echo_push_subscription (eps_topic);
89
90 CREATE INDEX eps_user ON /*_*/echo_push_subscription (eps_user);
91
92 CREATE INDEX eps_token ON /*_*/echo_push_subscription (eps_token);
93
94
95 CREATE TABLE /*_*/echo_push_topic (
96 ept_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
97 ept_text BLOB NOT NULL
98 );