dbml icon indicating copy to clipboard operation
dbml copied to clipboard

You have a syntax error at "test.sql" line 5 column 3. Expected ")" or fields but "K" found.

Open calvin2021y opened this issue 2 years ago • 5 comments

CREATE TABLE `test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
 `gid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `gid` (`gid`) USING BTREE
);

calvin2021y avatar Apr 08 '22 05:04 calvin2021y

any one care to comment ?

calvin2021y avatar Apr 09 '22 12:04 calvin2021y

I think the SQL should be:

CREATE TABLE `test` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `gid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `gid` USING BTREE (`gid`)
);

I tested the above SQL, and it works.

TeaNguyen avatar Apr 09 '22 16:04 TeaNguyen

This is a SQL dump by mysqldump.

calvin2021y avatar Apr 09 '22 17:04 calvin2021y

hi @TeaNguyen

this will not work if you have a lot tables dump my mysql tools. I hope DBML can support mysqldump without extra work.

calvin2021y avatar Apr 12 '22 16:04 calvin2021y

@TeaNguyen

Mysql also use this:

PRIMARY KEY (`id`) USING BTREE,

DBML can not parse it.

I check with atlas and it work.

calvin2021y avatar Apr 12 '22 16:04 calvin2021y