ACT-1890: Multi tenancy support: QA fix (and fixing update sql which was wrong)