Skip to content

Commit

Permalink
legacymigrate: fix more postgres things
Browse files Browse the repository at this point in the history
[skip cd]
  • Loading branch information
tulir committed Aug 15, 2024
1 parent 8db9c2f commit d986da8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmd/mautrix-gmessages/legacymigrate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ INSERT INTO ghost (
)
SELECT DISTINCT
'', CAST(conv_receiver AS TEXT) || '.' || sender, '', '', '', '', false, false, false, false,
-- only: postgres for next 2 lines
'[]'::jsonb,
'{}'::jsonb
-- only: sqlite for next 2 lines (lines commented)
-- '[]',
-- '{}'
-- only: postgres
'[]'::jsonb, '{}'::jsonb
-- only: sqlite (line commented)
-- '[]', '{}'
FROM message_old
WHERE true
ON CONFLICT DO NOTHING;
Expand Down Expand Up @@ -184,8 +182,8 @@ SELECT
FROM reaction_old
WHERE EXISTS(SELECT 1 FROM message_old WHERE message_old.conv_receiver=reaction_old.conv_receiver and message_old.id=reaction_old.msg_id);

DROP TABLE portal_old;
DROP TABLE puppet_old;
DROP TABLE message_old;
DROP TABLE reaction_old;
DROP TABLE message_old;
DROP TABLE puppet_old;
DROP TABLE portal_old;
DROP TABLE user_old;

0 comments on commit d986da8

Please sign in to comment.