The foreign key restriction point is to prevent orphan entries in the child table. Thus, no, this cannot be done unless you cancel the foreign key relationship.
If you rely on "ON DELETE CASCADE", deleting the parent record will delete all the corresponding child elements.
If you want to delete the parent element, but save it, you need to reset the foreign key constraint or set the constraint to "ON DELETE SET NULL". If you set "ON DELETE SET NULL", then when you delete the parent record, the child records will remain, but the value of the foreign key column will be set to NULL.
source share