Foreign Key Editor
Top  Previous  Next


This window allows you to create and edit foreign keys for the table.

The following foreign key properties are available:

Foreign Key Name
Name of the foreign key, it must be unique for the current database.

Foreign Table
Select the foreign table for the key from the drop-down list of the database tables.

Available Fields/Included Fields
To include fields to the key, move the fields from the Available Fields list to the Included fields by double-clicking or dragging them. To remove the fields from the key, move them back in the same way. You can also use buttons >, < to move the selected fields (multiple fields are selected by Ctrl or Shift).

On Delete Action, On Update Action
Choose an action for changing the foreign key in case of primary key change (separately on deleting and updating a record). The following variants are possible:

NO ACTION
Does not change the foreign key; may cause the primary key update to fail due to referential integrity checks;
RESTRICT
The same as NO ACTION;
CASCADE
For ON DELETE, deletes the corresponding foreign key; for ON UPDATE, updates the corresponding foreign key to the new value of the primary key;
SET NULL
Sets all the columns of the corresponding foreign key to NULL;
SET DEFAULT
Sets every column of the corresponding foreign key to its default value in effect when the referential integrity constraint is defined; when the default for a foreign column changes after the referential integrity constraint is defined, the change does not have an effect on the default value used in the referential integrity constraint.


Deferrable
Check Deferrable and set the Deferred check time to make the key deferrable. A constraint that is not deferrable will be checked immediately after every command. Checking of constraints that are deferrable may be postponed until the end of the transaction.

See also:
Table Editor
Field Editor
Check Editor
Index Editor
Compile Window


Availability:
Windows Professional

Yes

Windows Lite

Yes

Linux Professional

Yes

Linux Lite

Yes