Fixes #489 - CREATE UNIQUE does not work as expected inside FOREACH