Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giving error when importing the file #4

Open
iampankajkumar opened this issue Nov 11, 2019 · 3 comments
Open

Giving error when importing the file #4

iampankajkumar opened this issue Nov 11, 2019 · 3 comments

Comments

@iampankajkumar
Copy link

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,

@ramortegui
Copy link
Owner

ramortegui commented Nov 12, 2019

@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'.

@iampankajkumar
Copy link
Author

iampankajkumar commented Nov 12, 2019

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.

@ramortegui
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants