. Cascade Way
Synchronize update/delete out a matching record of a child table when Update/delete records on the parent table
. Set NULL mode
Set the column of the matching record on the child table to NULL when the record is update/delete on the parent table
Note that the foreign key column of the child table cannot be not NULL
. No Action Mode
If there are matching records in the child table, the Update/delete action is not allowed for the parent table corresponding to the candidate key
. Restrict Way
Same no action, check foreign KEY constraints immediately
. Set default mode
When a parent table has a change, the child table sets the foreign key column to a default value but InnoDB does not recognize
To set foreign keys with Navicat Note:
The table engine must be InnoDB (both the parent and child tables are, and the child table is a table with a foreign key)
The foreign key and the associated field name type must be exactly the same (eat the unsigned of the loss)
MySQL setting foreign keys