Skip to content

Commit

Permalink
legacymigrate: ignore conflict when inserting empty ghost
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 3, 2024
1 parent efc33f0 commit a58f6a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/mautrix-whatsapp/legacymigrate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ SELECT
) -- metadata
FROM puppet_old;

-- Some messages don't have senders, so insert an empty ghost to match the foreign key constraint.
INSERT INTO ghost (bridge_id, id, name, avatar_id, avatar_hash, avatar_mxc, name_set, avatar_set, contact_info_set, is_bot, identifiers, metadata)
VALUES ('', '', '', '', '', '', false, false, false, false, '[]', '{}');
VALUES ('', '', '', '', '', '', false, false, false, false, '[]', '{}')
ON CONFLICT (bridge_id, id) DO NOTHING;

INSERT INTO portal (
bridge_id, id, receiver, mxid, parent_id, parent_receiver, relay_bridge_id, relay_login_id, other_user_id,
Expand Down

0 comments on commit a58f6a9

Please sign in to comment.