There are two Datetime column in my table both having default value as "0000-00-00 00:00:00"
When I was trying to change some structure(which is not related to either of these columns)of the table, an #1067 error shows up saying `invalid default value for 'product_date_added'.
Question #1 Why a datetime column's default value can't be "0000-00-00 00:00:00"?
Then I tried to change the default value of product_date_added
, and here is what I got:
As shown in the picture, #1067 shows up for the other datetime column. And this goes vice versa, I am dumbfounding.
I tried this with other tables and they all have this issue: when trying to alter table structure, an #1067 error shows up for a datetime column whose default value is "0000-00-00 00:00:00".
I also tried to set the default value to a real datetime value from command shell, here is what I got:
As you can see, the 1067 error still shows up for the other column. Why these two column are affecting each other?
Question #2: How to solve this issue?