From 2ba3a0928554f493d313b9d71df46e89f15b60d0 Mon Sep 17 00:00:00 2001 From: sawka Date: Fri, 17 Mar 2023 18:19:59 -0700 Subject: [PATCH] prevent nulls (problem with my DB) --- db/migrations/000010_removewindowid.up.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrations/000010_removewindowid.up.sql b/db/migrations/000010_removewindowid.up.sql index c131c7b51..10b1bbc0d 100644 --- a/db/migrations/000010_removewindowid.up.sql +++ b/db/migrations/000010_removewindowid.up.sql @@ -2,12 +2,12 @@ ALTER TABLE remote_instance RENAME COLUMN windowid TO screenid; ALTER TABLE line RENAME COLUMN windowid TO screenid; UPDATE remote_instance -SET screenid = (SELECT screen.screenid FROM screen WHERE screen.windowid = remote_instance.screenid) +SET screenid = COALESCE((SELECT screen.screenid FROM screen WHERE screen.windowid = remote_instance.screenid), '') WHERE screenid <> '' ; UPDATE line -SET screenid = (SELECT screen.screenid FROM screen WHERE screen.windowid = line.screenid) +SET screenid = COALESCE((SELECT screen.screenid FROM screen WHERE screen.windowid = line.screenid), '') WHERE screenid <> '' ;