'MySQL options for specifying ON UPDATE on non-reference columns

We all know ADD COLUMN updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP for the updated_at column.

That got me thinking about what is permitted to specify in the "ON UPDATE" clause. I couldn't find anything in the docs. Note that I am not talking about reference columns but about non-reference columns only.

I tried ALTER TABLE on_update_test ADD COLUMN test_const INT ON UPDATE 123 but that results in an error.

So is ON UPDATE CURRENT_TIMESTAMP the only valid usage for ON UPDATE on non-reference columns? Or are there more options?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source