Say I have a junction table to resolve a many to many relationship I have between two tables. My junction table also has its own 'Method' column to describe the relationship.
Normally, I would make a composite primary key of [a], [b] and [method] (the method needs to be part of what makes a row unique), but my problem is that [method] field can be NULL. Therefore I cannot add it to the primary key.
So what I've done is create a unique index:
ALTER TABLE A_B ADD UNIQUE INDEX `Unique` (`a`, `b`, `method`);
The table has no primary key. Is this an okay thing to do or do I need to do something differently?