From 29d248b125a84b4d0ffb88b1ac9a05219c764bc2 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 26 Jun 2024 21:32:05 +0300 Subject: [PATCH] v2: fix more legacymigrate.sql issues --- cmd/mautrix-signal-v2/legacymigrate.sql | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/mautrix-signal-v2/legacymigrate.sql b/cmd/mautrix-signal-v2/legacymigrate.sql index 32f7aa05..ba91f9ce 100644 --- a/cmd/mautrix-signal-v2/legacymigrate.sql +++ b/cmd/mautrix-signal-v2/legacymigrate.sql @@ -75,7 +75,7 @@ INSERT INTO message ( SELECT '', -- bridge_id cast(sender AS TEXT) || '|' || timestamp, -- id - CAST(part_index AS TEXT), -- part_id + CASE WHEN part_index=0 THEN '' ELSE CAST(part_index AS TEXT) END, -- part_id mxid, signal_chat_id, -- room_id CASE @@ -85,10 +85,7 @@ SELECT cast(sender AS TEXT), -- sender_id timestamp * 1000000, NULL, -- relates_to - -- only: postgres - '{}'::jsonb -- metadata - -- only: sqlite (line commented) --- '{}' + '{}' -- metadata FROM message_old; INSERT INTO disappearing_message (