Skip to content

Commit

Permalink
legacymigrate: fix more bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 25, 2024
1 parent 5c99708 commit 9a96655
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/mautrix-twitter/legacymigrate.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
INSERT INTO user (bridge_id, mxid, management_room, access_token)
INSERT INTO "user" (bridge_id, mxid, management_room, access_token)
SELECT '', mxid, notice_room, ''
FROM user_old;



INSERT INTO user_login (bridge_id, user_mxid, id, remote_name, space_room, metadata, remote_profile)
SELECT
'', -- bridge_id
Expand Down Expand Up @@ -80,7 +78,7 @@ SELECT
'', -- part_id
mxid, -- mxid
(SELECT twid FROM portal_old WHERE portal_old.mxid=message_old.mx_room), -- room_id
CAST(receiver as TEXT), -- room_receiver
CASE WHEN receiver<>0 THEN CAST(receiver AS TEXT) ELSE '' END, -- room_receiver
'', -- sender_id
'', -- sender_mxid
0, -- timestamp
Expand All @@ -100,7 +98,7 @@ SELECT
'', -- sender_mxid
'', -- emoji_id
(SELECT twid FROM portal_old WHERE portal_old.mxid=reaction_old.mx_room), -- room_id
CAST(tw_receiver as TEXT), -- room_receiver
CASE WHEN tw_receiver<>0 THEN CAST(tw_receiver AS TEXT) ELSE '' END, -- room_receiver
0, -- timestamp
mxid,
reaction, -- emoji
Expand Down

0 comments on commit 9a96655

Please sign in to comment.