Reputation: 2096
Is ON UPDATE
specific for TIMESTAMP
cols?
When I use it on cols with other types it causes a syntax error.
Upvotes: 0
Views: 44
Reputation: 30711
Whilst I'm no Mysql expert, yes it looks like that particular syntax is TIMESTAMP specific.
From the documentation:
To specify automatic properties, use the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses.
Then a little later:
Use of DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP is specific to TIMESTAMP.
Upvotes: 2