Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
From: Johan De Meersman (vegivamptuxera.be)
Date: Tue Nov 10 2009 - 02:38:16 CST
I think triggers are your only option, here.
On 11/9/09, Sebastiaan van Erk <sebstersebster.com> wrote:
> I have the following model:
> Domain (*)<-(1) Account (*)<-(1) User
> That is, each user belongs to exactly 1 account, an account can have
> multiple users; each account belongs to a single domain, and a domain
> can have multiple accounts.
> A user has an email address, which must be unique across the domain
> (since it's used to log into that domain: on login you select the domain
> and then enter your email and password).
> However, the email address need *not* be unique across different
> domains. Thus, I want the following combination to be unique:
> (Domain.id, User.email)
> Is there any way I can do this without duplicating the domain id in the
> User table?
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql