prevent nulls (problem with my DB)

This commit is contained in:
sawka 2023-03-17 18:19:59 -07:00
parent e01a0a7fa0
commit 2ba3a09285

View File

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