-- ------------------------------------------
-- When Approver email is not filled out
-- make sure email from um_user is filled in.
-- first set empty email field to NULL
-- then copy email from um_user
-- ------------------------------------------
-- THIS SHOULD NOT BE DONE ANYWAY!
-- ------------------------------------------
--UPDATE sod_approvers
--	SET email = CASE
--		WHEN email = '' THEN NULL
--		ELSE email
--	END
--WHERE id <> 0;
--UPDATE sod_approvers
--	SET email = CASE
--		WHEN email IS NULL THEN (
--			SELECT mail FROM um_user WHERE 
--				um_user.user = sod_approvers.user AND
--				um_user.system = sod_approvers.system AND
--				um_user.client = sod_approvers.client
--		)
--		ELSE email
--	END
--WHERE id <> 0;
--