Hello,
I know that it is possible to have a 2-column primary key, which
enforces uniqueness of the combination of those two columns. However,
for our schema, we need to have a single column (integer) primary key,
but we still wish to enforce uniqueness across two particular columns.
For example:
id (integer primary key) | domain_name (varchar (255)) | mid (other id)
The id is, as shown, the primary key. The mid is the primary id of
another table (the management unit), with a foreign key constraint that
keeps the reference correct.
How can I make sure that the there is only one instance of a particular
domain name in each management unit?
Put another way, how can I set a (domain_name, mid) UNIQUE constraint?
Thanks,
VanL