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 <> '' ;