My sql query looks like this
ALTER TABLE `exercises`
ADD COLUMN `creation_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `lesson_id`,
ADD COLUMN `modification_dt` timestamp NULL DEFAULT '' ON UPDATE CURRENT_TIMESTAMP AFTER `creation_dt`;
But getting error message

How can I fix this problem?
As shown in the screenshot, this is error code
1293. The reason for this error seems to be some implementation details in MySQL.You could get around it by using a column of type
DATETIMEbut this does not allow setting the current time asdefaultvalue. However, you can solve this in your application code or by using a trigger. I used a sample table (calleddatetimetest) and added the trigger like this:Database schema:
You can do the same for the
modifiedfield using a triggerBEFORE UPDATEor keep your solution as you now only have oneTIMESTAMPcolumn that gets set toCURRENT_TIMESTAMPON UPDATE.