From 8bb06ff23cdec3b75ab018e30e37e711a209b4ba Mon Sep 17 00:00:00 2001 From: Ayrat Hudaygulov Date: Mon, 22 Jul 2024 19:47:31 +0100 Subject: [PATCH] Update V9__callbacks.sql --- src/migrations/V9__callbacks.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/migrations/V9__callbacks.sql b/src/migrations/V9__callbacks.sql index 44a988b..09ed7b2 100644 --- a/src/migrations/V9__callbacks.sql +++ b/src/migrations/V9__callbacks.sql @@ -21,6 +21,11 @@ FROM (SELECT b.message_text, b.id JOIN public.banned b ON b.id = fpm.id) AS b WHERE false_positive_messages.id = b.id; +DELETE FROM false_positive_messages +WHERE ctid NOT IN (SELECT MIN(ctid) + FROM false_positive_messages + GROUP BY text); + ALTER TABLE false_positive_messages ALTER COLUMN text SET NOT NULL;