What does ON UPDATE RESTRICT do?

MysqlDatabaseDatabase Design

Mysql Problem Overview


...
user_id INTEGER NOT NULL, 
CONSTRAINT fk_user_meta FOREIGN KEY (user_id)
	REFERENCES users (id) ON DELETE CASCADE ON UPDATE RESTRICT

I know from here that ON DELETE CASCADE means that if I delete a row from the users table, then the associated row from the user meta table will be removed too. But what does ON UPDATE RESTRICT do?

Mysql Solutions


Solution 1 - Mysql

RESTRICT prevents the action from happening if there's any foreign keys that rely on the field that's being changed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexView Question on Stackoverflow
Solution 1 - MysqlChris EberleView Answer on Stackoverflow