2022-05-22 00:06:30 +02:00
|
|
|
-- v47: Add table for keeping track of backfill state
|
|
|
|
|
|
|
|
CREATE TABLE backfill_state (
|
|
|
|
user_mxid TEXT,
|
|
|
|
portal_jid TEXT,
|
|
|
|
portal_receiver TEXT,
|
|
|
|
processing_batch BOOLEAN,
|
|
|
|
backfill_complete BOOLEAN,
|
2022-05-25 22:48:38 +02:00
|
|
|
first_expected_ts INTEGER,
|
2022-05-22 00:06:30 +02:00
|
|
|
PRIMARY KEY (user_mxid, portal_jid, portal_receiver),
|
|
|
|
FOREIGN KEY (user_mxid) REFERENCES "user" (mxid) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
FOREIGN KEY (portal_jid, portal_receiver) REFERENCES portal (jid, receiver) ON DELETE CASCADE
|
|
|
|
);
|