NOTE: The question is about DATE type, not Datetime nor Timestamp
How to alter column of date data type to use current date by default?
I saw a lot of examples for datetime
(with time part), but not for date. I have tried:
ALTER TABLE `accounting` ALTER `accounting_date`
SET DEFAULT CURRENT_DATE;
ALTER TABLE `accounting` CHANGE `accounting_date`
`accounting_date` DATE NOT NULL DEFAULT CURRENT_DATE;
I also tried with CURDATE()
, NOW()
, CURRENT_DATE()
...