Reputation: 431
Whenever I update the foreign key constraint setting through mySQL workbench, the updated setting isn't saved permanently.
Despite setting the foreign key option to null and successfully saving the changes, upon reopening the alter table tab it will revert back to showing restrict. What am I doing wrongly?
Upvotes: 0
Views: 176
Reputation: 431
The updated settings to the foreign key constraints have actually already been applied just that it isn't showing on the mySQL workbench UI.
By checking the update_rule and delete_rule on mySQL, the constraints have indeed be updated to be of null action.
SELECT CONSTRAINT_NAME,
UNIQUE_CONSTRAINT_NAME,
MATCH_OPTION,
UPDATE_RULE,
DELETE_RULE,
TABLE_NAME,
REFERENCED_TABLE_NAME
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
WHERE CONSTRAINT_SCHEMA = 'node_express_mysql';
Upvotes: 0