dbml
dbml copied to clipboard
Make duplicated reference error more clear
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
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);