I need to add foreign key to MySQL table with RESTRICT rule, and something really strange happens:
When I do:
ALTER TABLE smartphone_model_work
ADD CONSTRAINT SmartphoneMW_Work
FOREIGN KEY(SmartphoneWorkID)
REFERENCES smartphone_work(SmartphoneWorkID)
ON DELETE RESTRICT;
It creates foreign key with "NO ACTION" rule, while I need "RESTRICT". But when I do:
ALTER TABLE smartphone_model_work
ADD CONSTRAINT SmartphoneMW_Work
FOREIGN KEY(SmartphoneWorkID)
REFERENCES smartphone_work(SmartphoneWorkID)
ON DELETE CASCADE;
It creates "CASCADE" constraint as expected.
So how to create RESTRICT rule?
My MySQL version is 5.7.20
Thanks.