Why cannot delete from a table with reference to another

后端 未结 1 1033
花落未央
花落未央 2021-01-27 17:21

I have looked for answers but maybe I miss something. I have 2 tables see below. The entities from the first table is referenced from the second one, but when I try to delete fr

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-27 17:53

    The documentation says:

    Usually, the parent key of a foreign key constraint is the primary key of the parent table. If they are not the primary key, then the parent key columns must be collectively subject to a UNIQUE constraint or have a UNIQUE index.

    This requirement is not met for the reference to role(name).

    0 讨论(0)
提交回复
热议问题