Mysql foreign key by non unique key — how is that possible?

后端 未结 4 1986
南笙
南笙 2021-01-12 08:50

I was migrating mysql database to postgres and stumbled across the following block in DDL (Note: This is what I got from mysqldump):

CREATE TABLE `catalog_pr         


        
4条回答
  •  情歌与酒
    2021-01-12 09:26

    The most likely answer is that id really is unique in the catalog_propery_value table, but that the author declared the PK to be the superkey (id, sort) for reasons unknown, possibly having to do with indexing, rather than enforcing uniqueness.

提交回复
热议问题