MySQL - Unique foreign key

后端 未结 4 1784
走了就别回头了
走了就别回头了 2021-01-05 03:27

I have to make one of the foreign keys unique. The problem is, I am getting the following message from the phpMyAdmin:

The following indexes appear to be equal an         


        
4条回答
  •  感动是毒
    2021-01-05 03:50

    For the future, if you want to make your foreign key unique, you can simply modify your foreign key column like this:

    ALTER TABLE your_table
    MODIFY COLUMN your_fk_column [INT, VARCHAR etc.][NOT NULL] UNIQUE;
    

提交回复
热议问题