From 0608881954b1104c738c3691cdebf2d7c09a4351 Mon Sep 17 00:00:00 2001 From: Muhammed Hussein karimi Date: Thu, 9 Nov 2023 20:02:54 +0330 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20kafka=20producer=20boolea?= =?UTF-8?q?ns=20migration=20null=20values=20(#3984)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Muhammed Hussein Karimi --- db/patch-fix-kafka-producer-booleans.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db/patch-fix-kafka-producer-booleans.sql b/db/patch-fix-kafka-producer-booleans.sql index 810ec92e3..505f65a95 100644 --- a/db/patch-fix-kafka-producer-booleans.sql +++ b/db/patch-fix-kafka-producer-booleans.sql @@ -16,8 +16,11 @@ ALTER TABLE monitor ADD COLUMN kafka_producer_allow_auto_topic_creation BOOLEAN default 0 NOT NULL; -- Set bring old values from `_old` COLUMNs to correct ones -UPDATE monitor set kafka_producer_allow_auto_topic_creation = monitor.kafka_producer_allow_auto_topic_creation_old; -UPDATE monitor set kafka_producer_ssl = monitor.kafka_producer_ssl_old; +UPDATE monitor SET kafka_producer_allow_auto_topic_creation = monitor.kafka_producer_allow_auto_topic_creation_old + WHERE monitor.kafka_producer_allow_auto_topic_creation_old IS NOT NULL; + +UPDATE monitor SET kafka_producer_ssl = monitor.kafka_producer_ssl_old + WHERE monitor.kafka_producer_ssl_old IS NOT NULL; -- Remove old COLUMNs ALTER TABLE monitor