Giving error when importing the file
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'time zone not null, updated_at timestamp with time zone not null,
@iampankajkumar which version of mysql are you using? Is this happening running the initial script? or adding values?
If you are inserting data, you can put a timestamp in the updated field, as is required to be 'not null'.
pankaj@DESKTOP-ELG78SB:~$ mysql --version mysql Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using EditLine wrapper
Please help me to write the query to create table.
@iampankajkumar the error is on the updated_at and inserted_at fields. you could replace on a/export/ecommerce-db-mysql-innodb.sql file :
- inserted_at timestamp with time zone not null,
- updated_at timestamp with time zone not null,
+ inserted_at timestamp default 0,
+ updated_at timestamp default 0,
all the ocurrences.
If you are using a framework to use the template, you will find some shortcuts to fill out those fields for you. if not, you could initialize it by yourself on the database table definition[1].
[1] https://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html