Is there any way to set the default value for a column as an expire date (some hours from CURRENT_TIMESTAMP)?
I have already tried:
ALTER TABLE `table`
ADD COLUMN `expire` TIMESTAMP NOT NULL DEFAULT TIMESTAMPADD(HOUR, 5, CURRENT_TIMESTAMP);
But didn't work..
TIMESTAMPandDATETIMEcolumns can default toCURRENT_TIMESTAMP, but not to a value calculated by a function. Best bet is a trigger as in Ike's example.