I have table as shown below. In order to workaround one default now column restriction of MySQL I used the tip as shown here
CREATE TABLE IF NOT EXISTS mytable (
id INT NOT NULL AUTO_INCREMENT ,
create_date TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00' ,
update_date TIMESTAMP NULL DEFAULT NOW() ON UPDATE NOW() ,
PRIMARY KEY (`parti_id`) )
ENGINE = InnoDB;
My sql_mode does not include NO_ZERO_DATE
as pointed here my output :
mysql> SELECT @@sql_mode;
+------------+
| @@sql_mode |
+------------+
| |
+------------+
1 row in set (0.00 sec)
It is still giving the error as shown below:
ERROR 1067 (42000) at line xx in file: '/myschema.sql': Invalid default value for 'create_date'
I use MySQL 5.1.37 on Ubuntu
How can I fix it? Thanks.