Bypassing MySQL's `ON UPDATE CURRENT_TIMESTAMP`: A Guide to 'Silent Updates'
When using MySQL, `ON UPDATE CURRENT_TIMESTAMP` is a convenient feature for automatically updating modification times. However, sometimes we need to update certain fields without changing the timestamp—a 'silent update'. This article delves into why the simple `SET updated_at = updated_at` trick fails in specific scenarios and provides the correct solution using pre-queries and explicit assignments in the application layer, like PHP. We also analyze the architectural trade-offs between database automation and application control to help you make the best decision.