All pastes #415736 Raw Edit

Mine

public sql v1 · immutable
#415736 ·published 2007-03-29 20:31 UTC
rendered paste body
A PRIMARY KEY can be a multiple-column index. However, you cannot create a multiple-column index using the PRIMARY KEY key attribute in a column specification. Doing so only marks that single column as primary. You must use a separate PRIMARY KEY(index_col_name, ...) clause.AndCREATE TABLE `ask_interest`(        `question_id` INTEGER  NOT NULL,        `user_id` INTEGER  NOT NULL,        `created_at` DATETIME,        PRIMARY KEY (`question_id`,`user_id`),        CONSTRAINT `ask_interest_FK_1`                FOREIGN KEY (`question_id`)                REFERENCES `ask_question` (`id`),        INDEX `ask_interest_FI_2` (`user_id`),        CONSTRAINT `ask_interest_FK_2`                FOREIGN KEY (`user_id`)                REFERENCES `ask_user` (`id`))Type=MyISAM;