Fixing QA and database quirks when handling null values in unique constraint in the context of multi tenancy.
Fix multi tenancy on Oracle: oracle treats empty strings as null. Build workaround in queries in.
Merge from upstream