|  | Posted by thehuby on 10/07/05 15:44 
Can anyone help me define the syntax for creating compound keys inmysql?
 
 I want to have a pair of foreign keys as a compound primary key in a
 table.
 
 Also - can anyone tell me if MySQL supports foreign key constraints
 correctly?  I  have written the SQL for them and even added it to the
 database successfully, but it doesn't seem to stop me adding whatever
 values I want to into the fields.  Someone mentioned innoDB or
 something but I am not sure what it is.
 
 MySQL syntax for the table in question is below:
 
 CREATE TABLE authorisation_config (
 fk_user_id INT(3) NOT NULL,  /* FK user */
 fk_website_section_id INT(3) NOT NULL,  /* FK website_section */
 auth_type ENUM ("contributor", "approver", "contributor/approver" )
 NOT NULL DEFAULT 1
 );
 
 Regards,
 
 Rick
  Navigation: [Reply to this message] |