I want to add 'On delete cascade and on update restrict'
on foreign keys through phpmyadmin user Interface instead of executing query.
I generally use Heidisql control panel for doing these actions. And now I'm having hard time doing the same on phpmyadmin.
Any idea?
Use the ON DELETE CASCADE option to specify whether you want rows deleted in a child table when corresponding rows are deleted in the parent table. If you do not specify cascading deletes, the default behavior of the database server prevents you from deleting data in a table if other tables reference it.
CASCADE. It is used in conjunction with ON DELETE or ON UPDATE. It means that the child data is either deleted or updated when the parent data is deleted or updated.
In the tab where you define the table structure, you get the list of columns and their properties and underneath that there should be a link "relation view", between "print view", and "propose table structure."
That's where you want to go, but you have to have created the index on both tables already. Also, you might want to make sure you're using mysql's innoDB storage engine.
Edit : An image is worth 1000 words :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With