Skip to content

Commit

Permalink
legacymigrate: delete invalid message rows on sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 1, 2024
1 parent 65390da commit bcda88d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/mautrix-whatsapp/legacymigrate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ UPDATE message_old SET combined_id = chat_jid || ':' || (
END
) || ':' || jid;
DELETE FROM message_old WHERE timestamp<0;
-- only: sqlite for next 2 lines
DELETE FROM message WHERE rowid IN (SELECT rowid FROM pragma_foreign_key_check('message'));
DELETE FROM reaction WHERE rowid IN (SELECT rowid FROM pragma_foreign_key_check('reaction'));

INSERT INTO message (
bridge_id, id, part_id, mxid, room_id, room_receiver, sender_id, sender_mxid, timestamp, edit_count, metadata
Expand Down

0 comments on commit bcda88d

Please sign in to comment.