All the foreign key constraints (where the contents of one or more columns in a table is constrained to be among the values of one or more columns of another table) are analysed and reported in the. Foreign key constraints help understand the database schema and is automatically used where appropriate by the application.
However sometimes the designer of a database has forgotten or did not whish to use foreign key constraints, and so it is possible to "declare foreign keys" which are only declaration to the tool and not actually defined in the database.
the (foreign key name, table, referenced table) triplet uniquely identifies a declared foreign key and thus declaring a new foreign key with the same triplet will remove any previously declared one.
If the same constraint is actually represented by a real foreign key and also by a declared foreign key, then the real foreign key definition will mask the declared one
Declared foreign key don't have any policy to determine what action to perform on UPDATE or DELETE situations, so the reported policy will always be "not enforced"
A new foreign key can be declared from the Table ▸ Declare foreign key menu which is present when a table's properties are shown in the current tab.using the
Another way of declaring a foreign key is using the contextual menu on a table in a diagram, and selecting the Declare foreign key for this table option.
In any way, to declare a new foreign key, the following information must be provided:
A foreign key name
The referenced table
Columns and referenced columns for each column involved in the foreign key
A declared foreign key can be removed by clicking on the (Remove) link displayed below each declared foreign key properties in the table's properties (in the ).
Another way to remove a declared foreign key is in a Remove this declared foreign key option.page through the contextual menu associated with the dashed line representing the declared foreign key, selecting the
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.