How can I define a primary key in my table as two unique fields?
I have several columns in my table and I have two keys: ID
and SOURCE
. Values for ID
can appear twice in the column, but the combination of ID + SOURCE can be relied on as a primary key.
For example:
ID | SOURCE | TEXT
------------------
UNIQUE - 2312 | FB | BLA BLA
UNIQUE - 2312 | MU | BLA BLA
I'm using MySQL database. How I can I make the primary key on two columns?