mautrix-whatsapp/database/upgrades/47-room-backfill-state.sql
Tulir Asokan a948ea0146 Move a bunch of stuff to mautrix-go
See d578d1a610

Database upgrades from before v0.4.0 were squashed, users must update
to at least v0.4.0 before updating beyond this commit.
2022-05-22 01:06:30 +03:00

13 lines
513 B
SQL

-- 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,
first_expected_ts TIMESTAMP,
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
);