K
K
Koal Koalich2018-02-13 15:28:22
MySQL
Koal Koalich, 2018-02-13 15:28:22

Does it make sense to set the ON UPDATE CASCADE constraint when referring to primary keys?

ALTER TABLE `tickets` ADD  CONSTRAINT `FK_user_author_id` FOREIGN KEY (`user_author_id`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

In this code, ON UPDATE CASCADE is useless? After all, the maximum that we can do is delete the record and the ID will be deleted.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2018-02-13
Tag

SO . there is even an example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question