When I tried to alter the table it showed the error:
ERROR 1067 (42000): Invalid default value for \'created_at\'
I googled for this error
Try and run the following command:
ALTER TABLE `investments`
MODIFY created_at TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
NOT NULL;
and
ALTER TABLE `investments`
MODIFY updated_at TIMESTAMP
DEFAULT CURRENT_TIMESTAMP
NOT NULL;
The reason you are getting this error is because you are not setting a default value for the created_at and updated_at fields. MySQL is not accepting your command since the values for these columns cannot be null.
Hope this helps.