SQL Error

DbSchema Issues
Post Reply
asland
Posts: 1
Joined: Mon Jun 12, 2017 10:11 pm

SQL Error

Post by asland » Mon Jun 12, 2017 10:13 pm

Just got it connected to my MAMP and it was trying to update the schema and tabes.

CREATE TABLE justmarket.companies (
company_id int NOT NULL AUTO_INCREMENT,
company_name varchar(150) NOT NULL ,
system_id int NOT NULL ,
logo_file varchar(255) ,
date_created date DEFAULT CURRENT_DATE ,
parent_id int ,
date_updated date DEFAULT CURRENT_DATE ,
mark_up date NOT NULL DEFAULT 2 ,
CONSTRAINT pk_companies PRIMARY KEY ( company_id )
) engine=InnoDB


ERROR:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'CURRENT_DATE ,
parent_id int ,
date_updated date DEFAU' at line 6

support
Posts: 69
Joined: Tue Dec 01, 2015 8:44 am

Re: SQL Error

Post by support » Wed Oct 18, 2017 7:42 am

For me this works fine.
It may be that in some old versions of MySql they had another keyword for CURRENT_DATE. Please check. You can configure this in DbSchema Edit / Rdbms Settings / SQL language and Settings.

An error I got is with default value for mark_up. The default value should be also a date.

mark_up date NOT NULL DEFAULT 2 ,

Post Reply