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

Make duplicated reference error more clear #230

Closed
tntrex opened this issue Jan 26, 2022 · 2 comments
Closed

Make duplicated reference error more clear #230

tntrex opened this issue Jan 26, 2022 · 2 comments

Comments

@tntrex
Copy link

tntrex commented Jan 26, 2022

I got an error when trying to convert mysql dump with sql2dbml

ERROR: You have a syntax error at "dump.sql" line 1 column 1. Reference with same endpoints duplicated

This error doesn't really help to figure it out what's wrong with my dump. I found that this error triggered here.

I think this error message can be more clear if you can add reference details like name, endpoints, real position in source file.

Some people on the forums have also encountered this error: https://community.dbdiagram.io/t/importing-from-mysql-file/762/3

@Eunoia
Copy link

Eunoia commented Jun 8, 2022

I was able to fix this by selectively deleting portions of the file until the error went away. It looks like it had issue with the final alter table statement. Here is the obfuscated statement.

ALTER TABLE ONLY public.ducks ADD CONSTRAINT ducks_pond_id_fkey_fkey FOREIGN KEY (pond_id_fkey) REFERENCES public.ponds(id);

@nguyenalter
Copy link
Contributor

fixed in #327

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

3 participants