From a87ee030fcfd3315d873d255dd91bc0a19fdd4af Mon Sep 17 00:00:00 2001 From: iequidoo Date: Sat, 5 Jul 2025 16:26:46 -0300 Subject: [PATCH] fix: migrate_key_contacts(): Remove "id>9" from encrypted messages SELECT + Replace LIKE with GLOB, the latter is case-sensitive. --- src/sql/migrations.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sql/migrations.rs b/src/sql/migrations.rs index 76ea8ee69..6f8f27d27 100644 --- a/src/sql/migrations.rs +++ b/src/sql/migrations.rs @@ -1838,9 +1838,8 @@ fn migrate_key_contacts( .prepare( "SELECT id, from_id, to_id FROM msgs - WHERE id>9 - AND (param LIKE '%\nc=1%' OR param LIKE 'c=1%') - AND chat_id>9 + WHERE chat_id>9 + AND (param GLOB '*\nc=1*' OR param GLOB 'c=1*') ORDER BY id DESC LIMIT 10000", ) .context("Step 32")?;