0

I have a table called citizens with a primary key called cpr.

I have another table called care. In this table, I have also created a column with the name cpr. When I go into the Foreign Keys tab, I enter fk_citizen_cpr as the foreign key name, and reference the citizens table. Then I see checkboxes for the columns in the citizens table, but I can't check cpr or any of them for that matter.

enter image description here

What am I doing wrong? Thanks.

Waqas Shabbir
  • 755
  • 1
  • 14
  • 34
Jesper
  • 2,644
  • 4
  • 30
  • 65
  • I contributed to this checklist for what's required before you can create a foreign key, you might find it helps: https://stackoverflow.com/a/4673775/20860 – Bill Karwin Feb 01 '19 at 02:56
  • @BillKarwin I went through the list, and it seems like everything is as it should be. The only difference between them as far as I can tell is that `cpr` in `citizens` is also a primary key, while in `care` it is not... – Jesper Feb 01 '19 at 13:52
  • I tried deleting my tables and creating them again. Now it works for some reason... – Jesper Feb 01 '19 at 14:15

0 Answers0