MySQL Forums
Forum List  »  Ruby

How to use a primary key different from `id'?
Posted by: Quique _
Date: May 28, 2010 04:08AM

Thank you very much for this informative article.

I have a question though:
what should I do if I don't want the primary key to be `id', but some other attribute?

Example:

CREATE TABLE products (
name varchar(100),
description text,
PRIMARY KEY (name)
) ENGINE=INNODB;

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
How to use a primary key different from `id'?
May 28, 2010 04:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.