title: Two-way foreign key constraint in a 1:1 relation
body: <p>I am using a MySQL database. In my relational data model, I've got two entities that relate 1:1 to each other. In my schema, a 1:1 relation is set up by putting a FK field in one of the two tables, that relates to the PK of the other table. Both tables have PKs and they are both auto increment BIGINTs.</p>
  
  <p>I am wondering whether it would be possible to have an <code>ON DELETE CASCADE</code> behaviour on them that works both ways.</p>
  
  <p>i.e. A 1:1 B, means that [ deleting A also deletes B ] as well as [ deleting B also deletes A ].</p>
  
  <p>I realise that this may not be absolutely necessary in terms of proper application design, but I am just wondering whether it is actually possible. As far as I recall, you can't put an FK constraint on a PK.</p>