Toad World® Forums

Problem on removing unwanted foreign key


#1

Hi

I am having a problem on removing one of the foreign key, Actually I have the similar from my previous post about not able to remove the foreign key. I have created 3 tables, E.g. Schools, Classes, Student. Please find the attached model.
When I joined Classes and Student table together, it creates an foreign key automatically on student table automatically and I am not able to remove school_id field.

I am wondering If it has anyway that I could remove the school_id field (FK) on my student table.

Please let me know if you want me to explain more.

Many thanks

Chi
TDM-shadows.png


#2

From where are you trying to delete it?

From Physical Model Explorer delete = delete object
From workspace delete = delete shortcut and CTRL + delete = delete object


#3

Hello,

The FK is displayed in the Students entity as there is the identifying relationship between Schools and Classes. The FK is transferred automatically. (We’ve already discussed the FK issue. FKs are created via relationships. No FK itself can be deleted.)

If you don’t want the school_id (FK) to be in the Students entity, please change type of the Relationship1 to non-identifying:

  1. right-click the relationship | Edit2. clear the Identifying checkbox.

Please see the attached model.

If you have any questions, please write me back.

Thanks.

Vladka
exampleschool.txp (36 KB)


#4

Thanks for your explanation

I understood now

Thanks a lot

Chi


#5

It’s a pleasure.

Vladka