Quick Start
Connect to MySQL
HTTP Tunnel
SSH Tunnel
Databases
Schema
Tables
Adding Fields and Choosing Data Types
Customising Fields
Primary Keys and Indexes
Filter Wizard
Foreign Keys
Foreign Keys Data Selection
Uniques and Checks
Rules and Triggers
Privileges
Import/Export
Function
View
Tablespace
Cast
Language
Aggregate
Conversion
Domain
Trigger Function
Operator
Operator Class
Sequence
Type
Queries
Visual Query Builder
Data
Manage Users
Backup
Data Transfer
Schedule
Server Monitor
Data Synchronization
Structure Synchronization
Console
Virtual Grouping
Maintaining your databases/tables
Preferences
General
Tabs
Tables
Queries
  Working with Foreign Keys
 

Create or Edit a Foreign key

  1. Open the table in Design View
  2. Select the Foreign keys tab
  3. To add a new foreign key, click Add Foreign Key button from the toolbar
  4. Select the fields to be included in the foreign key from a popup panel, by double-clicking on the Field Names grid or clicking the button on the right side of the field
  5. To add fields, choose the fields one by one from Available Fields
  6. You can see the selected fields on the Included Fields.
  7. Then select the reference table from the list.
  8. Select the foreign fields from the popup panel.
  9. Choose the on delete action and on update action from the list.
On Delete Action
CASCADE Deletes the corresponding foreign key.
SET NULL Sets all the columns of the corresponding foreign key to NULL.
NO ACTION Does not change the foreign key.


On Update Action
CASCADE 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.
NO ACTION Does not change the foreign key.
RESTRICT Produces an error indicating that the update would create a foreign key constraint violation.

Click Save or Save As from the toolbar when you are ready to save the table

Delete a Foreign key

  1. Open the table in Design View
  2. Select the Foreign Keys tab
  3. Select the foreign key you want to delete and click Delete Foeign Key button from the toolbar
  4. Click Save or Save As from the toolbar when you are ready to save the table