Commit# 14491 modifies the term_node table to make both tid and nid primary keys. That is,

ALTER TABLE term_node ADD PRIMARY KEY (tid,nid);

However, I've got nodes (as referenced by nid) that have multiple taxonomy terms associated with them (as reference by tid). As such, the node_term table with have duplicate entries of nid, one for each term (tid) that the node is associated with. I don't believe you can make a column a primary key if the values are not unique can you?

(Ref: http://drupal.org/node/19275)

-- timothy

Comments

chx’s picture

It's a multiple column PRIMARY KEY and it will apply unless you have the same nid-tid pair twice which shall not happen...

gábor hojtsy’s picture

Not a bug.

timothy bennett’s picture

Agreed. Mea culpa.

Based on your comments, I dug deeper into my term_node table and I actually had several duplicate tid-nid pairs. Not sure how that happened...