Hi I need to resolve next problem.
I have a row in mysql:
‘start_at’ and ‘ends_at’
They are Timestamps type.
I need to set default value of ends_at plus 7 days from starts_at
something like this:
ALTER TABLE `a_to_b`
MODIFY COLUMN `ends_at` timestamp NULL DEFAULT 'CURRENT_TIMESTAMP + 604800' AFTER `starts_at`;
If i am right in MSSQL i can do DATE_FROM();
How can I do this in MySql?
Thanks.
mysql does not allow computation in table structure. You need to do the insert afterwards: