The key must be indexed to apply foreign key constraint. To do that follow the steps.
- Open table structure. (2nd tab)
- See the last column action where multiples action options are there. Click on Index, this will make the column indexed.
- Open relation view and add foreign key constraint.
You will be able to assign DOCTOR_ID as foreign now.